Humans possess a remarkable "algebraic" ability: if we know the meaning of the word "jump" and the meaning of the rule "twice," we instantly understand what it means to "jump twice," even if we have never heard that specific combination before. In machine learning, this is known as compositional generalization—the ability to recognize and produce novel combinations of known primitives.
Despite their success in natural language processing, standard neural networks often fail this basic test. As Brenden M. Lake demonstrated with the SCAN benchmark, models like LSTMs can achieve near-perfect accuracy on data similar to their training set but fail catastrophically when asked to apply a familiar rule to a new command. This suggests that models are often memorizing specific sequence patterns rather than internalizing the underlying generative principles.
The Entanglement Problem
The primary reason standard models struggle is that their internal representations are "entangled." In a typical sequence-to-sequence model, the representation of a word is heavily influenced by its neighbors and its position in a way that blends "what" the word is with "where" it appears in a specific training example.
To combat this, Hao Zheng and Mirella Lapata proposed Disentangled Sequence-to-Sequence Learning. Their model, R-Dangle, forces the system to re-encode source information at periodic intervals, preventing the decoder from losing track of the original "primitives" as it generates complex outputs. By separating the identity of a component from its structural role, models can more easily rearrange familiar parts into unfamiliar configurations.
Lexical versus Structural Generalization
Research has revealed a significant gap between two types of generalization. Alexander Koller and Yuekun Yao found that while models are excellent at lexical generalization—swapping one word for another within a known pattern—they struggle with structural generalization, such as handling deeper recursion or novel syntactic trees.
The bottleneck is often the decoder. While the encoder might successfully capture the structure of a complex sentence, the decoder often reverts to the statistical patterns it saw during training. This is why models fail on tasks like Shifted PAUQ, where the output SQL queries are longer or more complex than those in the training set.
Injecting Structural Priors
One way to bridge this gap is to move away from treating language as a flat string of tokens. By introducing hierarchical or graph-based inductive biases, we can guide models toward systematicity:
- Latent Trees: Shawn Tan and colleagues developed models that generate sentences using Recursive Top-Down Production. By treating language as a hierarchy, the model is forced to learn recursive rules that naturally generalize to longer sequences.
- Graph Alignment: Instead of predicting a sequence, the LAGr framework by Dora Jambor and Dzmitry Bahdanau treats semantic parsing as a graph-prediction task. By aligning the output graph directly with the input text, the model learns to map specific words to specific logical roles, regardless of the overall complexity of the sentence.
Learning from Recombination
If the problem is that models haven't seen enough variety, we can "simulate" systematicity through data. Jacob Andreas introduced GECA (Good-Enough Compositional Data Augmentation), which identifies fragments of text that appear in similar contexts and swaps them to create synthetic training examples. This forces the model to observe that certain components are interchangeable, encouraging it to learn the rules of the "slots" rather than the specific "fillers."
Similarly, Yinuo Guo and Jian–Guang Lou showed that Iterative Back-Translation can act as a curriculum for compositionality. By starting with simple examples and iteratively generating more complex ones, standard models can eventually "grok" the underlying logic of a domain without needing specialized architectures.
The Path Forward
The evidence from Arkil Patel and Phil Blunsom suggests that standard Transformers and LSTMs aren't fundamentally incapable of systematicity; they are simply data-starved for the right kind of variation. Whether through Grammar Prompting for LLMs or Equi-Tuning to bake in symmetries, the goal remains the same: moving from models that memorize sequences to models that understand the rules of the game.