Abstract
Transformers trained on tokenized text, audio, and images can generate high-quality autoregressive samples. But handwriting data, represented as sequences of pen coordinates, remains underexplored. We introduce a novel tokenization scheme that converts pen stroke offsets to polar coordinates, discretizes them into bins, and then turns them into sequences of tokens with which to train a standard GPT model. This allows us to capture complex stroke distributions without using any specialized architectures (eg. the mixture density network or the self-advancing ASCII attention head from Graves 2014). With just 3,500 handwritten words and a few simple data augmentations, we are able to train a model that can generate realistic cursive handwriting. Our approach is simpler and more performant than previous RNN-based methods.
Abstract (translated)
基于标记化的文本、音频和图像训练的Transformers能够生成高质量的自回归样本。然而,手写数据以笔迹坐标序列的形式表示时,则较少被探索。我们引入了一种新颖的标记化方案,该方案将笔划偏移转换为极坐标,并将其离散化为若干区间,然后将这些区间转化为用于训练标准GPT模型的令牌序列。这使我们在不使用任何专门架构(如Graves 2014年提出的混合密度网络或自我推进ASCII注意头)的情况下捕捉复杂的笔迹分布成为可能。仅通过3,500个手写单词以及一些简单的数据增强,我们就能训练出能够生成逼真的连贯书写的手写模型。我们的方法比以前基于RNN的方法更简单且性能更好。
URL
https://arxiv.org/abs/2504.00051