How Do Transformers Learn Variable Binding in Symbolic Programs?
Not on the map. Why?
Abstract (arXiv)
Variable binding -- the ability to associate variables with values -- is fundamental to symbolic computation and cognition. Although classical architectures typically implement variable binding via addressable memory, it is not well understood how modern neural networks lacking built-in binding operations may acquire this capacity. We investigate this by training a Transformer to dereference queried variables in symbolic programs where variables are assigned either numerical constants or other variables. Each program requires following chains of variable assignments up to four steps deep to find the queried value, and also contains irrelevant chains of assignments acting as distractors. Our analysis reveals a developmental trajectory with three distinct phases during training: (1) random prediction of numerical constants, (2) a shallow heuristic prioritizing early variable assignments, and (3) the emergence of a systematic mechanism for dereferencing assignment chains. Using causal interventions, we find that the model learns to exploit the residual stream as an addressable memory space, with specialized attention heads routing information across token positions. This mechanism allows the model to dynamically track variable bindings across layers, resulting in accurate dereferencing. Our results show how Transformer models can learn to implement systematic variable binding without explicit architectural support, bridging connectionist and symbolic approaches. To facilitate reproducible research, we developed Variable Scope, an interactive web platform for exploring our findings at https://variablescope.org
Key facts. Cited by 21 papers in the map (data through 14 Oct 2026). Builds on 22 of its 41 references that are in the map. First posted on arXiv 27 May 2025.
Builds on
22 of 41 references.
References · 22
- 2017Attention Is All You Needcited by 60,361
- 2016Layer Normalizationcited by 5,669
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2016Gaussian Error Linear Units (GELUs)cited by 3,502
- 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,898
- 2022Locating and Editing Factual Associations in GPTcited by 2,691
- 2017Decoupled Weight Decay Regularizationcited by 1,831
- 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
- 2021Causal Abstractions of Neural Networkscited by 422
- 2022Towards Understanding Grokking: An Effective Theory of Representation Learningcited by 230
- 2023Causal Abstraction: A Theoretical Foundation for Mechanistic Interpretabilitycited by 205
- 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
10 more
- 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
- 2020Are Neural Nets Modular? Inspecting Functional Modularity Through Differentiable Weight Maskscited by 98
- 2023A Tale of Two Circuits: Grokking as Competition of Sparse and Dense Subnetworkscited by 83
- 2020How do Decisions Emerge across Layers in Neural Models? Interpretation with Differentiable Maskingcited by 63
- 2024Monitoring Latent World States in Language Models with Propositional Probescited by 43
- 2021Sparse Interventions in Language Models with Differentiable Maskingcited by 34
- 2023Discovering Variable Binding Circuitry with Desideratacited by 34
- 2024Representational Analysis of Binding in Language Modelscited by 28
- 2024Mechanistic?cited by 25
- 2020Relational reasoning and generalization using non-symbolic neural networkscited by 15
Built on by
Citing papers per year: 2025: 4; 2026: 17.
21 papers.
Sort:
By area:
- 2025Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Contextcited by 26
- 2026Do Language Models Track Entities Across State Changes?cited by 6
- 2025In-Context Algebracited by 5
- 2025Video Models Start to Solve Chess, Maze, Sudoku, Mental Rotation, and Raven' Matricescited by 4
- 2026Seeing to Generalize: How Visual Data Corrects Binding Shortcutscited by 4
- 2025RELIC: Evaluating Complex Reasoning via the Recognition of Languages In-Contextcited by 3
- 2026ConvexBench: Can LLMs Recognize Convex Functions?cited by 3
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalizationcited by 1
- 2026Radical AI Interpretabilitycited by 1
- 2026Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languagescited by 1
- 2026Do Transformers Use their Depth Adaptively? Evidence from a Relational Reasoning Taskcited by 0
- 2026Source-Modality Monitoring in Vision-Language Modelscited by 0
9 more
- 2026When Symbol Names Should Not Matter: A Logistic Theory of Fresh-Symbol Classificationcited by 0
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmeticcited by 0
- 2026Formalizing the Binding Problemcited by 0
- 2026One mechanism for many mental spaces: a shared router over a value slot in language modelscited by 0
- 2026Belief-reality separation lives in routing over a shared value slot in language modelscited by 0
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependenciescited by 0
- 2026Rate-Coding Bundle Memory: A Unified Model of Memory and Control for Symbolic Computation in the Braincited by 0
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes Itcited by 0
- 2026When Context Changes: Understanding Update Failures in LLMscited by 0
- 2026When Context Changes: Understanding Update Failures in LLMs30 Sep 2026
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes It29 Sep 2026
- 2026Rate-Coding Bundle Memory: A Unified Model of Memory and Control for Symbolic Computation in the Brain29 Aug 2026
- 2026Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languages4 Aug 2026
- 2026Belief-reality separation lives in routing over a shared value slot in language models11 Jul 2026
- 2026One mechanism for many mental spaces: a shared router over a value slot in language models11 Jul 2026
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependencies26 Jun 2026
- 2026Radical AI Interpretability25 Jun 2026
- 2026Formalizing the Binding Problem2 Jun 2026
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalization29 May 2026
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmetic29 May 2026
- 2026Do Language Models Track Entities Across State Changes?28 May 2026
9 more
- 2026When Symbol Names Should Not Matter: A Logistic Theory of Fresh-Symbol Classification8 May 2026
- 2026Source-Modality Monitoring in Vision-Language Models23 Apr 2026
- 2026Do Transformers Use their Depth Adaptively? Evidence from a Relational Reasoning Task14 Apr 2026
- 2026Seeing to Generalize: How Visual Data Corrects Binding Shortcuts16 Feb 2026
- 2026ConvexBench: Can LLMs Recognize Convex Functions?1 Feb 2026
- 2025In-Context Algebra18 Dec 2025
- 2025Video Models Start to Solve Chess, Maze, Sudoku, Mental Rotation, and Raven' Matrices2 Nov 2025
- 2025Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Context7 Oct 2025
- 2025RELIC: Evaluating Complex Reasoning via the Recognition of Languages In-Context5 Jun 2025
- 2026Source-Modality Monitoring in Vision-Language Models23 Apr 2026
- 2026Seeing to Generalize: How Visual Data Corrects Binding Shortcuts16 Feb 2026
- 2026When Context Changes: Understanding Update Failures in LLMs30 Sep 2026
- 2026Radical AI Interpretabilitycited by 1
- 2026Radical AI Interpretability25 Jun 2026
- 2025Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Contextcited by 26
- 2026Do Language Models Track Entities Across State Changes?cited by 6
- 2025In-Context Algebracited by 5
- 2025Video Models Start to Solve Chess, Maze, Sudoku, Mental Rotation, and Raven' Matricescited by 4
- 2026ConvexBench: Can LLMs Recognize Convex Functions?cited by 3
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalizationcited by 1
- 2026Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languagescited by 1
- 2026When Symbol Names Should Not Matter: A Logistic Theory of Fresh-Symbol Classificationcited by 0
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmeticcited by 0
- 2026Formalizing the Binding Problemcited by 0
- 2026One mechanism for many mental spaces: a shared router over a value slot in language modelscited by 0
- 2026Belief-reality separation lives in routing over a shared value slot in language modelscited by 0
12 most cited of 15 All 15 (JSON)
- 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes It29 Sep 2026
- 2026Rate-Coding Bundle Memory: A Unified Model of Memory and Control for Symbolic Computation in the Brain29 Aug 2026
- 2026Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languages4 Aug 2026
- 2026Belief-reality separation lives in routing over a shared value slot in language models11 Jul 2026
- 2026One mechanism for many mental spaces: a shared router over a value slot in language models11 Jul 2026
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependencies26 Jun 2026
- 2026Formalizing the Binding Problem2 Jun 2026
- 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalization29 May 2026
- 2026Assign and Add: A Mechanistic Study of Compositional Arithmetic29 May 2026
- 2026Do Language Models Track Entities Across State Changes?28 May 2026
- 2026When Symbol Names Should Not Matter: A Logistic Theory of Fresh-Symbol Classification8 May 2026
- 2026ConvexBench: Can LLMs Recognize Convex Functions?1 Feb 2026
12 newest of 15 All 15 (JSON)