When Does Disentanglement Enable Compositional Generalization? A Transfer Bound and Its Empirical Validation

Rishi Ashish Shah, Shivaay Dhondiyal, Sarthak PandeyCompLearn @ ICML 2026

TL;DR

Standard neural networks struggle with "compositional generalization"—understanding new combinations of familiar parts (like "jump around" if they've only seen "jump" and "walk around"). This paper proves that this failure is rooted in representational entanglement and provides a mathematical bound showing that the more a model's internal state confuses "what" is being done with "how" it's modified, the worse it generalizes. By forcing a hard architectural split in the hidden state, the authors achieve near-perfect accuracy on the challenging SCAN benchmark with only a handful of examples.

What Problem Does This Paper Address?

Imagine a child who knows what "jump" means and what "around" means. They can immediately understand "jump around" even if they’ve never heard the phrase. Standard sequence-to-sequence (seq2seq) models, however, often fail this simple test.

The authors argue this isn't a "coverage" problem (the model hasn't seen enough data) but a representational failure. In a typical model, the internal "thought" (hidden state) for "jump" might be inextricably tangled with the context it appeared in during training. When the model sees a novel combination, it relies on "spurious co-occurrences"—patterns that were true in training but are false in the real world.

Classical learning theory (like covariate shift) doesn't help here because it assumes the test data comes from the same general distribution as training. In compositional tasks, the test set contains combinations with zero probability in the training set, making standard error bounds useless.

Methods

The researchers tackle this through a three-pronged approach:

  1. The Transfer Bound (Theory): They derive a new mathematical theorem (Theorem 3.3) proving that error on novel compositions is upper-bounded by the error on individual factors plus a penalty term: the Mutual Information (MI) between the "primitive" subspace (the action) and the "relational" subspace (the modifier). Essentially: Lower entanglement = Lower generalization error.
  2. DisentangledLSTM (Architecture): To put the theory into practice, they modified a standard Bidirectional LSTM. They implement a hard factorisation, splitting the hidden state vector $h$ into two distinct halves. They then add auxiliary supervision: two small classifiers that force the first half to predict the action (e.g., JUMP) and the second half to predict the relation (e.g., TWICE), ensuring the information doesn't leak between subspaces.
  3. Scaffolded Inference (Test-time): At test time, they use a grammar-guided approach. They decompose a novel command into its parts, process them through the disentangled encoder independently (where they look like "in-distribution" data), and then recompose the outputs.

Datasets

The paper evaluates the method on two primary benchmarks:

  • SCAN: A synthetic dataset for command execution. They focus on the "jump split," where the model sees "jump" only in isolation during training but must execute it with complex modifiers (like "jump around left twice") at test time.
  • COGS: A more naturalistic and difficult benchmark based on English grammar, involving lexical polysemy (words with multiple meanings) and idiomatic structures.

Key Insights and Ideas

  • Disentanglement is a Predictor, not just a Desideratum: While many researchers "want" disentangled representations because they seem elegant, this paper provides a quantitative reason why they are necessary for generalization.
  • The "Hard Split" is King: In their ablation studies, the authors found that simply using "soft" attention to separate syntax and semantics wasn't enough. The architectural guarantee—physically preventing neurons from sharing information—was the single most important factor for success.
  • Sample Efficiency: Once a model has a disentangled representation, it becomes incredibly "sample efficient." It only needs to see a novel primitive in a few contexts (4-shot) to "unlock" the ability to use it in any context.
  • Independence of Mechanisms: The paper links its findings to causal inference. If the real world generates data through independent mechanisms (the choice of action is independent of the choice of modifier), the model's internal architecture should mirror that independence.

Key Results

  • SCAN Jump Split: The DisentangledLSTM achieved 99.2% accuracy with just 4 support examples. For comparison, a standard vanilla LSTM reached only 38.3% under the same conditions.
  • Theory-Practice Coupling: The authors found a very strong Pearson correlation ($r \approx 0.9$) between the Mutual Information Gap (MIG)—a metric of disentanglement—and actual transfer accuracy. This suggests their theoretical bound is a reliable predictor of real-world performance.
  • COGS: On the more complex COGS benchmark, the model still outperformed the baseline (67.4% vs 28.6%), though the lower absolute score reflects the "messier" nature of natural language compared to synthetic grammars.

Limitations and Future Work

  • Grammar Dependency: The current "Scaffolded Inference" requires a known grammar to decompose commands. For "wild" natural language where no formal grammar exists, the model would need a learned parser.
  • LSTM vs. Transformers: The study uses LSTMs because their hidden states are easier to partition. Extending this "factorisation principle" to the residual streams of Transformers is a non-trivial but necessary next step.
  • Polysemy: The bound "loosens" when words have multiple meanings (like "bank" as a river edge vs. a financial institution), as this violates the clean independence of primitive and relation. Handling these "messy" linguistic realities is a major area for future work.

Summary updated

BibTeX
@inproceedings{shah2026when,
  author = {Rishi Ashish Shah and Shivaay Dhondiyal and Sarthak Pandey},
  title = {{When Does Disentanglement Enable Compositional Generalization? A Transfer Bound and Its Empirical Validation}},
  booktitle = {CompLearn @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=nl7vgE31k8},
}
Figure