Infusing Commonsense World Models with Graph Knowledge

Alexander Gurung, Mojtaba Komeili, Arthur Szlam, Jason Weston, Jack UrbanekarXiv 2023 · DOI

Abstract

Language models often struggle with logical consistency in dynamic text-based environments. Researchers from Meta AI and Georgia Tech propose a method to infuse "commonsense world models" into these agents by training them to map natural language actions to structured knowledge graph updates. This approach significantly improves narrative consistency and reduces logical hallucinations, even when the underlying graph is unavailable during gameplay.

The "Goldilocks" Problem in Text Adventures

In text adventure games like Zork or AI Dungeon, AI models face a fundamental trade-off. Rule-based engines are logically sound but produce rigid, formulaic text. Conversely, large generative models produce creative prose but frequently suffer from "hallucinations"—describing actions that are physically impossible within the game's state, such as a character eating an item they do not possess. This research aims to combine the flexibility of natural language with the structural grounding of a game engine’s internal state.

Methodology: Bridging Text and Structure

The researchers utilized BART, a sequence-to-sequence transformer, trained to bridge the gap between text and structure through several key components:

  1. Graph Representation: The game's internal state is converted into a flattened list of triples (e.g., <wizard, IS_CARRYING, staff>).
  2. Multi-Task Training: The model is trained on three primary grounding tasks:
  3. Graph Update: Predicting specific graph changes (ADD/DEL) based on an action.
  4. Narration: Converting actions into rich text descriptions.
  5. Environment Prediction: Inferring missing room attributes from partial descriptions.
  6. Graph Dropout: To ensure robustness, "graph dropout" is used during training, randomly removing graph information so the model learns to infer the world state from text alone.
The sequence-to-sequence model architecture using graph context and natural language to predict both world state updates and narrations.

Datasets: LIGHT and USEEVENTS

The study leverages the LIGHT environment, a massive platform for text adventures. Additionally, the authors introduced USEEVENTS, a dataset of 10,000 complex, multi-object interactions crowdsourced from humans. While standard engines often only support simple "get" or "drop" commands, USEEVENTS provides the "long-tail" of complex commonsense interactions, such as "tie rope to wood stake," which are essential for realistic gameplay.

Experimental Results

The graph-infused model (Model I) was compared against a baseline trained only on text narrations (Model A).

  • Human Evaluation: Humans rated Model I as "All Good" (consistent with action and setting) 72% of the time, compared to 57% for the baseline.
  • Error Reduction: The "Inconsistent Action" error rate dropped from 20% in the baseline to just 4% in the graph-grounded model.
  • Automatic Metrics: Model I achieved the lowest perplexity across nearly all tasks, indicating higher certainty in predicting world state changes.
Performance comparison across different training tasks and graph dropout levels, showing the benefit of graph-grounded training.

Key Insights: The Power of Structural Grounding

The most significant finding is the "hidden" benefit of structure: training a model to predict graph updates makes it a better writer, even if the graph is removed at test time. By forcing the model to predict ADD and DEL operations, the authors ground the model’s understanding of causality. It learns, for instance, that picking up an item is a zero-sum game—it must be removed from the room to be added to the inventory.

Limitations and Future Directions

Despite these advances, challenges remain. As game worlds expand, the list of graph triples can exceed a standard language model's context window, suggesting a need for future retrieval mechanisms. Additionally, while single-turn consistency has improved, maintaining this over long-form narratives (50+ turns) remains a difficult frontier. Finally, the model still occasionally reverts to formulaic outputs common in the training data.

In summary, this work provides a blueprint for making AI "world-aware" by using structured knowledge as a training scaffold, leading to more reliable and logical generative agents.

Summary updated

BibTeX
@misc{gurung2023infusing,
  author = {Alexander Gurung and Mojtaba Komeili and Arthur Szlam and Jason Weston and Jack Urbanek},
  title = {{Infusing Commonsense World Models with Graph Knowledge}},
  year = {2023},
  eprint = {2301.05746},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.05746},
}
Figure