arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.05770cs.LGcs.CL
收藏

权重到代码:从离散Transformer中提取可解释算法

Weights to Code: Extracting Interpretable Algorithms from the Discrete Transformer

Key Laboratory of High Confidence Software Technology (PKU), MOE, Beijing, China(高可信软件技术重点实验室(PKU),教育部,北京,中国);School of Computer Science, Peking University, Beijing, China(计算机学院,北京大学,北京,中国);Shanghai AI Lab, Shanghai, China(上海人工智能实验室,上海,中国);Shanghai Innovation Institute, Shanghai, China(上海创新研究院,上海,中国)

Yifan Zhang, Wei Bi, Kechi Zhang, Dongming Jin, Jie Fu, Zhi Jin

AI总结:

提出离散Transformer架构,通过温度退火采样注入离散性,结合假设检验和符号回归从模型权重中提取可解释算法,在离散任务上性能与RNN基线相当,并扩展到连续中间计算任务。

摘要:

算法提取旨在直接从算法任务训练的模型中合成可执行程序,从而无需依赖人工编写的目标程序即可从权重中重新发现可执行机制。然而,将此范式应用于Transformer时,由于表示纠缠(例如叠加),其中重叠方向编码的特征严重阻碍了符号表达式的恢复。我们提出了离散Transformer,这是一种专门设计用于弥合连续表示与离散符号逻辑之间差距的架构。通过温度退火采样注入离散性,我们的框架有效利用假设检验和符号回归来提取人类可读的程序。实验表明,离散Transformer在共享离散任务上实现了与基于RNN的MIPS基线相当的性能,同时将提取扩展到具有连续值中间计算的任务。最后,我们展示了架构归纳偏置对合成程序提供了细粒度控制,使离散Transformer成为算法提取和Transformer可解释性的可控测试平台。

英文摘要:

Algorithm extraction aims to synthesize executable programs directly from models trained on algorithmic tasks, enabling de novo recovery of executable mechanisms from weights without relying on human-written target programs. However, applying this paradigm to Transformer is complicated by representation entanglement (e.g., superposition), where features encoded in overlapping directions substantially hinder the recovery of symbolic expressions. We propose the Discrete Transformer, an architecture explicitly designed to bridge the gap between continuous representations and discrete symbolic logic. By injecting discreteness through temperature-annealed sampling, our framework effectively leverages hypothesis testing and symbolic regression to extract human-readable programs. Empirically, the Discrete Transformer achieves performance comparable to the RNN-based MIPS baseline on shared discrete tasks, while broadening extraction to tasks with continuous-valued intermediate computations. Finally, we show that architectural inductive biases provide fine-grained control over synthesized programs, establishing the Discrete Transformer as a controllable testbed for algorithm extraction and Transformer interpretability.

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

↑