Related Experiment Video
Updated: Feb 6, 2026

Fabrication and Design of Wood-Based High-Performance Composites
Published on: November 9, 2019
Circuit explained: How does a transformer perform compositional generalization
Cheng Tang1, Brenden Lake2, Mehrdad Jazayeri1,3
1Department of Brain and Cognitive Sciences, Massachusetts Institute of Technology, Cambridge, Massachusetts, United States of America.
Abstract:
Compositional generalization-the systematic combination of known components into novel structures-is fundamental to flexible human cognition, yet the mechanisms that enable it in neural networks remain poorly understood in both machine learning and cognitive science. [1] showed that a compact encoder-decoder transformer can achieve simple forms of compositional generalization in a sequence arithmetic task. In this work, we identify and mechanistically interpret the circuit responsible for this behavior in such a model. Using causal ablations, we isolate the circuit and show that this understanding enables precise activation edits to steer the model's outputs predictably. We find that the circuit performs function composition without encoding the specific semantics of any given function-instead, it leverages a disentangled representation of token position and identity to apply a general token remapping rule across an entire family of functions. Although the circuit mechanism was identified in a limited number of small scale models with a synthetic task, it sheds light to how symbolic compositionality can emerge in transformers and offer testable hypotheses for similar mechanisms in large-scale models. Code for model and analysis is publicly available.
More Related Videos
10:30A Generalized Method for Determining Free Soluble Phenolic Acid Composition and Antioxidant Capacity of Cereals and Legumes
Published on: June 10, 2022
04:09Author Spotlight: Streamlining Composite Plant Production via Agrobacterium rhizogenes-Mediated Hairy Root Transformation
Published on: June 30, 2023
Related Concept Videos
Equivalent Circuits for Practical Transformers
In a practical transformer, each winding exhibits resistance and leakage reactance. The...
Source Transformation for AC Circuits
Generalized Hooke's Law
Generalized Anxiety Disorder
Social Foundations of Self II: The Generalized Other
Generalization, Discrimination, and Extinction
Generalization occurs when a behavior reinforced in one context is performed in similar situations. For instance, a student who studies diligently for calculus and receives excellent grades might apply the same study habits to psychology and history, expecting similar results. Generalization shows how learning in one setting can influence behavior in...