PenGPT: a generative transformer for handwriting and sketches
Sam Greydanus
PenGPT is a generative transformer model for producing handwriting and sketches, shared on a personal blog and discussed on Hacker News.
Source: greydanus.github.io ↗ · By CapyLaunch
Quick facts
| Author | Sam Greydanus, personal blog |
|---|---|
| Handwriting model | 6M parameters, writes print and cursive |
| Drawing model | 54M parameters, draws from text prompt |
| Handwriting data | 495,590 words by 1,255 writers, from scans |
| Drawing data | 477,670 sketches from ten public datasets |
| Resources | Paper, code and weights linked from the post |
What is it
PenGPT is a generative transformer for producing handwriting and sketches as pen strokes. It has two models: a 6M-parameter model that writes print and cursive and can continue the handwriting of a writer it has never seen, and a 54M-parameter model that draws from a text prompt. The work is shared on a personal blog with a paper, code and downloadable weights.
How it works
Pen points snap to a grid, so a word becomes a walk in eight directions plus pen-down and pen-up moves. Byte-pair encoding merges common runs of moves into tokens, which shortens sequences by about 3.2x. A plain decoder transformer then cross-attends to the text for handwriting or to a SigLIP 2 vector for drawings.
Why it matters
The author says most of the gain came from data (80%), with speed (15%) and architecture (5%) making up the rest. For builders working on handwriting or sketch generation, the post shows how to represent pen input as grid-snapped moves tokenized with byte-pair encoding, and it lists which design choices changed results and which did not.
For builders: If your product involves handwriting or sketch generation, PenGPT is a generative transformer approach you can study for stroke-based output.
Who + how to try
For: Developers and researchers building products that involve handwriting or sketch generation as stroke-based output.
Try:
FAQ
What does the handwriting model do with a new writer?
It reads one to three real words from a writer held out of training and carries on in that writer's hand. The post reports this on 21 held-out writers.
Are the training datasets released?
The author says the datasets are not being released, but the paper's appendix explains how to build them.
Did the author find that bigger or more complex designs helped?
Not in the handwriting results shown. Doubling the model changed nothing, a vocabulary sixty times larger changed nothing, and telling the model where its pen is did nothing for handwriting.
Is a transformer required?
Not strictly. An LSTM on the same tokens is a bit behind on handwriting and still picks up new hands, but on drawings, where sequences are several times longer, it falls well behind.
Also new this week in Research
All 16 Research stories →PartAgent: training-free agentic 3D part segmentation
PartAgent combines 3D expert region proposals with 2D semantic evidence in a training-free agent that refines part segmentations in a closed loop, reaching 68.41 mIoU on PartObjaverse-Tiny-WT.
Loom attention lets Transformers rewire circuits per token
Researchers propose loom attention, letting a Transformer rewire its circuits at every token using a second matrix-memory stream. The resulting LoomFormer reportedly matches models trained with over 3x the compute at 2% extra FLOPs in their tests.
S-Mind adds multi-view 3D geometry to multimodal LLMs
S-Mind internalizes multi-view geometry in an MLLM through a compact set of spatial tokens that hold a fused 3D scene. It reports gains of up to 22.26 points on Qwen3.5 backbones across four spatial benchmarks.
Antom 3-in-1 Transformer: a 7B payment risk foundation model
Ant International describes a roughly 7B-parameter payment foundation model combining sequence, tabular and graph representations for payment risk detection. Its paper reports a 37.88% drop in loss rate versus an online baseline in a four-month live test.
Spotted a mistake? Email hello@capylaunch.com and we will correct it. How we make CapyLaunch TLDR News.



