Abstract
Compositionality—the ability to understand a whole through its parts—remains a significant challenge for standard neural network architectures. This paper introduces LexSym, a model-agnostic data augmentation framework that treats compositionality as a mathematical constraint on data distributions. By discovering and exploiting "lexical symmetries," LexSym enables standard models like Transformers and LSTMs to generalize to novel combinations of concepts across text and visual modalities. Experimental results across benchmarks such as SCAN, COGS, and CLEVR-CoGenT demonstrate that LexSym matches or exceeds the performance of specialized compositional architectures.
Introduction: The Compositionality Gap
Human language is inherently compositional. If a person understands the concepts "red" and "square," they can immediately conceptualize a "red square," even if they have never encountered one before. In contrast, standard deep learning models, such as Transformers and LSTMs, often struggle with this type of systematic generalization. They typically require vast amounts of data to learn relationships and frequently fail when presented with novel combinations of known concepts (e.g., failing to recognize a "purple cylinder" if training only included "red cylinders" and "purple cubes").
Historically, researchers have addressed this by developing specialized, "compositional" model architectures. While these can be effective, they are often rigid, task-specific, and less robust to the irregularities of natural language. LexSym proposes an alternative: achieving compositional generalization using standard, unstructured models by focusing on the data distribution itself.
LexSym: Compositionality as Symmetry
The core insight of LexSym is a "data-centric" account of compositionality. The authors prove that if a task is solvable by a compositional model, the underlying data distribution must exhibit specific symmetries, known as homomorphisms. Essentially, if two words of the same type (e.g., "red" and "green") are swapped along with their corresponding meanings, the resulting example should remain well-formed and valid.
LexSym automates the discovery and exploitation of these symmetries through a multi-step pipeline:
- Lexicon Extraction: The system aligns input tokens (words) with output tokens (logical forms or visual features) using standard alignment algorithms like IBM Model 2.
- Automatic Typing: Words are clustered based on their contexts to determine their functional "type" (e.g., identifying that "jump" and "run" are both verbs).
- Data Augmentation: Using the extracted lexicon and types, LexSym generates new training examples by swapping tokens of the same type. For instance, a training example for a "red ball" can be synthesized into a "green ball" example if the model knows the mapping for "green."
- Multimodal Generalization: For visual tasks, LexSym utilizes a VQ-VAE to discretize continuous pixel data into "visual words." This allows the system to treat image patches as tokens, enabling the same symmetry-based augmentation to be applied to visual concepts.
Experimental Evaluation
LexSym was evaluated across four diverse benchmarks designed to test systematicity: SCAN (navigation), COGS (semantic parsing), ALCHEMY (instruction following), and CLEVR-CoGenT (visual question answering).
The results indicate that LexSym significantly enhances the performance of standard models. On the CLEVR-CoGenT benchmark, it achieved a new state-of-the-art, reducing relative error by 33%. On SCAN and COGS, it reached near-perfect accuracy on challenging splits, such as "jump" and "nonce words," outperforming both standard LSTMs and several specialized architectures. Notably, even large pre-trained models like T5 showed performance gains when augmented with LexSym, particularly on the COGS "nonce" split, where accuracy improved from approximately 64% to 76%.
Conclusion and Future Work
LexSym demonstrates that compositionality can be treated as a property of the data distribution rather than a requirement for model architecture. By framing compositionality as lexical symmetry, the framework provides a model-agnostic way to improve systematic generalization across text and vision. Current limitations include a focus on single-token swaps rather than complex phrases and a lack of explicit handling for recursion. Future research may extend LexSym to handle more complex "tree-shaped" structures, potentially providing even stronger formal guarantees for semantic parsing and complex reasoning tasks.
Summary updated