arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2511.17645cs.LGcs.AIcs.CL
收藏

BlockCert: Transformer机制的认证分块提取

BlockCert: Certified Blockwise Extraction of Transformer Mechanisms

Sandro Andric

AI总结:

BlockCert通过认证分块提取Transformer机制,提供可验证的误差界和覆盖率指标,实验证明其在多个模型上有效且具有实际应用价值。

摘要:

机制可解释性旨在将神经网络逆向工程为显式算法,而模型编辑则试图在不重新训练的情况下修改特定行为。这两个领域通常通过非正式证据和随机实验进行评估,很少有明确的保证说明提取或编辑后的模型在相关输入上与原始模型有多大偏差。我们介绍了BlockCert,一种用于认证Transformer机制分块提取的框架,并概述了如何通过轻量级扩展支持认证的局部编辑。给定一个预训练的Transformer和提示分布,BlockCert提取结构化的替代实现用于残差块,并附带可验证的证书,这些证书可以限制近似误差、记录覆盖率指标,并对底层工件进行哈希。我们正式化了一个简单的基于Lipschitz的组合定理,在Lean 4中提升这些局部保证到全局偏差界。实证上,我们将该框架应用于GPT-2 small、TinyLlama-1.1B-Chat和Llama-3.2-3B。在这些模型中,我们获得了高每块覆盖率和评估提示上的小残差误差,并在TinyLlama设置中显示,完全拼接的模型在压力提示上与基线困惑度相差约6e-5。我们的结果表明,带有明确证书的分块提取在实际Transformer语言模型中是可行的,并为机制可解释性和模型行为的正式推理提供了实用的桥梁。

英文摘要:

Mechanistic interpretability aspires to reverse-engineer neural networks into explicit algorithms, while model editing seeks to modify specific behaviours without retraining. Both areas are typically evaluated with informal evidence and ad-hoc experiments, with few explicit guarantees about how far an extracted or edited model can drift from the original on relevant inputs. We introduce BlockCert, a framework for certified blockwise extraction of transformer mechanisms, and outline how a lightweight extension can support certified local edits. Given a pre-trained transformer and a prompt distribution, BlockCert extracts structured surrogate implementations for residual blocks together with machine-checkable certificates that bound approximation error, record coverage metrics, and hash the underlying artifacts. We formalize a simple Lipschitz-based composition theorem in Lean 4 that lifts these local guarantees to a global deviation bound. Empirically, we apply the framework to GPT-2 small, TinyLlama-1.1B-Chat, and Llama-3.2-3B. Across these models we obtain high per-block coverage and small residual errors on the evaluated prompts, and in the TinyLlama setting we show that a fully stitched model matches the baseline perplexity within approximately 6e-5 on stress prompts. Our results suggest that blockwise extraction with explicit certificates is feasible for real transformer language models and offers a practical bridge between mechanistic interpretability and formal reasoning about model behaviour.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑