PenGPT uses small transformers to write and sketch from text

A blog post presents PenGPT, a project the author describes as a small, ordinary transformer that can hold a pen in many hands and draw as well as write. There are two models. A 6M-parameter one writes print and cursive, and picks up the handwriting of someone it has never seen from a few of their words. A 54M-parameter one draws from a text prompt. The author calls it his first project that follows Rich Sutton's Bitter Lesson, and says the effort split 80% data, 15% speed and 5% architecture.

It follows an earlier effort. Last year the author and Zach Wimpee trained a tiny GPT, the Cursive Transformer, to write cursive. It knew only one hand, the author's, and learned from 3,500 words he wrote on a trackpad. It took upwards of 10 hours on an A100.

The data is the hard part. Almost nobody records pen strokes, so the handwriting set was built from scans: 495,590 words by 1,255 writers, mostly from two research collections plus old letters and diaries from public archives. A vision-language model finds legible pages and transcribes them, the pages are cut into words, InkSight traces each word back into strokes, and a set of checks throws out bad traces. Between a third and a half of the words survive. The drawing set is 477,670 sketches from ten public datasets. Quick, Draw! alone has 50 million, and the author kept the best 0.5%. He is not releasing the datasets, but says the paper's appendix explains how to build them.

The tokenizer is the same for handwriting and drawings: ten symbols and a merge count. For handwriting the model is told the text. For drawings it is told a SigLIP 2 vector, so a typed phrase can stand in for a picture.

The author compared PenGPT with older approaches, then changed one thing at a time and retrained. Data and how it is shown matter most. Cutting the data makes everything worse. Dropping augmentation makes the drawing model stop following its prompts entirely. Training on one word at a time means the model can no longer pick up a hand: style rank goes from 1.9 to 6.0 (the post does not say which direction is better). The clever parts barely register. Telling the model where its pen is does nothing for handwriting. The BPE merges he was proud of make the score slightly worse; they buy speed, with sequences 3.2x shorter, and nothing else. A vocabulary sixty times larger changes nothing, and doubling the model changes nothing. Even the transformer is somewhat optional: 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.

New hands work through a simple trick. Each training sequence holds up to four words by one writer, which teaches the model that later words look like earlier ones. At sampling time you hand it a few real words and it keeps going. There is no style encoder and no fine-tuning. The 21 hands at the top of the post were written this way. It also works from a photo: the author traces a few words with InkSight and fits one new writer vector to the traces, with the rest of the model frozen.

Looking inside, one head in layer 4 puts 81% of its attention on the letter being written. He looked for heads that specialize in cursive or print and found none; every head reads the same positions in both.

On captions: they are the expensive part of the drawing data. Since SigLIP puts pictures and text in the same space, he tried training on picture vectors alone and typing a prompt at the end. It fails. The picture-only model has the best likelihood of the three variants and draws scribbles. The reason he gives is geometric: SigLIP's vectors for sketches sit in a narrow cone, nearly at right angles to its vectors for text. Labels are enough to draw labels (78%), but only captions get you phrases (43% against 10%).

Limits are stated plainly. The drawing model blends ideas but does not bind them. A teapot with a face is fine; who wears the hat is not. 'Facing left' gives the same drawing as 'facing right', because the single vector it is given is close to a bag of words; those two captions have a cosine similarity of 0.999. Sampled handwriting is less legible than the real thing, 54% against 66%. And because most of the handwriting was traced from scans, its stroke order is a model's guess, not a record.

Training is cheap: 8 minutes for the handwriting model and about 35 for the sketch model on an 8xA100 node. The author closes by saying many of his projects revolve around clever ideas, that the Bitter Lesson is bitter, and that this post is his first step toward accepting it. There was no clever architectural idea behind it, he writes; about 80% of the effort went into building the biggest, cleanest datasets possible with lots of quality control, and 15% into getting a decent 8xA100 node and training fast and in parallel.

Key facts

  • PenGPT is two small transformers: a 6M-parameter model that writes print and cursive, and a 54M-parameter model that draws from a text prompt.
  • The handwriting model picks up a new writer's hand from a few of their words, with no style encoder and no fine-tuning, because each training sequence holds up to four words by one writer.
  • The handwriting data is 495,590 words by 1,255 writers, traced from scans; the drawing data is 477,670 sketches from ten public datasets. The author says the effort was 80% data, 15% speed and 5% architecture.
  • Ablations: BPE merges make the score slightly worse and only shorten sequences 3.2x; a vocabulary sixty times larger and a doubled model change nothing.
  • Limits: sampled handwriting is less legible than real (54% against 66%), and the drawing model cannot tell 'facing left' from 'facing right'.

Why it matters

The post is a worked case of the Bitter Lesson at small scale. The author reports that the elegant parts of his earlier design, such as BPE merges and pen-position information, bought little or nothing, while data quality and quantity decided the outcome. The jump is concrete: the earlier Cursive Transformer learned one hand from 3,500 trackpad words and took upwards of 10 hours on an A100, while PenGPT's handwriting model trains in 8 minutes on an 8xA100 node and handles many hands.

Who it affects

Researchers and hobbyists working on generative models for pen strokes, sketches or other sequence data. The data-building pipeline (scan, transcribe, trace into strokes, filter) and the finding that picture-only SigLIP training fails for text prompts are the parts most relevant to people building similar systems.

How to use it

The post is a description of a method, not a product. The practical recipe it gives for handwriting is to train on sequences of up to four words by one writer, then at sampling time hand the model a few real words to copy the style. For a photo, trace a few words with InkSight and fit one new writer vector with the rest of the model frozen. The datasets are not being released; the author says the paper's appendix explains how to build them. No release of model weights or code is mentioned.

How solid is it

This is the author's own account on a personal blog, and the full ablation tables and sample images are not in the text, so the headline numbers cannot be checked here. The author reports comparing against older approaches and changing one thing at a time. Some figures come without a named metric (the 78%, 43% and 10% results, and the style rank), and the full results are in the paper, which the post refers to.

Risks and caveats

Sampled handwriting is less legible than real handwriting, 54% against 66%. Because most training handwriting was traced from scans, stroke order is a model's guess, not a record. The drawing model blends concepts but does not bind them, so who wears a hat or which way something faces is unreliable. Picture-only training gives scribbles when prompted with text. The datasets will not be released.

“And yet there was no clever architectural idea behind it.”

— The post's author, on PenGPT