← All papers  /  Nov 10, 2026
Evaluation

Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage

First page
Evaluating Compositional Generalization in Transformers: The Role of Composition Equivalence and Module Coverage
The curator’s take

Purva Pruthi, Andrew Yuan, Alexander D'Amour (Google DeepMind) and David Jensen (UMass Amherst) show that inconsistent findings on compositional generalization in transformers come from two properties of train-test splits: composition equivalence and module coverage.

Ask this paper

Key points
01

Composition equivalence. Different module sequences can reduce to the same end-to-end function. Models trained only on final outputs score well mainly by exploiting these equivalences, and their performance drops sharply when test compositions produce new functions.

02

Module coverage. Performance falls monotonically as modules appear in positions or pairings at test time that were absent in training, for both direct and step-by-step models.

03

Benchmark design. Splits containing equivalences overestimate generalization, and combining coverage violations with equivalences encourages shortcut learning. The authors argue "unseen" should be defined functionally, not syntactically.

04

LLM case study. On LiveCodeBench code-output prediction, composition equivalence also shapes Llama3-8B's apparent generalization. Accepted at NeurIPS 2026.

Abstract

Compositional generalization is an important form of out-of-distribution generalization, defined as the ability to train on some combinations of modules (e.g., functions such as sort, filter) and then generalize to unseen combinations. Despite substantial empirical work evaluating compositional generalization in transformers, findings have been inconsistent because evaluations were often conducted on a limited set of train-test splits, defined in an ad hoc manner. Through a systematic evaluation, we identify two key aspects of the train-test distribution that strongly affect performance: composition equivalence and module coverage. We show that the apparent performance of direct models (trained only on final outputs) results primarily from exploiting composition equivalences, meaning different sequences of modules that reduce to identical end-to-end functions. When benchmarks eliminate these equivalences, performance drops significantly, showing their inability to generalize to compositions of known modules that produce novel end-to-end functions. We further demonstrate that performance degrades monotonically as module coverage shifts increase (when modules appear in different contexts between train and test), affecting both direct and step-by-step models (trained on intermediate and final outputs). These findings have concrete implications for benchmark design: benchmarks that include compositional equivalences can lead to significant overestimation of the generalization abilities of direct models, and benchmarks that include both module coverage violations and compositional equivalences can exacerbate shortcut learning. As a case study, we demonstrate the role of compositional equivalence on the generalization performance of the pre-trained model Llama3-8B on the code-output prediction task in the coding benchmark LiveCodeBench.

Every Monday
Get next week’s papers.
Subscribe on Substack