Abstract
In tasks like semantic parsing, instruction following, and question answering, standard deep networks fail to generalize compositionally from small datasets. Many existing approaches overcome this limitation with model architectures that enforce a compositional process of sentence interpretation. In this paper, we present a domain-general and model-agnostic formulation of compositionality as a constraint on symmetries of data distributions rather than models. Informally, we prove that whenever a task can be solved by a compositional model, there is a corresponding data augmentation scheme -- a procedure for transforming examples into other well formed examples -- that imparts compositional inductive bias on any model trained to solve the same task. We describe a procedure called LEXSYM that discovers these transformations automatically, then applies them to training data for ordinary neural sequence models. Unlike existing compositional data augmentation procedures, LEXSYM can be deployed agnostically across text, structured data, and even images. It matches or surpasses state-of-the-art, task-specific models on COGS semantic parsing, SCAN and ALCHEMY instruction following, and CLEVR-COGENT visual question answering datasets.
Introduction
Standard deep learning models, such as Transformers and LSTMs, often struggle with compositional generalization. While they can learn to interpret "pick up the red ball," they frequently fail when presented with a novel combination like "pick up the blue cube," even if they are familiar with the individual components "blue" and "cube." Traditionally, researchers have addressed this by designing specialized architectures with hard-coded compositional logic. However, these models can be brittle when faced with the nuances of natural language.
This paper introduces LexSym, a model-agnostic framework that treats compositionality as a symmetry within the data distribution itself. By identifying interchangeable "lexical symmetries" and generating new training examples through synchronous swaps, LexSym provides a compositional inductive bias to standard neural networks without requiring architectural changes.
The LexSym Framework
LexSym operates on the principle that if a task is compositional, its data distribution must exhibit specific symmetries. The procedure involves several key steps:
- Lexicon Discovery: LexSym automatically extracts a lexicon by aligning input tokens (e.g., words) with output tokens (e.g., logical symbols or visual features).
- Automatic Typing: It identifies word "types" based on their environments. Words that appear in similar contexts (like "cat" and "dog") are grouped together.
- Homomorphic Augmentation: New training examples are generated by swapping tokens of the same type. Crucially, this is a synchronous swap: changing "red" to "blue" in a text prompt also requires changing the corresponding visual features in an image or logical symbols in a parse.
For multimodal tasks like VQA, LexSym treats image patches as "visual words" using a VQ-VAE, allowing the same swapping logic to bridge the gap between text and vision.
Experimental Evaluation
The authors evaluated LexSym across several challenging benchmarks:
- SCAN: Focused on the "jump" split, requiring generalization of a verb seen only in isolation.
- COGS: Tests linguistic generalizations, such as moving words between subject and object positions.
- ALCHEMY: An instruction-following task involving mixing colored liquids.
- CLEVR-CoGenT: A VQA benchmark where training and test sets contain different color/shape combinations.
Key Results
LexSym consistently matched or outperformed specialized, state-of-the-art models across all tested domains. Notably, it achieved 100% accuracy on the SCAN "jump" split, where standard LSTMs typically fail.
In the CLEVR-CoGenT VQA task, LexSym reached 85.9% accuracy, a significant improvement over the 73.3% baseline. Furthermore, applying LexSym to pre-trained models like T5 yielded additional performance gains, suggesting that even large-scale pre-training does not fully capture explicit compositional symmetries.
Discussion and Limitations
LexSym demonstrates that compositionality can be effectively imparted through data augmentation. By treating image patches as tokens, it shows that linguistic and visual compositionality share a common mathematical foundation.
However, some limitations remain. Currently, LexSym focuses on single-token swaps and does not yet handle multi-token phrases or complex recursion. Its effectiveness is also sensitive to tokenization, particularly in morphologically rich languages. Future work may extend these "data-centric" inductive biases to handle more complex structural transformations.
Summary updated