用新编程语言ALTA直接编译出可运行的Transformer模型,揭示其计算机制。
ALTA: Compiler-Based Analysis of Transformers
- 设计新语言ALTA,支持循环和通用Transformer编译,可直接生成权重
- 成功实现奇偶性、加法等长度不变算法的构造性表示
- 提供训练失败分析工具,支持细粒度监督与可学习性研究
我们提出一种新编程语言ALTA及配套编译器,可将ALTA程序映射为Transformer权重。ALTA受RASP和Tracr启发,扩展了对循环的支持,并能编译至通用Transformer。该框架可构造性地展示Transformer如何表示长度不变的奇偶性计算、加法算法,以及解决SCAN基准的组合泛化任务,无需中间临时解码步骤。此外,我们提出分析工具,用于研究算法可表达但训练无法收敛的情况,探索从ALTA执行轨迹进行更细粒度监督的可行性。该方法支持进一步实验与理论分析,揭示算法可学习性与数据量、位置编码等建模选择的关系。ALTA框架(语言规范、符号解释器、权重编译器)已开源,供社区使用。
原文摘要 · Abstract (English)
We propose a new programming language called ALTA and a compiler that can map ALTA programs to Transformer weights. ALTA is inspired by RASP, a language proposed by Weiss et al. (2021), and Tracr (Lindner et al., 2023), a compiler from RASP programs to Transformer weights. ALTA complements and extends this prior work, offering the ability to express loops and to compile programs to Universal Transformers, among other advantages. ALTA allows us to constructively show how Transformers can represent length-invariant algorithms for computing parity and addition, as well as a solution to the SCAN benchmark of compositional generalization tasks, without requiring intermediate scratchpad decoding steps. We also propose tools to analyze cases where the expressibility of an algorithm is established, but end-to-end training on a given training set fails to induce behavior consistent with the desired algorithm. To this end, we explore training from ALTA execution traces as a more fine-grained supervision signal. This enables additional experiments and theoretical analyses relating the learnability of various algorithms to data availability and modeling decisions, such as positional encodings. We make the ALTA framework -- language specification, symbolic interpreter, and weight compiler -- available to the community to enable further applications and insights.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。