NeurIPS 2026QuestionsPapersAreasAboutMarkdown

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

Purva Pruthi, Andrew Yuan, Alexander D'Amour, David Jensen

NeurIPS page · OpenReview · Open on the map

Category: Interpretability & Model Adaptation › Compositional Generalization in Transformers · Type: empirical study · Keywords: compositional generalization, benchmark design, module coverage, composition equivalence, shortcut learning, transformer evaluation

Areas: Evaluation & Benchmarks › Language Model and Agent Benchmarks › Compositional Reasoning

Summary

The paper systematically evaluates compositional generalization in transformers, identifying composition equivalence and module coverage as key factors that affect benchmark performance and lead to overestimation of generalization.

Explained to a 5-year-old

We test computer programs that put together small pieces of code. Sometimes the same result can be made in different ways, and sometimes the pieces are used in new situations. We look at how often the programs still work when they see new combinations, and we find that many tests are not fair because they let the programs cheat by using easy shortcuts.

Explained to a 5-year-old, longer

Imagine you have a set of building blocks that can be combined to make something, like stacking LEGO bricks. You learn how to build a few specific shapes using those blocks. When you try to build a new shape that uses the same blocks but in a different order, you might still succeed because some orders give the same result. This is called composition equivalence. Also, you might have learned to use a block only in one way, but the new shape uses it differently, which is called module coverage. The paper looks at how these two things affect whether a computer program can handle new shapes. It shows that if the test lets you use the same result in different ways, the program seems to do well, but it actually just copies the easy answer. If the test forces you to use the blocks in new ways, the program struggles. The study also checks a big language model on a coding test and finds the same problems. All of this tells us that many tests for AI are not as strict as they should be, and we need better tests to see if AI really understands how to combine things.

For a technical reader

The work analyzes why compositional generalization benchmarks give inconsistent results. By varying train-test splits, the authors isolate two factors: composition equivalence (different module sequences yielding identical functions) and module coverage (modules appearing in different contexts). They show that direct models exploit equivalence shortcuts, and both direct and step-by-step models degrade as coverage shifts increase. The findings highlight the need for benchmarks that eliminate these shortcuts to accurately assess generalization.

Problem

Evaluating compositional generalization in transformers yields inconsistent results because many benchmarks use ad-hoc train-test splits that do not control for composition equivalence and module coverage, making it unclear how well models truly generalize.

Method

The authors conduct a systematic evaluation across multiple benchmarks, varying train-test splits to isolate the effects of composition equivalence and module coverage, and compare direct and step-by-step models on code-output prediction tasks.

Results

The approach shows that eliminating composition equivalences leads to significant performance drops, and increasing module coverage shifts causes monotonic degradation, indicating that many benchmarks overestimate generalization.

Contributions

The paper identifies composition equivalence and module coverage as critical factors affecting compositional generalization, demonstrates their impact on both direct and step-by-step models, and provides guidance for designing more robust benchmarks.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction