Malotru
Back to notes

Checked Once, Exact at Every Length

November 6, 2026

Sketchpad turns exact arithmetic into a finite check: Qwen3.5-0.8B with a LoRA reads only a three-cell view, and a Lean argument shows why chain of thought cannot earn that certificate. All 2,446 views pass on a laptop GPU; 220 correct answers are a demonstration, not the proof.

Checked Once, Exact at Every Length

A language model that adds a thousand digits correctly on a sampled set is still a model whose next error can look like a finished answer. Sketchpad, by Mostafa Mohsenvand at the MIT Media Lab, changes the object of the check. If each step reads only a bounded view of an external sheet, and nothing else passes between steps, exactness at every input length is equivalent to exactness on a finite list. The network is Qwen3.5-0.8B with a rank-16 LoRA, 10.2 million parameters, about 1.2 percent of the model. The list has 2,446 views. The check that counts is the one run on the machine that will execute those views [Source 1][Source 2].

The pinned sheet makes the input set finite

The sheet is a grid of 32-pixel cells, blank or a digit from a fixed glyph set. A view is three cells, a strip of 32 by 96 pixels, which the vision encoder reads as three image tokens. The prompt is an operation token, that image, an equals sign, and two placeholders. One forward pass emits a digit, a carry or a borrow, and the next operation. A fixed runtime moves the window and writes the outputs. It writes no digit of a result. Under this pinned-sheet policy the model's output is a function of the view alone [Source 1][Source 3].

The views are listed before any long input is chosen. Column addition has 242. Long multiplication's five operations have 1,553. Subtraction, quotient-digit estimation, and decrementing a high estimate add 651. The total is 2,446 [Source 1]. The base model does not already know the tables. With no adapter it passes 12 of the 2,446 views, all of them addition steps that copy one digit. Eight solved examples in the prompt raise that to 158 of the remaining 2,380, and only when later outputs are read after the correct earlier ones. No table passes in full [Source 1][Source 3].

Division shows why the runtime has to keep the list closed. A quotient digit is guessed from leading digits. Following Knuth, both operands are scaled on the sheet until the divisor's leading digit is at least 5. The estimation table then has 400 rows, and the guess is the true digit or at most two high. A borrow out of the multiply-and-subtract pass lowers it, at most twice. Square roots reuse that table after a similar scale. At each step the runtime asserts that the view it will show is a table row [Source 1].

Theorem 2 is why a longer transcript is not a test

Theorem 1 is the half that makes a certificate possible. The runtime paints the next configuration from the current one and the model's outputs. When that paint step is injective whenever a view is showing, the model's run matches a reference run, from every start in a chosen set, if and only if the model agrees with the table on every view the reference presents. If those views all sit inside the 2,446 and every margin is positive, every run of every length is exact. The network's part is finite. The runtime's part — reference runs present only table rows, and the classical procedures compute the intended functions — is ordinary code, and the paper does not formalize it in Lean [Source 1][Source 2].

Theorem 2 says the restriction is required. If a step's context keeps the earlier steps, as chain of thought does, there is a two-state table and a family of decoders, each a correct lookup plus one attention head, such that for every finite set of test contexts some member passes every row, and every test context that begins with the prompt and ends on a row, with positive margins, yet fails on a longer run. Under the pinned-sheet policy that same member is exact at every length. After a sink token, on a context of n tokens of which k are events, the head adds 4Rk / (e^c + n) to the logit of the wrong state, where R is the lookup's margin and c is the head's score on the sink. Set that score from the longest test, and the write exceeds R only past the tests. This is Moore's observation that no finite experiment identifies a machine with unboundedly many states [Source 1].

Those Lean proofs certify the meta-statement, not each sum. A transcript that keeps earlier steps lies, by Theorem 2, outside the networks a finite test can certify. The pinned sheet is the case Theorem 1 covers: a step reads a bounded view, and nothing else [Source 1][Source 2].

Margins belong to the path that will run

A view passes when the correct token leads every alternative at each output position. The margin is the smallest lead, over 248,320 tokens. In 32-bit PyTorch the smallest margin is 3.96. On the deployment path — ONNX Runtime Web, WebGPU, 16-bit, an Apple M4, in the browser — all 2,446 views pass, with smallest margins of 3.02 for addition, 6.52 for multiplication, and 4.61 for the calculator tables. Theorem 3 says a margin above 2τ survives any logit change of size at most τ, so 3.02 tolerates a change below 1.51. Inference batches up to 32 views, and batching moves 16-bit logits. In random batches of 2, 4, and 32, no logit moved by more than 1.09 and no margin by more than 0.64, so those paths meet the theorem at τ = 1.09. A 4-bit decoder on a preliminary adapter had already moved some margins from +9.4 to −8.9, so the path is part of the claim. On a new GPU the guarantee is the full check. Recomputing the lowest-margin tenth, which the client does by default, is only a monitor [Source 1][Source 3].

Correct answers on a sample are still a sample

Sketchpad answered all 220 problems in a pre-registered comparison: sums of 10 to 1,000 digits and products of 2- to 20-digit numbers, twenty per length, one prompt, 32,768 output tokens. GPT-6.1 Sol, best of the other ten models, answered 217. Claude Opus 5.5 answered 216 and Gemini 4 Argon 207, exact on every product, with every error a finished sum of 300 or 1,000 digits inside the budget. The base Qwen3.5-0.8B answered 23 without chain of thought and 3 with it [Source 1]. A separate browser run of 200 problems, including division, roots, and greatest common divisors, was exact on every one [Source 1][Source 2].

Those 220 runs show that the procedures execute. They are not the certificate. Sol's three errors are a sample failing in the same shape as a success. Sketchpad's claim is that each digit was a view already scored on the device. Theorem 4 lets the procedures compose: if every call returns its table's output, a wrong algebraic answer needs a wrong table, which the certificate excludes, or a wrong transcription, or a wrong combining program. Those last two are ordinary code. Fault injection rejected 200 of 200 planted wrong roots and 185 of 200 single corrupted results; in the other 15 the corruption did not change the answer. The checks do not show that every root was found [Source 1].

A scalar gate on every LoRA branch returns the base model bit for bit at zero, and at one the sheet still passes all 2,446 views. On 1,069 grade-school problems held out from development, the dialogue adapter scores 5.8 points below the base model, whether or not it calls the sheet. The paper locates that loss in multi-step reasoning. The certificate does not cover it [Source 1][Source 3].

Writing the work into the context can extend the lengths at which addition usually works. Theorem 2 says that usual success is not a finite certificate: a step that reads earlier steps can pass every written test and fail on the next length. The pinned sheet buys the guarantee by handing the sequence of steps to a runtime, so the result no longer depends on which inputs were sampled [Source 1][Source 2].

Sources