Compositional Generalization through Gradient Search in Nonparametric Latent Space

Haruki Shirakami, James HendersonICLR 2026

TL;DR

The Abduction Transformer is a novel architecture designed to solve the "compositional generalization" problem—the ability to recombine known concepts to solve entirely new types of puzzles. By representing knowledge as a flexible, nonparametric mixture of distributions and using gradient-based search at test-time to "fine-tune" its hypothesis, the model significantly outperforms standard Transformers. On complex out-of-distribution reasoning tasks, it even rivals massive models like GPT-5.

What Problem Does This Paper Address?

Current deep learning models are world-class pattern matchers but often fail at systematic reasoning. If you teach a model concept "A" and concept "B," it might still struggle to solve a problem that requires "A then B" if it never saw that specific combination during training. This is known as the "compositional generalization" gap.

Standard Transformers tend to memorize solutions rather than learning reusable primitives. When faced with out-of-distribution (OOD) tasks—like a logic puzzle involving a novel combination of rules—they exhibit catastrophic failure. The authors argue that to solve this, models need a way to perform abductive inference: searching for the most plausible "hidden cause" (or hypothesis) that explains a new set of observations.

Methods

The authors introduce the Abduction Transformer, which treats few-shot learning as a variational Bayesian inference problem.

Abduction Transformer Architecture

Key innovations of this architecture include:

  1. Nonparametric Latent Space: Instead of squeezing a problem's "meaning" into a single fixed-size vector, the model uses a Dirichlet Process (DP). This allows the latent representation to be a "set-of-vectors" (a mixture distribution) that can grow or shrink in complexity depending on the task.
  2. Information-Theoretic Regularization: During training, the model is forced to minimize the KL-divergence between its inferred latent distribution and a prior. This encourages the latent space to be sparse, smooth, and—crucially—searchable.
  3. Test-Time Gradient Search: This is the model's "secret sauce." When the model sees a new puzzle at test-time, it doesn't just do a single forward pass. It performs gradient descent in the latent space to refine its hypothesis until it perfectly explains the provided few-shot examples. It is essentially "thinking" and verifying its own logic before making a final prediction.

Datasets

The model was evaluated on three distinct benchmarks designed to test compositional logic:

Examples of evaluation tasks including 1-D ARC and Linguistic Systematicity
  • 1-D ARC: A simplified, one-dimensional version of the Abstraction and Reasoning Corpus. It involves spatial transformations like "translate," "sort," or "denoise."
  • SRAVEN (Symbolic Raven’s Progressive Matrices): A symbolic version of the classic IQ test. Models must identify rules governing how feature vectors change across a grid.
  • Linguistic Systematicity: A grammar induction task where the model must learn to interpret novel sentences based on a few examples of symbol-to-color mappings.

Key Insights and Ideas

  • Sets are better than Vectors: The authors found that "set-of-vector" representations (nonparametric) generalize much better than fixed-size vectors. Because complex tasks are naturally composed of multiple simpler "primitives," a set can represent these components individually.
  • Stochasticity enables Search: By sampling representations during training rather than using deterministic ones, the model learns a latent "landscape" that is smooth enough to navigate via gradients at test-time.
  • Search is the OOD Bridge: Standard transformers perform well when the test data looks like the training data. However, in "extreme OOD" regimes (where only 1% of possible rule combinations were seen during training), test-time search is the only mechanism that allows the model to "discover" the correct combination of rules.

Key Results

  • 1-D ARC: The Abduction Transformer achieved a 25.1% solve rate, compared to just 5.2% for a standard decoder-only Transformer and 1.9% for previous state-of-the-art latent search methods (LPN).
  • SRAVEN: When trained on only 1% of possible rule combinations, the Abduction Transformer solved 46.1% of test problems. For context, GPT-5 (Thinking/o1-style) achieved 41.0% on the same task without fine-tuning.
  • Linguistic Task: The model maintained near-perfect accuracy even when the number of few-shot examples was reduced to the bare minimum required to identify the grammar. In contrast, baseline Transformers saw their performance degrade immediately as examples became scarce.

Limitations and Future Work

  • Computational Cost: Performing 100 steps of gradient descent at test-time is significantly slower than a single forward pass. Scaling this to real-time applications or massive datasets remains a challenge.
  • Perceptual Complexity: While the model excels at symbolic and 1-D spatial reasoning, it hasn't yet been tested on high-dimensional raw data (like 2D images or long-form video).
  • Discrete vs. Continuous: The current search happens in a continuous latent space. The authors suggest that future work could explore hybrid approaches that combine this with discrete search over symbolic program spaces.

Summary updated

BibTeX
@inproceedings{shirakami2026compositional,
  author = {Haruki Shirakami and James Henderson},
  title = {{Compositional Generalization through Gradient Search in Nonparametric Latent Space}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=RNTWTJe4x6},
}
Figure