Demo · runs in your browser
Sketch autocomplete
Draw a shape. The dashed shape is the model's guess at what you will draw next. Press Tab to take it.
Draw
Next shape guesses
Draw something to get a guess.
Tab take it · ← → or 1 2 3 switch · Esc stop drawing
Click to start a shape and the guesses change to finish it for you.
Start from
Results
Tested on 5,000 sketches the model never saw.



The system design
Top row: what happens each time you draw. Bottom row: how the model was made.
The model design
Built the same way as chat AIs, only tiny. A shape is a few numbers: its kind, then where it sits.
How this was made
Free drawings
9.2 million sketchesReal sketches people drew in a design tool, collected by Princeton researchers (SketchGraphs). Each one lists its shapes in the order they were drawn.
No hand labelling: the shape a person drew next is the right answer.
Drawings become numbers
line 12 16 52 16A model only reads numbers. Each shape becomes its kind (line, circle, arc, point) plus its positions on a 64 × 64 grid. A sketch becomes a sentence, and the job becomes guessing the next word.
Cleaning
9.2 → 2.5 millionMost sketches were copies of each other, so only one of each was kept. Over a third of the test sketches also sat in the training pile and were taken out of the test.
Why: a test the model has already seen flatters the score.
The model
4.8 million weightsA small model built the same way as chat AIs like ChatGPT, written from scratch. They guess the next word from the words so far; this one guesses the next shape from the shapes so far.
Training
72 minutes · $1.64On one rented GPU the model guesses, gets corrected, and its weights are nudged, 60,000 times. Weight decay keeps the weights small, and the copy that does best on unseen sketches is the one kept.
Watched throughout: the gap between seen and unseen sketches, the sign of memorising.
Scoring
43% exactly rightTested on 5,000 sketches it never saw, hiding the next shape 31,859 times. The top guess is exactly the shape the person drew 43% of the time, the right shape is in the top three 54% of the time, and it is the right kind of shape 74% of the time.
Showing only confident guesses: when the model is at least 50% sure, 77% of its guesses are exactly right (precision), and it speaks up on 39% of steps.
Into the browser
0.13 seconds a guessThe model was rewritten in plain JavaScript so it runs on this page with no server. It was checked against the GPU version and gives the same guesses.
The settings used
Learning rate 0.001 (eased in over the first 1,000 steps, then slowly lowered) · 1,024 sketches per step · weight decay 0.05 · no dropout · 60,000 steps, about 24 passes over the data · 6 layers, 256 wide, 4 heads.
Note: these were first picks and nothing has been tuned. Both error lines were still falling when training stopped, so a longer run or a bigger model should score higher.
What did not work at first
Guesses ran to the page edge. The training sketches were all stretched to fill the page, and the first model learned to expect that. On sketches that do not fill the page its top guess was right only 26% of the time. Training was restarted with sketches shrunk and shifted at random: 31% after the same amount of training, 34% when finished.
Too many helpers. The cleaning step ran 96 helper programs on a machine with about 18 processors. They tripped over each other and it looked frozen. With 16 it took two minutes.
A silent wait. That first run printed nothing, so there was no telling stuck from slow. It was restarted with progress messages.
Missing tools. The rented machine lacked the file-copy tool and parts of the data reader; each was installed by hand.
Since then: every long job reports its progress.
Not done yet
It guesses shapes only, not the rules between them (parallel, equal, mirrored), which the data also holds. It handles up to 16 shapes on a 64 × 64 grid. It does not yet learn from which guesses people take.