arXiv:2504.00051cs.LGcs.AI2025-04

将手写笔迹转为极坐标令牌,用标准GPT生成逼真连笔字。

The Cursive Transformer

  • 用极坐标离散化笔迹偏移,转为普通文本令牌序列训练
  • 仅需3500个手写字词+简单增强即可生成真实连笔字
  • 无需特殊结构,比传统RNN方法更简单高效

在分词文本、音频和图像上训练的Transformer可生成高质量自回归样本,但以笔迹坐标序列表示的手写数据仍研究不足。本文提出一种新分词方案:将笔画偏移转换为极坐标,离散化为桶,再转化为令牌序列,用于训练标准GPT模型。该方法无需专用架构(如混合密度网络或Graves 2014的自推进ASCII注意力头),即可捕捉复杂笔画分布。仅用3,500个手写字词和少量数据增强,便训练出能生成逼真连笔字的模型。该方法比以往RNN-based方法更简洁且性能更优。

原文摘要 · Abstract (English)

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.

手写生成Transformer极坐标

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。