DiffG-RL: Leveraging Difference between State and Common Sense

Tsunehiko Tanaka, Daiki Kimura, Michiaki TatsuboriarXiv 2022

Abstract

Taking into account background knowledge as context is a critical component of solving tasks involving natural language. In text-based games (TBGs), players must make decisions based on both the descriptive text of the environment and their own background knowledge regarding language and common sense. This work investigates the effective application of common sense rather than its mere inclusion. We hypothesize that the discrepancy between the current environment state and common sense expectations should serve as a primary ground for action selection. We propose DiffG-RL, an agent that constructs a Difference Graph to organize environment states and common sense through interactive objects and a dedicated graph encoder. DiffG-RL includes a framework for extracting appropriate common sense representations to support graph construction. Experiments on text-based games requiring common sense demonstrate that DiffG-RL outperforms baselines by 17% in overall scores and up to 40% in complex generalization tasks.

Introduction

Text-based games (TBGs) present a unique challenge for reinforcement learning (RL) agents. Unlike graphical environments, TBGs represent the world, the agent's observations, and the available actions entirely through natural language. This modality introduces three significant hurdles: combinatorial action spaces, partial observability, and the "Common Sense Gap."

While humans intuitively know that a "dirty fork" belongs in a "dishwasher" rather than on the "floor," traditional RL agents struggle to integrate this external background knowledge. Previous research has attempted to provide agents with common sense data, but these models often fail to connect that knowledge to the specific context of the game. They may possess the knowledge in theory but lack the mechanism to use it for planning sequences of actions when encountering specific objects in a virtual environment.

The DiffG-RL Framework

DiffG-RL is designed around the principle that action selection should be grounded in the discrepancy between "what is" (the current state) and "what should be" (common sense). The architecture consists of four primary components:

1. Common Sense Extractor (CE)

To avoid the noise of irrelevant data, the CE uses semantic similarity via word embeddings to pull relevant knowledge from the Visual Genome (VG) dataset. The extraction follows a three-step pipeline:

  • Extraction by Meaning: Identifying triples (subject-relation-object) semantically related to game objects.
  • Narrowing by Circumstances: Filtering out irrelevant knowledge (e.g., retaining "fork in dishwasher" while discarding "dishwasher in kitchen" if the dishwasher is an immovable entity).
  • Grounded Representation: Aligning the language of the common sense source with the specific entities found within the game environment.

2. The Difference Graph (DiffG)

The core innovation of this work is the Difference Graph. The agent constructs a graph where interactive objects (e.g., a fork) serve as central nodes. These nodes are linked to two distinct types of information: Current State Nodes (where the object is currently located, such as "floor") and Common Sense Nodes (where common sense suggests the object belongs, such as "dishwasher").

3. The Difference Encoder (DE)

The agent utilizes a Graph Isomorphism Network (GIN) to encode this graph into a vector representation. This allows the model to mathematically represent the "distance" or "difference" between the current state and the goal state for every interactive object in the room.

4. Action Selector

The final component compares the encoded "difference" with the available text commands (e.g., "put fork in dishwasher"). By focusing on the discrepancy, the agent can more effectively prioritize actions that resolve the conflict between the current state and the common sense goal.

Experimental Evaluation

We evaluated DiffG-RL using the TextWorld Commonsense (TWC) benchmark, where the agent's task is to tidy a house by placing items in their correct locations. The experiments utilized two distinct sets:

  • IN Set: Entities seen during the training phase.
  • OUT Set: Entirely new objects and locations not encountered during training.

The OUT set serves as a rigorous test of the agent's ability to generalize common sense knowledge rather than simply memorizing training data.

Results and Key Insights

DiffG-RL consistently outperformed all baselines, including those utilizing ConceptNet or naive knowledge graph integrations.

  • Superior Generalization: On the "Hard" difficulty level (involving 7 objects across 2 rooms) using the OUT set, DiffG-RL improved scores by 40% over the TWC agent-VG baseline. This suggests that the explicit modeling of "differences" allows for better adaptation to unseen scenarios.
  • Sample Efficiency: The agent demonstrated higher sample efficiency, reaching peak performance scores faster than competing models during the training process.
  • Qualitative Performance: Case studies revealed that DiffG-RL successfully navigated between multiple rooms to place items (e.g., moving slippers to a shoe cabinet in a different room), whereas baseline agents frequently succumbed to "move loops" or placed items in incorrect containers.

Discussion and Future Work

The success of DiffG-RL highlights that the "difference" is a powerful signal for RL. Simply providing common sense is insufficient; the agent requires an explicit mapping—Object -> Current Location vs. Goal Location—to provide a strong training signal. Furthermore, the use of semantic matching over simple string matching makes the agent robust to linguistic variations (e.g., recognizing that a "dirty fork" is still a "fork").

Future work will address current limitations, such as handling complex object-to-object relationships (e.g., "put the fork on the plate that is on the table") and upgrading from GloVe embeddings to modern Large Language Model (LLM) embeddings. Additionally, we aim to extend the Difference Graph to manage ambiguous common sense scenarios where multiple valid goal locations exist.

Summary updated

BibTeX
@misc{tanaka2022diffg,
  author = {Tsunehiko Tanaka and Daiki Kimura and Michiaki Tatsubori},
  title = {{DiffG-RL: Leveraging Difference between State and Common Sense}},
  year = {2022},
  eprint = {2211.16002},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.16002},
}
Figure