PenGPT: A Generative Transformer for Handwriting and Sketches

310 points · 53 comments on HN · read original →

Points and comments are a snapshot, not live.

A small transformer learns to write in many hands and draw from text.

PenGPT is a 6M-parameter transformer (handwriting) and 54M-parameter (sketches) that generates pen strokes from text. The author built the handwriting dataset from scans of 495,590 words by 1,255 writers, using a vision-language model to find legible pages and InkSight to trace strokes. The drawing dataset has 477,670 sketches from 10 public sets. The model can pick up a new writer's style from a few real words without fine-tuning. Ablations show data quality and augmentation matter most; BPE tokenization and model size barely matter. The drawing model handles blends but fails on positional prompts.

What commenters are saying

Commenters were impressed by the project's results given its small size, with several noting the implications for synthetic data generation in OCR and handwriting recognition. A common criticism targeted the author's disclosure that the post text was written by Claude, though the author apologized and explained the time constraints. Some noted that the grid-based quantization likely limits output quality, and that the model handles Latin script poorly for non-English languages and fails on Spanish, Polish, and positional prompts.