Discovering Interpretable Algorithms by Decompiling Transformers to RASP
Xinting Huang, Aleksandra Bakalova, Satwik Bhattamishra, William Merrill, Michael Hahn

TL;DR
This paper introduces a method to extract interpretable RASP programs from trained Transformers, providing evidence that these models internally implement simple, understandable algorithms, especially for length-generalization tasks.
Contribution
The paper presents a novel approach to re-parameterize trained Transformers as RASP programs and extract interpretable algorithms, advancing understanding of their internal computations.
Findings
Successfully recovers simple RASP programs from trained Transformers
Demonstrates that Transformers implement interpretable algorithms for length-generalization
Provides evidence of internal algorithmic representations in Transformers
Abstract
Recent work has shown that the computations of Transformers can be simulated in the RASP family of programming languages. These findings have enabled improved understanding of the expressive capacity and generalization abilities of Transformers. In particular, Transformers have been suggested to length-generalize exactly on problems that have simple RASP programs. However, it remains open whether trained models actually implement simple interpretable programs. In this paper, we present a general method to extract such programs from trained Transformers. The idea is to faithfully re-parameterize a Transformer as a RASP program and then apply causal interventions to discover a small sufficient sub-program. In experiments on small Transformers trained on algorithmic and formal language tasks, we show that our method often recovers simple and interpretable RASP programs from…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFormal Methods in Verification · Natural Language Processing Techniques · Constraint Satisfaction and Optimization
