Compositional Generalization
When AI Models begin to goes beyond Next Word Prediction to make new combinations of skill mixes, simulating creativity.
Defining and Describing Compositional Generalization
Compositional generalization is the ability to build correct interpretations of novel combinations from familiar parts.
Compositional generalization refers to a model’s ability to recombine known primitives—such as words, operations, or syntactic structures—into novel configurations that were absent from training.
[1w21a6]
[jjyf9g]
It applies when a system must interpret or generate an unfamiliar compound while preserving the rules governing its components, rather than memorizing complete examples.
[1w21a6]
[dyf36g]
The concept matters because standard in-distribution performance can remain high even when models fail on systematically withheld combinations.
[jjyf9g]
flowchart LR
A["Known primitives"] --> B["Learned composition rules"]
B --> C["Novel combination"]
C --> D["Correct unseen output"]
Uses in Context
History of Use
Origins
- The underlying idea is older than SCAN: compositionality in language concerns constructing the meaning of a complex expression from its parts and the way those parts are combined. [ncnye8]
Evolution
Best Real-World Examples
- SCAN benchmark — tests whether models can recombine familiar command primitives into unseen action sequences. [1w21a6] [7bmuvc]
- COGS benchmark — evaluates compositional generalization from English sentences to logical forms. [1w21a6] [1zyfsb]
- CFQ benchmark — evaluates novel compositions in natural-language question answering over Freebase-style SPARQL queries. [exvk4p] [1zyfsb]
- Compositional Program Generator — uses program-like compositional structure to achieve strong performance on SCAN and related tasks. [jjyf9g]
- Least-to-most prompting — demonstrates that decomposing a problem into progressively larger subproblems can substantially improve SCAN performance for a language model. [3gkx29]
- Neuro-symbolic systems — combine learned language representations with explicit structure to target systematic recombination. [jjyf9g]
- Open compositional-generalization repositories — provide implementations and collections of SCAN, COGS, CFQ, and related evaluation resources. [1zyfsb]
Case Studies
SCAN and systematic command following. Lake and Baroni introduced SCAN in 2018 as a controlled test of whether a model could translate imperative commands into action sequences when familiar primitives were combined in unfamiliar ways.
[1w21a6]
[7bmuvc]
The benchmark includes splits that withhold particular compositions or lengths from training, so success requires more than reproducing common input–output associations.
[exvk4p]
[1w21a6]
Later analyses reported that conventional sequence-to-sequence models could perform very well on in-distribution examples while failing sharply on difficult out-of-distribution splits.
[exvk4p]
[jjyf9g]
SCAN therefore became a compact demonstration of the gap between ordinary generalization and systematic compositional generalization.
[1w21a6]
[jjyf9g]
COGS and compositional semantic parsing. COGS extended the problem from synthetic navigation commands to English sentences paired with logical forms.
[1w21a6]
[1zyfsb]
Its splits intentionally withhold structural configurations, including combinations of familiar vocabulary and argument roles, requiring a model to transfer learned rules to new sentence structures.
[1w21a6]
[dyf36g]
Reported results show a pronounced contrast between high in-distribution accuracy and much lower generalization accuracy for standard sequence-to-sequence systems.
[jjyf9g]
The case illustrates that compositionality is not limited to short commands: it also concerns systematic transfer across grammatical and semantic structures.
CFQ and controlled compound divergence. CFQ applies compositional-generalization testing to natural-language questions and their corresponding SPARQL queries.
[exvk4p]
[1w21a6]
[1zyfsb]
The associated distribution-based methodology separates familiar primitive rules from novel compound structures and attempts to maximize the difference between training and test compositions while controlling the difference among atomic components.
[exvk4p]
[g43hrf]
This design makes it possible to ask whether a model has learned reusable query-construction rules rather than memorized recurring question templates.
[exvk4p]
[g43hrf]
CFQ consequently broadened the evaluation target from toy command following to structured question answering and semantic parsing.
[1w21a6]
[1zyfsb]
Sources
[exvk4p] Neuro-Symbolic pathways to AGI: compositional reasoning ... [2]: Neuro-Symbolic pathways to AGI: compositional reasoning and ...
[g43hrf] Measuring Compositional Generalization: A Comprehensive Method on Realistic Data [7]: github.com › superuserkalianon › cogs-benchmarkGitHub - superuserkalianon/cogs-benchmark: COGS ...