Sketchpad: certified exact arithmetic with a small vision-language model
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.
Create a lesson
Metadata
- Categories
- cs.LG, cs.CL, cs.LO
- Comments
- 25 pages, 7 figures (6 + 1 Extended Data), 6 Extended Data tables. Demo: https://neovand.github.io/sketchpad/demo ; code (Apache 2.0): https://github.com/NeoVand/sketchpad ; model: https://huggingface.co/mohsenvand/sketchpad-0.8b-preview
Related papers
Compositional Unalignment: Auditing Safety in Large Vision-Language Models
Shared title terminologycs.LGHong kyu Lee, Kai Shu, Li Xiong
Where It Breaks: Diagnosing Perception, Memory, and Decision Failures of a Vision-Language Agent in Pac-Man
Shared title terminologycs.LGXinglu Wang, Edward Wang, Yong Zhang et al.
Scalpel and Brush: Pruning and Targeted Weight Editing of a Small Language Model by a Single LLM Agent
Shared title terminologycs.LGSergei Koltcov, Vera Ignatenko, Anton Surkov et al.
A Bias in Disguise: Tiny Gradient Edits Stop a Small Language Model's Thinking Loops and Complement a Frontier Model's Weight Edit
Shared title terminologycs.LGHussamuddin Syed
Template Gap Reconstruction for Shell Output Simulation with Small Language Models
Shared title terminologycs.LGJarrod Ragsdale, Rajendra Boppana
Scaling Looped MoE Language Models under Matched Budgets: Information Flow and Parameter Allocation
Shared title terminologycs.LGShipeng Bai, Jiayu Qin, Hong Liu et al.