Compositional Generalization with Grounded Language Models

Sondre Wold, Étienne Simon, Lucas Georges Gabriel Charpentier, Egor V. Kostylev, Erik Velldal, Lilja Øvrelid

Introduction

Large Language Models (LLMs) often suffer from hallucinations because they store knowledge implicitly within their parameters. A common mitigation strategy is to "ground" these models in external Knowledge Graphs (KGs). However, recent research from the University of Oslo suggests that these grounded LMs struggle with compositional generalization—the ability to reason over novel combinations of known components. This study investigates whether grounded models truly reason over graph structures or merely perform sophisticated pattern matching based on memorized text-graph associations.

Methodology

The researchers evaluated the interaction between BERT-based language models and Relational Graph Convolutional Networks (R-GCNs) across four distinct architectural configurations:

  1. Disjoint: Independent processing of text and graph with final output concatenation.
  2. Grounded: Graph node embeddings are initialized using entity names processed by the LM.
  3. Unidirectional: A context node representing the LM's question is integrated into the graph.
  4. Bidirectional: Deep interaction where graph structure influences LM hidden states via specialized tokens.
The four architectural 'flavors' of grounded language models evaluated in the study.

To test these models, the authors utilized the Lehigh University Benchmark (LUBM), a synthetic KG generator. Synthetic data prevents "data leakage" from pre-training, ensuring the model must rely on the provided graph. The evaluation focused on three pillars of compositionality: Substitutivity (recognizing equivalent references), Productivity (extrapolating to longer reasoning chains), and Systematicity (handling novel sequences of relations).

Key Results and the Memorization Trap

The study revealed a significant performance degradation as the complexity of reasoning increased. While models achieved near-perfect accuracy (~92-98%) on simple 2-hop questions, performance plummeted to near-random levels (62-69%) on 4-hop questions.

A critical finding is the Memorization Trap: models perform significantly better on relation paths that appear frequently in the training set. As shown in the analysis of 3-hop reasoning, there is a clear correlation between training frequency and test accuracy. This suggests that grounded LMs are not learning general path-following functions but are instead memorizing specific high-frequency patterns.

Test accuracy vs. training frequency for 3-hop questions, illustrating the correlation between frequency and performance.

Furthermore, increasing architectural complexity did not yield robust reasoning. The "Bidirectional" and "Unidirectional" models failed to significantly outperform simpler baselines, and all models struggled to generalize to reasoning chains even one step longer than those seen during training.

Conclusion

The results indicate that current methods of integrating graph embeddings into LMs are insufficient for true compositional reasoning. Models remain tethered to training distributions and fail to extrapolate to novel or longer logical chains. Future research should prioritize architectures capable of explicit symbolic logic or step-by-step graph traversal to better mirror human-like compositional intelligence.

Summary updated

BibTeX
@inproceedings{wold2024compositional,
  author = {Sondre Wold and Étienne Simon and Lucas Georges Gabriel Charpentier and Egor V. Kostylev and Erik Velldal and Lilja Øvrelid},
  title = {{Compositional Generalization with Grounded Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.205},
}
Figure