An explainable transformer circuit for compositional generalization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Tang, Cheng, Lake, Brenden, Jazayeri, Mehrdad
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909505459060736
author Tang, Cheng
Lake, Brenden
Jazayeri, Mehrdad
author_facet Tang, Cheng
Lake, Brenden
Jazayeri, Mehrdad
contents Compositional generalization-the systematic combination of known components into novel structures-remains a core challenge in cognitive science and machine learning. Although transformer-based large language models can exhibit strong performance on certain compositional tasks, the underlying mechanisms driving these abilities remain opaque, calling into question their interpretability. In this work, we identify and mechanistically interpret the circuit responsible for compositional induction in a compact transformer. Using causal ablations, we validate the circuit and formalize its operation using a program-like description. We further demonstrate that this mechanistic understanding enables precise activation edits to steer the model's behavior predictably. Our findings advance the understanding of complex behaviors in transformers and highlight such insights can provide a direct pathway for model control.
format Preprint
id arxiv_https___arxiv_org_abs_2502_15801
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle An explainable transformer circuit for compositional generalization
Tang, Cheng
Lake, Brenden
Jazayeri, Mehrdad
Machine Learning
Artificial Intelligence
Computation and Language
Compositional generalization-the systematic combination of known components into novel structures-remains a core challenge in cognitive science and machine learning. Although transformer-based large language models can exhibit strong performance on certain compositional tasks, the underlying mechanisms driving these abilities remain opaque, calling into question their interpretability. In this work, we identify and mechanistically interpret the circuit responsible for compositional induction in a compact transformer. Using causal ablations, we validate the circuit and formalize its operation using a program-like description. We further demonstrate that this mechanistic understanding enables precise activation edits to steer the model's behavior predictably. Our findings advance the understanding of complex behaviors in transformers and highlight such insights can provide a direct pathway for model control.
title An explainable transformer circuit for compositional generalization
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2502.15801