Sketchpad: certified exact arithmetic with a small vision-language model
Organizations: MIT Media Lab
Abstract
Language models are accurate on most long-arithmetic problems, but their accuracy is estimated on samples and carries no guarantee for an unseen input; tool use is exact but moves the computation outside the network. We show that exactness at all input lengths becomes a finite, checkable property of a network when each of its steps reads only a bounded view of an external working memory. In Sketchpad, Qwen3.5-0.8B with a low-rank adapter executes arithmetic procedures on a rendered sheet. Each forward pass reads a three-cell view and emits one step: a digit, a carry or borrow, and the next operation. A fixed runtime moves the view and writes no digit of a result. We prove in Lean that the model is then exact on all inputs of any length if and only if it is exact on the finite set of views the runtime presents, that no finite test suffices when steps also read earlier steps, and that the guarantee tolerates bounded numerical perturbation and extends to compositions of procedures. All 2,446 views pass on the deployment device, a laptop GPU running the model in a web browser. The certified model performs signed addition and subtraction, long multiplication and division, square roots and greatest common divisors at arbitrary length. It solved 200 of 200 pre-registered problems in the browser, and 220 of 220 sums of up to 1,000 digits and products of up to 20 digits, of which GPT-6.1 Sol, the strongest of ten other models, solved 217. A symbolic runtime built on these procedures solves, expands and factors polynomials with every number computed by the model, and a multiplicative gate on the adapter recovers the base model exactly when the sheet is not in use.
Figures & tables
| Operation | View (top to bottom) | Outputs at = , ? , ? | Rows | Server | M4 |
|---|---|---|---|---|---|
| SUM | carry (blank, 1), top digit (blank, 0–9), bottom digit (blank, 0–9) | sum and carry as one token (0–19), or H | 242 | 3.96 | 3.02 |
| MUL | multiplicand digit (blank, 0–9), multiplier digit (0–9), carry (blank, 0–8) | digit, carry, A or Z | 1,100 | 6.39 | 6.52 |
| ADD | carry (blank, 1), product digit (0–9), running-total digit (blank, 0–9) | digit, carry, M | 220 | 9.37 | 9.50 |
| ADZ | as ADD , at the end of a pass | digit, carry, F | 220 | 8.41 | 8.00 |
| FLS | carry (blank, 1), blank, blank | final carry, –, N | 2 | 12.93 | 13.11 |
| NXT | next multiplier digit (blank, 0–9), blank, blank | –, –, M or H | 11 | 10.48 | 10.22 |
| Set | Exact | Median s | Max s | Over 12 s | Median passes / views | Cost model median s |
|---|---|---|---|---|---|---|
| to 10 places ( , ) | 50 | 7.0 | 13.3 | 1 | 65 / 90 | 7.6 |
| to 6 places ( ) | 50 | 9.8 | 16.5 | 11 | 86 / 137 | 10.7 |
| ( ) | 50 | 7.0 | 13.4 | 4 | 61 / 84 | 7.1 |
| signed , up to 20 digits | 50 | 2.0 | 4.7 | 0 | 19 / 19 | 1.9 |
| Problem | Textbook views / passes / s | Evaluation views / passes / s |
|---|---|---|
| solve 3(x-2)+5=2x+14 | 36 / 22 / 2.8 | 75 / 27 / 4.5 |
| solve 7x+13=2026-4x | 97 / 62 / 7.6 | 165 / 88 / 11.8 |
| solve 2x+3y=7, x-y=1 | 75 / 48 / 5.9 | 194 / 41 / 9.8 |
| solve (2x-3)(x+5)=x^2+1-16 | 79 / 43 / 5.7 | 177 / 50 / 9.8 |
| solve x^2-x-6=0 | 102 / 77 / 8.8 | 162 / 79 / 11.1 |
| 123456 * 654321 | 96 / 46 / 6.5 | 96 / 46 / 6.5 |
| Recipe | Precision / recall | Word | Equations | Prose | IFEval | GSM8K | MMLU |
|---|---|---|---|---|---|---|---|
| criterion | 0.95 / 0.95 | 0.90 | 0.95 | 0.95 | 2 | 2 | 2 |
| base model, four examples | 0.971 / 0.809 | 0.789 | 0.583 | 0.667 | 0 | 0 | 0 |
| synthetic dialogues, self-distillation (from a preliminary multiplication adapter) | 0.957 / 0.996 | 0.872 | 0.967 | 0.983 | 4.8 | – | 6.6 |
| synthetic dialogues, self-distillation | 1.000 / 0.998 | 0.894 | 0.975 | 1.000 | 0.55 | 31.2 | 5.4 |
| + human multi-step solutions | 1.000 / 0.994 | 0.856 | 0.975 | 0.992 | 2.8 | 14.0 | 2.4 |
| + base-model multi-step solutions | 1.000 / 0.994 | 0.817 | 0.958 | 0.992 | 4.4 | 6.4 | 3.4 |
| System | +10 | +30 | +100 | +300 | +1,000 | 2 | 4 | 6 | 10 | 15 | 20 | All |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sketchpad | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 20 | 220 |
| GPT-6.1 Sol | 20 (0) | 20 (0) | 20 (0) | 18 (0) | 19 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 217 |
| Claude Opus 5.5 | 20 (0) | 20 (0) | 20 (0) | 19 (0) | 17 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 216 |
| Gemini 4 Argon | 20 (0) | 20 (0) | 20 (0) | 18 (1) | 9 (8) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 207 |
| DeepSeek-V4-Pro | 20 (0) | 20 (0) | 19 (0) | 18 (0) | 2 (17) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 199 |
| Mistral-Large-4 | 20 (0) | 20 (0) | 14 (5) | 7 (10) | 0 (20) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 20 (0) | 7 (13) | 168 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Statement | Lean declarations | File |
|---|---|---|
| Theorem 1 | Sketchpad.sheet_exact_iff , Sketchpad.sheet_certified ; token form regeneration_trace_iff , pinned_regeneration_iff | Sheet.lean , Pinned.lean |
| Theorem 2 | no_finite_test_suite , theorem8a_counterexample , no_finite_check | Unpinned.lean |
| Theorem 3 | Sketchpad.sheet_exact_of_close ; token form regeneration_of_close ; unpinned decoding unpinned_exact_of_close | Sheet.lean , Pinned.lean , Unpinned.lean |
| Theorem 4 | (a) error_decomposition ; (b) Sketchpad.sheet_compose_exact , Sketchpad.sheet_error_bound ; token form compose_exact , error_bound | Compose.lean , Sheet.lean |
| Lemma 1 | sel_eq_of_close , sel_eq_of_strict | Pinned.lean |
| Lemma 2 | Sketchpad.Interp.regeneration , scanl_eq_iff_foldl_eq , regeneration_trace_iff | Interp.lean , Pinned.lean |
Numerical Reasoning in Language Models
Numerical reasoning in language models studies how systems represent, calculate with, and explain numbers across mathematical and real-world tasks.
See all 159 papers