Sketchpad
Exact arithmetic, three cells at a time.
A fine-tuned Qwen3.5-0.8B reads a sheet and computes every digit. Checking its 2,446 possible views certifies its steps at every input length, relative to the runtime.
Try the sheet
Qwen3.5-0.8B adds, subtracts, multiplies, divides, takes square roots and finds gcds exactly, on a sheet it reads with its own eyes. Every digit is the model’s; the page only paints and moves.
A view is three cells of the sheet, read as one image; a step is one forward pass of the model, which answers one view or several at once.
to run it on your GPU (1.9 GB).
The view the model reads appears here.
Each view the model reads is one arrow; the carry on the sheet is the state.
Load the model to look inside.
Load the model to look inside.
242 views, every one this table can show the model.
How it works
At each step the runtime crops three cells of the sheet, a 32 × 96 pixel view, and the model answers in tokens: for addition the column’s sum code; for every other step two glyphs and the name of its next step, all three from one forward pass (the prompt ends in two placeholder slots). The runtime stamps the glyphs and moves the window; nothing else carries over between steps. The passes of a multiplication overlap, two columns apart, and their views go through the model as one batch.
The model can only ever meet 2,446 views: 242 in addition, 1,553 in multiplication and 651 in the calculator’s three tables (subtract, guess a quotient digit, lower the guess). Every one was checked on a reference device; your device checks the weakest tenth again before a run (or all of them, on request), so a run of any length is a chain of checked steps. A view’s margin is how far the right answer’s logit leads the next best.
Calculate lays long subtraction, long division (Knuth’s Algorithm D), square roots digit by digit and gcd (Euclid’s algorithm, one division after another) over those five tables. Signs and decimal points are layout. Algebra goes one level up: a fixed runtime writes the steps a textbook would (expand, collect, move a term across, divide, the quadratic formula, synthetic division, elimination), and every number in them is worked on the sheet by the model. Each answer is checked by putting it back: into the collected equation (light) or into both typed sides (strong). Every arithmetic step is the model’s and certified; the work order, the steps and the layout are not.
Inside, the program’s graph also returns the state at every layer. The lens reads each layer through the model’s own output head; the state space is a 3D slice of the 1,024-dimensional state chosen to separate the answers. Pushing adds the difference of two answers’ mean states to the stream entering layer 20, right after the full-attention layer that writes the decision.
The weights, the certificate and the inside data are on Hugging Face, pinned by revision.