Latent Compositional Representations Improve Systematic Generalization in Grounded Question Answering

Ben Bogin, Sanjay Subramanian, Matt Gardner, Jonathan Berant

TL;DR

The paper introduces Grounded Latent Trees (GLT), a novel architecture that forces neural networks to learn step-by-step compositional reasoning for visual question answering. By restricting global information flow and using a bottom-up, CKY-style parser, the model induces latent tree structures that dramatically improve systematic generalization to unseen concept combinations. Trained purely on final answer supervision, GLT achieves state-of-the-art performance on out-of-distribution benchmarks without requiring gold program annotations.

What Problem Does This Paper Address?

While state-of-the-art neural networks (like Transformers and LSTMs) excel at visual question answering (VQA) when test data matches the training distribution, they notoriously struggle with systematic generalization. Humans can easily understand a novel phrase like "winged giraffe" if they know what "winged" and "giraffe" mean individually. Neural models, however, fail when familiar concepts are combined in entirely new ways at test time.

The authors argue that highly expressive, standard architectures suffer from this because they compute "global" representations where every token can attend to every other token from the start. This allows the network to bypass step-by-step reasoning, "collapse" complex logical steps, and exploit statistical shortcuts in the training set. To fix this, the paper proposes enforcing a hierarchical, compositional inductive bias directly into the network's architecture.

Methods

The authors propose Grounded Latent Trees (GLT), a model that explicitly decomposes questions using a chart-parsing approach inspired by classical pre-neural computational linguistics (the CKY algorithm).

Instead of processing the text globally, GLT recursively computes two things for every possible text span ($q_{ij}$) from the bottom up:

  1. A dense representation ($h_{ij}$): Captures the linguistic meaning of the span.
  2. A denotation ($d_{ij}$): A probability distribution over the objects in the image that the span refers to.
An example of a latent tree structure induced by GLT over a complex question

Bottom-Up Parsing & Continuous Relaxation

For single words (length-1 spans), the model initializes representations using word embeddings and grounds them directly to image objects detected by a Faster R-CNN. For longer spans, GLT considers all possible split points $k$ that divide a span into two sub-spans. Because tree structures are not provided during training, the model uses a continuous relaxation (a softmax over all possible split points) to softly weight and aggregate the representations of all possible trees.

Composition Modules

To merge the denotations of two sub-spans, GLT routes the data through four distinct, learned modules:

  • SKIP: Passes through the denotation of either the left or right sub-span (e.g., ignoring filler words like "there is a").
  • INTERSECTION & UNION: Performs element-wise minimum or maximum operations over object probabilities to handle logical conjunctions and disjunctions.
  • VISUAL: The most expressive module, responsible for evaluating spatial relations (e.g., "left of") or attribute comparisons (e.g., "same color as") by looking at the actual visual features of the objects.

Crucially, the entire architecture is fully differentiable and trained using only the final answer as supervision. The model must figure out the latent tree structure on its own to arrive at the correct answer.

Datasets

The model was evaluated on three distinct benchmarks:

  1. Synthetic Arithmetic Expressions: A custom dataset designed to test operator precedence (addition and multiplication) across three splits: Easy (i.i.d.), Operation (unseen operator orderings at test time), and Length (longer expressions at test time).
  2. CLEVR: A standard synthetic VQA dataset featuring geometric objects, used here as the in-distribution training baseline.
  3. CLOSURE: An out-of-distribution benchmark built on CLEVR images that pairs familiar referring expressions in seven entirely novel question templates to explicitly test systematic generalization.
  4. CLEVR-Humans: A dataset of crowdsourced, natural language questions asked by humans on CLEVR images, testing the model's adaptability to real-world language variations.

Key Insights and Ideas

  • Restricting Information Flow is a Feature, Not a Bug: By preventing tokens from seeing the entire sentence simultaneously, the model is forced to resolve local phrases compositionally. This structural constraint acts as a powerful regularizer against dataset shortcuts.
  • End-to-End Latent Tree Induction Works: The paper demonstrates that you do not need expensive "gold program" annotations (which specify the exact execution steps) to learn compositional logic. The model successfully induces meaningful semantic trees purely from final answer supervision.
  • Explicit Intermediate Grounding: Computing an explicit "denotation" (set of objects) for intermediate spans anchors the text to the visual world at every step of the tree, preventing the representation from drifting or losing track of the core task.

Key Results

GLT demonstrates massive performance gains on out-of-distribution splits compared to standard architectures:

Arithmetic Expressions

While a standard Transformer perfectly solves the Easy split, its performance collapses to 2.9% on the Operation split. In contrast, GLT maintains an accuracy of 98.4%, proving it successfully mastered operator precedence rather than memorizing sequences.

Comparison of Easy vs. Operation splits on arithmetic expressions

CLEVR and CLOSURE

On the standard, in-distribution CLEVR dataset, GLT performs on par with state-of-the-art models at 99.1%. However, on the challenging CLOSURE dataset, GLT achieves 96.1% accuracy. This outperforms strong end-to-end baselines like FiLM (60.1%) and MAC (72.4%) by roughly 24–36 absolute percentage points. Remarkably, it even beats oracle models that require gold programs during training.

Limitations and Future Work

Despite its success, the authors note a few key limitations:

  • Computational Complexity: Due to the chart-parsing nature of the CKY algorithm, the model scales at $O(n^3 + n^2n_{obj})$, making it slower and more memory-intensive than standard sequence models when processing long questions.
  • Text-to-Reasoning Discrepancies: Some questions require abstract reasoning steps that do not map cleanly to text spans. For example, a phrase like "most common shape" requires global grouping and counting operations that cannot be easily built compositionally from individual words.
  • Restricted Denotation Types: Currently, intermediate denotations can only represent sets of objects. The model cannot explicitly pass numbers or abstract attributes (like colors) up the tree as intermediate types, forcing it to rely on its "fallback" answer classification layer for complex counting comparisons.

Summary updated

BibTeX
@article{bogin2021latent,
  author = {Ben Bogin and Sanjay Subramanian and Matt Gardner and Jonathan Berant},
  title = {{Latent Compositional Representations Improve Systematic Generalization in Grounded Question Answering}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2021},
  url = {https://openreview.net/forum?id=GHKGwPnvFO0},
}
Figure