Abstract
Recent diagnostic datasets on compositional generalization, such as SCAN and COGS, expose severe problems in models trained from scratch. However, state-of-the-art models trained on larger datasets show better generalization. This work reconciles this inconsistency through an empirical analysis of training sets with varying data factors. We demonstrate that increased dataset complexity leads to better generalization by providing diverse examples and preventing ungeneralizable memorization. Furthermore, we explore the influence of example difficulty, finding that while simple examples invoke stronger compositionality in synthetic tasks, a balanced mixture of simple and hard examples is optimal for large-scale real language datasets.
Introduction: The Challenge of Compositionality
Compositional Generalization (CG) is the ability to understand novel combinations of known components—for instance, understanding "run twice" if "run" and "twice" are known, even if the specific combination is unseen. While Large Language Models (LLMs) show promise, standard benchmarks like SCAN often result in failure for models trained from scratch. This paper investigates whether the "secret sauce" of LLMs lies in the scale and complexity of their training data rather than just model architecture.
Methodology
The authors utilized Transformer-based sequence-to-sequence models to test several hypotheses:
- Pattern Complexity: Increasing the number of unique "primitives" (e.g., verbs or entities) in the training set.
- AugZero: A "zero-knowledge" augmentation method that copies vocabulary and re-tokenizes the dataset multiple times to increase primitive diversity without external data.
- Difficulty Metrics: Categorizing examples based on complexity (input length/primitives) and prototype distance (using SimCSE embeddings to identify outliers).
The Mechanism: Memorization vs. Composition
A central finding is that models are essentially "lazy." When a dataset is small or repetitive, models prefer surface memorization—mapping specific inputs directly to outputs. However, as dataset complexity increases, the "memory cost" of rote learning becomes prohibitive.
By increasing the number of unique primitives and reducing repetition, models are forced to adopt a more efficient strategy: learning the underlying compositional rules. This shift is evidenced by embedding alignment; as data becomes more complex, the embeddings for different primitives move closer together in syntactic space, indicating the model is learning their shared roles.
Results on Natural Language Datasets
The principles derived from synthetic benchmarks like SCAN translate effectively to real-world natural language tasks. On the GeoQuery dataset, data augmentation provided a consistent ~5% accuracy boost.
Interestingly, the impact of example difficulty varies by context. In synthetic tasks, simple examples are superior for inducing compositionality. However, in large-scale real-world datasets like ATIS and SMCalFlow, a "difficulty trade-off" emerges. While simple examples provide the compositional foundation, harder examples are necessary for linguistic coverage. As shown in the figure above, a balanced mixture (often around 50-75% difficulty) typically yields the highest exact-match accuracy.
Conclusion
This research highlights that dataset quality—specifically high diversity and low repetition—is as critical as model scale for achieving compositional generalization. By systematically increasing the "cost" of memorization through data complexity, we can steer models toward learning robust, generalizable rules. Future work will extend these findings from lexicon-level generalization to more complex structural hierarchies.
Summary updated