# PenGPT: A Generative Transformer for Handwriting and Sketches

- HackerByte page: <https://hackerbyte.net/en/stories/an-introduction-to-a-generative-transformer-model-that-understands-handwriting-a-50637056>
- Original source: <https://greydanus.github.io/2026/11/12/pengpt/>
- Hacker News discussion: <https://news.ycombinator.com/item?id=50637056>
- Submitted to Hacker News: 2026-11-25T00:54:49.000Z

An introduction to a generative transformer model that understands handwriting and sketches in the AI domain.

## AI-generated summary

PenGPT is a new generative transformer model capable of writing and sketching based on text prompts. It features two models: a 6M\-parameter version that learns to mimic new handwriting styles from just a few words, and a 54M\-parameter version for generating drawings. The project emphasizes the critical role of extensive, high\-quality data and efficient training over complex architecture.

## Key points

- PenGPT can learn new handwriting styles from just a few example words without fine\-tuning.
- A larger model can generate drawings from text prompts.
- Data collection and preparation accounted for 80% of the effort.
- Training speed and parallelization were crucial, taking 8\-35 minutes on an 8xA100 node.
- The model uses a simple BPE tokenizer for both handwriting and sketches.
