mlsanityData to 14 Oct 2026

How Do Transformers Learn Variable Binding in Symbolic Programs?

arXiv 2505.20896 ↗First posted 27 May 2025cs.LG cs.AI cs.CLcited by 21

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

  1. 2017Attention Is All You Needcited by 60,361
  2. 2016Layer Normalizationcited by 5,669
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2016Gaussian Error Linear Units (GELUs)cited by 3,502
  5. 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,898
  6. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  7. 2017Decoupled Weight Decay Regularizationcited by 1,831
  8. 2023Progress measures for grokking via mechanistic interpretabilitycited by 839
  9. 2021Causal Abstractions of Neural Networkscited by 422
  10. 2022Towards Understanding Grokking: An Effective Theory of Representation Learningcited by 230
  11. 2023Causal Abstraction: A Theoretical Foundation for Mechanistic Interpretabilitycited by 205
  12. 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
10 more
  1. 2022Unveiling Transformers with LEGO: a synthetic reasoning taskcited by 106
  2. 2020Are Neural Nets Modular? Inspecting Functional Modularity Through Differentiable Weight Maskscited by 98
  3. 2023A Tale of Two Circuits: Grokking as Competition of Sparse and Dense Subnetworkscited by 83
  4. 2020How do Decisions Emerge across Layers in Neural Models? Interpretation with Differentiable Maskingcited by 63
  5. 2024Monitoring Latent World States in Language Models with Propositional Probescited by 43
  6. 2021Sparse Interventions in Language Models with Differentiable Maskingcited by 34
  7. 2023Discovering Variable Binding Circuitry with Desideratacited by 34
  8. 2024Representational Analysis of Binding in Language Modelscited by 28
  9. 2024Mechanistic?cited by 25
  10. 2020Relational reasoning and generalization using non-symbolic neural networkscited by 15

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 4; 2026: 17.

21 papers.

Sort:

By area:

  1. 2025Mixing Mechanisms: How Language Models Retrieve Bound Entities In-Contextcited by 26
  2. 2026Do Language Models Track Entities Across State Changes?cited by 6
  3. 2025In-Context Algebracited by 5
  4. 2025Video Models Start to Solve Chess, Maze, Sudoku, Mental Rotation, and Raven' Matricescited by 4
  5. 2026Seeing to Generalize: How Visual Data Corrects Binding Shortcutscited by 4
  6. 2025RELIC: Evaluating Complex Reasoning via the Recognition of Languages In-Contextcited by 3
  7. 2026ConvexBench: Can LLMs Recognize Convex Functions?cited by 3
  8. 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalizationcited by 1
  9. 2026Radical AI Interpretabilitycited by 1
  10. 2026Test, then Route: How Language Models Execute In-Context Conditional Rules Across Models and Languagescited by 1
  11. 2026Do Transformers Use their Depth Adaptively? Evidence from a Relational Reasoning Taskcited by 0
  12. 2026Source-Modality Monitoring in Vision-Language Modelscited by 0
9 more
  1. 2026When Symbol Names Should Not Matter: A Logistic Theory of Fresh-Symbol Classificationcited by 0
  2. 2026Assign and Add: A Mechanistic Study of Compositional Arithmeticcited by 0
  3. 2026Formalizing the Binding Problemcited by 0
  4. 2026One mechanism for many mental spaces: a shared router over a value slot in language modelscited by 0
  5. 2026Belief-reality separation lives in routing over a shared value slot in language modelscited by 0
  6. 2026Syntax vs. Semantics: How Transformers Learn Deep Dependenciescited by 0
  7. 2026Rate-Coding Bundle Memory: A Unified Model of Memory and Control for Symbolic Computation in the Braincited by 0
  8. 2026Transformers Stop Thinking Too Early, and a Tiny LoRA Fixes Itcited by 0
  9. 2026When Context Changes: Understanding Update Failures in LLMscited by 0