Open Interpretability Models Contributors Research Posts About

ALTA: Compiler-Based Analysis of Transformers

Source

Citation. Peter Shaw, James Cohan, Jacob Eisenstein, Kenton Lee, Jonathan Berant and Kristina Toutanova. Cohan is at Google, and the others are at Google DeepMind. "ALTA: Compiler-Based Analysis of Transformers". arXiv 2410.18077 [cs.LG]. Versions: v1 23 October 2024, v2 19 June 2025. We read v2. Paper. Code, under Apache 2.0. The v2 PDF says "Published in Transactions on Machine Learning Research (2/2025)", with an OpenReview forum. The arXiv comment says "TMLR 2025". So the issue's "TMLR 2025 (arXiv 2024)" agrees with the source. The paper releases no dataset, because its models are compiled from programs, and its SCAN data are public. It has no funding statement. The acknowledgements thank David Lindner, an author of Tracr, among others.

Status. Not applicable. The compiled models run only in the authors' own NumPy forward pass, and the harness can't load them. No open issue names ALTA. Its evidence goes to open issues as comments. #3584 and #3593 are on positive controls, and #5144 is on context rules. #3446 is on reading weights, and #4782 on units that training does not reach.

Read. We read the arXiv v2 PDF on 2026-11-19, as text that pdftotext took from it. We also read the arXiv abstract page for the version history and the venue comment. We have the source's own text for the abstract, §1 to §5, the references and Appendices A to D. We read Appendix B's definitions, theorem statements and the proof of Theorem 1, but only skimmed the proof of Theorem 2. We did not see the figures as images. The plots of Figures 4, 5, 9, 10, 11 and 18 came through only as axis labels and legends. So the only numbers from them here are numbers that the text or a table states. The code listings came through as text. We read the code repository's README, setup.py and framework/transformer/transformer_utils.py, and its file list. We did not run the code. A model (Claude Opus 5.5) did the reading.

Summary

Claim. ALTA is a programming language with an interpreter and a compiler that writes a program into transformer weights. Unlike Tracr, it supports loops, through layers that share weights, and it compiles to Universal Transformers. The authors use it to show constructions for parity, addition and SCAN, and to study why training fails to learn such algorithms.

Method.

Findings, as the source reports them.

Setting Result
Theorems 1 and 2 (Appendix B.6) The loss is an L1 reconstruction loss plus an L1 weight penalty. If a rule set is not minimal for the data, the compiled MLP is not a strict coordinate-wise local optimum of it. If the rule set is minimal, it is one, for penalty α < 1
Proof of Theorem 1 (Appendix B.7) A rule that the data never satisfies has output weights that "do not affect the reconstruction loss". Only the penalty moves them
Parity, compiled originals (§4.1) "100% accuracy", the same as the symbolic program
Parity, trace supervision (Table 2), lengths ≤ 20 / > 20 / ones > 20 Sequential (Relative) 100% / 100% / 100%. Sequential (Absolute) 100% / 52% / 51%. Sum + Modulo 100% / 78% / 50%
Parity, minimal programs (§4.1) Only the minimal Sequential (Relative) program works at all lengths. The authors say the trace-supervision results "exhibit the same generalization behavior as the minimal programs"
Parity, end to end (Table 3) 100% on lengths ≤ 20 in all eight settings. 49% to 65% on lengths > 20, and 48% to 52% on more than 20 ones
Parity, rule counts (§4.1) The minimal Sequential (Relative) program has 7 rules, and the minimal Sum + Modulo program has 31. End-to-end models act like Sum + Modulo, so there is no simplicity bias by rule count
Addition (§4.2, Appendix D.2) 884 rules and 6 heads. N + 2 layers for N digits. The compiled model scored 100% on sampled pairs of 1 to 50 digits. The minimal program for inputs of ≤ 3 digits works for any length
SUBLEQ (Appendix D.3) 5 heads, one instruction every 3 layers, and O(N³) rules for N memory values. Checked "using unit tests involving simple SUBLEQ programs"
SCAN (§4.4, Appendix D.4) The program and the compiled model score 100% on all of SCAN. Fewer than 2,000 MLP units and 13 heads, against more than 10⁶⁰ variable combinations. Up to 512 layers
SCAN, minimal program (§4.4) 100% on the length split and the MCD splits
SCAN, end to end (Table 6) 1% to 13% on every split and depth. More layers do not raise accuracy

The authors state the limits themselves (§2.1, §5, Appendix D):

Where the claims go beyond the evidence

Use in this repo