English

The Cursive Transformer

Machine Learning 2025-04-02 v1 Artificial Intelligence Computation and Language

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.

Keywords

Cite

@article{arxiv.2504.00051,
  title  = {The Cursive Transformer},
  author = {Sam Greydanus and Zachary Wimpee},
  journal= {arXiv preprint arXiv:2504.00051},
  year   = {2025}
}

Comments

11 pages, 8 figures

R2 v1 2026-06-28T22:41:07.943Z