Sketchpad:使用小型视觉语言模型实现经过认证的精确算术

·

研究论文 · 2026/11/09

语言模型在长算术问题上的准确性基于采样估计,对未见输入无保证;工具使用虽精确但将计算移出网络。Sketchpad 展示:当每一步仅读取外部工作内存的有界视图时,所有输入长度上的精确性成为网络有限、可检查的性质。Qwen3.5-0.8B 加低秩适配器在渲染表上执行算术过程,每次前向传播读取三格视图并输出一步:数字、进位/借位及下一操作。固定运行时移动视图且不写入结果数字。在 Lean 中证明:模型对所有任意长度输入精确当且仅当对运行时呈现的有限视图集精确;若步骤还读取先前步骤则无有限测试足够;保证容忍有界数值扰动并可扩展到过程组合。全部 2,446 个视图在部署设备(笔记本电脑 GPU 浏览器运行模型)上通过。认证模型执行任意长度的有符号加减、长乘除、平方根和最大公约数。在浏览器中解决 200/200 预注册问题,以及 220/220 个高达 1000 位数字的和与高达 20 位数字的积,而其他十个模型中最强的 GPT-6.1 Sol 解决 217 个。基于这些过程的符号运行时求解、展开和因式分解多项式,所有数字由模型计算;适配器上的乘法门在表未使用时精确恢复基础模型。

该工作首次将神经网络算术的精确性转化为有限可检查性质,并通过形式化证明和实际部署验证,为可信 AI 计算提供了新范式。

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.

阅读原文

参与讨论