arXiv:2410.00061cs.LGcs.AI2024-10被引 3

用可解释代码反编译Transformer模型,30%以上能完全还原

Neural Decompiling of Tracr Transformers

  • 基于Tracr生成的权重-代码对,训练解码模型逆向还原RASP程序
  • 测试中30%以上样本完全复现,70%仅少量错误,超70%结果功能正确
  • 适合研究模型可解释性与神经符号系统融合的学者参考

近年来,Transformer架构在模式识别和机器学习多个领域取得显著进展。然而,与其他神经网络模型一样,目前尚无通用方法解释其内部运作机制。本文迈出重要一步:利用Tracr生成大量Transformer权重与对应RASP程序的配对数据集,构建并训练一个模型,目标是从编译后的模型权重中恢复RASP代码。实证评估表明,简单形式的Tracr编译权重对解码模型具有可解释性。测试中,超过30%的样本实现精确复现,剩余70%通常仅有少量错误。此外,超过70%由模型生成的程序与真实代码功能等价,构成有效反编译结果。

原文摘要 · Abstract (English)

Recently, the transformer architecture has enabled substantial progress in many areas of pattern recognition and machine learning. However, as with other neural network models, there is currently no general method available to explain their inner workings. The present paper represents a first step towards this direction. We utilize \textit{Transformer Compiler for RASP} (Tracr) to generate a large dataset of pairs of transformer weights and corresponding RASP programs. Based on this dataset, we then build and train a model, with the aim of recovering the RASP code from the compiled model. We demonstrate that the simple form of Tracr compiled transformer weights is interpretable for such a decompiler model. In an empirical evaluation, our model achieves exact reproductions on more than 30\% of the test objects, while the remaining 70\% can generally be reproduced with only few errors. Additionally, more than 70\% of the programs, produced by our model, are functionally equivalent to the ground truth, and therefore a valid decompilation of the Tracr compiled transformer weights.

可解释性反编译Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。