A small transformer model can learn to write and draw in many different hands, and it does so without any special architecture, according to a project called PenGPT. The researcher behind it says the work depends far more on data than on design, a finding he describes as a lesson in humility.

PenGPT has two models. The smaller one, with 6 million parameters, writes both print and cursive. It can pick up the handwriting of someone it has never seen after reading a few of that person's real words. The larger one, with 54 million parameters, produces drawings from a text prompt.

The project grew out of earlier work. Last year, the researcher and Zach Wimpee trained a tiny GPT to write cursive. That model knew only one hand, the researcher's own, and it learned from 3,500 words he wrote on a trackpad. PenGPT asks whether one ordinary transformer can learn many hands and handle drawings as well as writing.

The model works by turning pen movements into a sequence. Pen positions snap to a grid, so a word becomes a path in eight directions plus pen-down and pen-up. A byte-pair encoding step then merges common runs of those moves into tokens. The word “world,” for example, drops from 156 moves to 47 tokens. The same tokenizer handles both handwriting and drawings. For handwriting, the model is given the text it should write. For drawings, it is given a vector from SigLIP 2, a vision-language model, so a typed phrase can stand in for a picture.

What data was used to train PenGPT?

The hardest part was the data. Almost no one records pen strokes, so the researcher built a handwriting dataset from scanned pages. It contains 495,590 words from 1,255 writers, drawn mostly from two research collections, along with old letters and diaries from public archives. A vision-language model located legible pages and transcribed them. The pages were cut into words, and a tool called InkSight traced each word back into strokes. A set of checks then discarded bad traces. Between a third and a half of the words survived.

The drawing dataset has 477,670 sketches from ten public collections. The researcher drew heavily on Quick, Draw!, which has 50 million drawings, and kept only the best 0.5 percent. He is not releasing the datasets himself, but the paper’s appendix explains how to build them.

To test what mattered, he compared PenGPT with older approaches and then changed one part of the model at a time. Cutting the training data hurt the most. A model trained on a tenth of the data scored worse and had much weaker style recognition. Dropping data augmentation made the drawing model stop following its prompts almost entirely. Training on one word at a time also hurt, because the model lost the ability to pick up a particular hand. Style rank, which measures how well the model tells whose hand it is continuing, went from 1.9 to 6.0, where 1 is perfect and 8.5 is chance.

Other clever touches made little difference. Telling the model where its pen was had almost no effect on handwriting. The tokenizer merges made the score slightly worse, though they made sequences 3.2 times shorter and sped up the work. A vocabulary sixty times larger changed nothing, and neither did doubling the model’s size. Even the transformer itself was not essential for handwriting. A simpler LSTM, a type of recurrent network, lagged behind on handwriting but still picked up new hands. On drawings, where sequences run several times longer, it fell well behind.

How does PenGPT learn a new handwriting style?

Picking up a new hand turned out to be simple. Each training sequence holds up to four words by one writer, which teaches the model that later words resemble earlier ones. At sampling time, a user supplies a few real words, and the model continues in the same hand. The researcher said that is how the 21 handwriting samples shown in his post were produced. The model can also learn from a photo. He traced a few words in the photo with InkSight and fit one new writer vector to those traces while the rest of the model stayed frozen. He demonstrated this with a letter by the poet Sara Teasdale and a paragraph printed on a 1989 NIST form.

Why do captions matter for PenGPT's drawings?

Captions turned out to matter. The researcher tested whether the drawing model could learn from pictures alone, since SigLIP places images and text in the same space. It could not. The picture-only model drew scribbles when given a sentence. Labels were enough to draw single objects, with a 78 percent success rate in the test, but captions were needed for phrases. Captions produced phrases 43 percent of the time, compared with 10 percent for labels.

The models have clear limits. The drawing model can blend ideas, such as a teapot with a face, but it does not reliably attach details to the right object. A prompt saying “facing left” produced the same drawing as “facing right.” Sampled handwriting was also less legible than real handwriting, at 54 percent against 66 percent. Because most of the handwriting came from scans, the stroke order is the model’s best guess rather than a record of how the person actually wrote.

The researcher said the project’s success came from data. About 80 percent of his effort went into building large, clean datasets and checking their quality. Another 15 percent went into training on an 8-GPU A100 node, where the handwriting model finished in 8 minutes and the sketch model in about 35. His earlier Cursive Transformer took more than 10 hours on a single A100 and learned only one hand. He described the principle, which Rich Sutton called the bitter lesson, as hard to accept but worth working with.

Cet article a été rédigé avec l'assistance de l'IA.
News Factory APP - actualités agentiques pour booster votre SEO et AEO.