让Transformer电路可验证:用数学方法证明模型行为的精确性。
Towards Verifiable Transformers: Solver-Checkable Circuit Explanations
- 将模型电路转化为可被数学求解器验证的命题,包括功能等价与鲁棒性。
- 在1280个提示上验证了3条边的引号闭合电路,全部属性通过测试。
- 适合关注模型可解释性与形式化验证的研究者使用。
机制可解释性通常发现电路后通过示例和消融分析推断其功能。本文提出可验证Transformer框架,将任务局部电路转化为可被求解器验证的命题:投影功能等价、任务相关不变性、边必要性及对连续最终残差扰动的鲁棒性。在小规模下,直接验证了引号闭合与括号类型电路的四项性质,包括完全符号化的注意力选择程序驱动电路。在GPT-2规模下,训练后移除层归一化,将保留注意力头替换为合成的受限DSL程序,并仅校准程序局部读出,冻结并哈希其余所有参数。最终得到的三边引号电路(嵌入→MLP 0→程序头→logits)在哈希固定、1,280个提示的域中,以线性实数算术验证全部四项属性:1,280/1,280的功能等价与不变性,每条边640个必要性证人,ε=0.01时鲁棒性最小认证半径为0.01515。对于同一开启检测/复制任务的两个字母变体,未修改的门控结构暴露定位边界:括号提取仅在全部144个头启用时精确,而构造的引号伪影仅需三条边即可验证。基于原始发现的验证失败,表明在大规模下必须主动构建可验证对象。所验证对象是校准后的产物,非原模型,所有结论均限定于声明域内。
原文摘要 · Abstract (English)
Mechanistic interpretability typically discovers circuits and then argues what they do from examples and ablations. We introduce Verifiable Transformers, a framework for turning task-localized circuits into bounded, solver-checkable claims: projected functional equivalence, task-relevant invariance, edge necessity, and robustness to continuous final-residual perturbations. At small scale, we directly verify all four properties for quote-closing and bracket-type circuits, including program-mediated circuits whose attention selection is entirely symbolic. At GPT-2 scale, we remove LayerNorm from a sparsemax/LeakyReLU model after training with a +0.0087 OpenWebText loss increase, replace retained attention heads with synthesized restricted-DSL programs, and calibrate only program-local readouts while freezing and hashing every other parameter. The resulting three-edge quote circuit (embedding $\to$ MLP 0 $\to$ program head $\to$ logits) verifies all four properties over a hash-pinned 1,280-prompt domain in linear real arithmetic: 1,280/1,280 equivalence and invariance, 640 edge-necessity witnesses per edge, and robustness at $ε= 0.01$ with minimum certified radius 0.01515. For two alphabet variants of the same opener-detection/copy-type task, untouched gates expose a localization frontier: bracket-type extraction is exact only with all 144 heads, while the constructed quote artifact verifies with three edges. Naive discovery-based verification failed for measured reasons; at scale, we find we must build the object we can verify. The verified object is a calibrated artifact, not the unmodified model, and all claims are bounded to declared domains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。