迈向可验证的Transformer:求解器可检查的电路解释
Towards Verifiable Transformers: Solver-Checkable Circuit Explanations
AI总结:
提出Verifiable Transformers框架,通过将任务局部Transformer电路转化为有界、求解器可检查的声明,实现电路属性的形式化验证。
摘要:
机制可解释性通常识别Transformer模型内部的电路,但这些电路的解释通常通过示例、消融和手动推理来验证。这留下了在发现合理电路与证明电路功能之间的差距。我们引入了Verifiable Transformers,一个将任务局部Transformer电路转化为有界、求解器可检查的声明的框架。给定一个行为、一个有限任务域和一个候选token投影,我们提取任务电路并验证属性,如投影功能等价性、边必要性、任务相关不变性和最终残差鲁棒性。直接验证将提取的电路本身编码到SMT求解器中。当电路包含无法精确或可处理编码的算子时,代理介导的验证拟合一个SMT可编码的代理,在有限域上针对提取的电路验证它,并针对代理验证符号解释。我们使用带有Signed L1 BandNorm、sparsemax注意力和LeakyReLU的GPT风格架构实例化直接验证。在小型符号序列任务上,我们训练一个SMT可表示的Transformer,提取用于引号闭合和括号类型跟踪的稀疏电路,并详尽验证投影功能等价性、内容不变性、边必要性和最终残差鲁棒性。在GPT-2规模上,相同的算子堆栈在OpenWebText上稳定训练,尽管朴素直接SMT验证仍然难以处理。我们还展示了在具有难以编码注意力的任务局部电路上的代理介导验证,显示了已验证的符号解释和求解器生成的反例。目标不是全模型验证,而是为将机制电路解释转化为可证明或反驳的形式命题提供一条具体路径。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。