Introduction
In the field of Reinforcement Learning (RL), text-based games represent a unique challenge for natural language understanding and decision-making. Unlike traditional video games where agents process pixel data, text-based agents must interpret descriptive strings—such as "You see a dirty plate and a red apple on the table"—and generate appropriate commands like "put the red apple in the fridge." A primary limitation of current agents is their lack of "common sense," leading them to explore thousands of illogical actions before finding a solution.
To address this, researchers from IBM, ETH Zurich, and other institutions have introduced TextWorld Commonsense (TWC), a benchmark designed to evaluate an agent's ability to use everyday knowledge to tidy a virtual house. Alongside this benchmark, they propose a novel agent architecture that integrates external knowledge from ConceptNet to prune nonsensical actions.
Methodology: Integrating Commonsense Knowledge
The core innovation of this work is treating common sense as a dynamic retrieval and integration problem. Rather than relying solely on trial and error, the agent leverages a structured knowledge base to navigate the environment more like a human.
Dynamic Subgraph Extraction
Instead of processing the entirety of ConceptNet, the agent identifies key entities (noun chunks) in its current observation. It then queries the knowledge base to find the shortest paths between these objects and potential target locations. For instance, identifying an "apple" might trigger a retrieval of the relationship Apple -> AtLocation -> Fridge.
Agent Architecture and Co-Attention
The agent's architecture is designed to fuse textual observations with structured knowledge dynamically.
As shown in the architecture diagram, the system employs several key components:
- Observation and Action Encoders: These use Gated Recurrent Units (GRUs) to process the text of the room description and the list of available actions.
- Knowledge Integration via Co-Attention: A co-attention mechanism allows the agent to simultaneously process the text context and the retrieved commonsense graph encoding. This ensures the agent re-contextualizes the room description based on the facts it has retrieved.
- Action Selector: The final decision is made by a fully connected layer and a Softmax function, which scores actions based on the combined context of the environment and external knowledge.
The TWC Benchmark and Results
The TextWorld Commonsense (TWC) environment consists of a house with eight rooms and over 900 entities. The primary objective is to "tidy up" by placing objects in their logically correct locations. To ensure the benchmark wasn't biased toward ConceptNet, the researchers pulled object/location pairs from independent sources like the 7ESL Picture Dictionary.
The researchers compared their commonsense-infused agents against state-of-the-art text-only baselines, such as DRRN and KG-A2C. The results demonstrated significant improvements:
- Performance: In "Medium" difficulty scenarios, the commonsense agent achieved a normalized score of 0.87, significantly outperforming the 0.72 achieved by the best text-only baseline.
- Efficiency: The integration of common sense allowed the agent to solve tasks in approximately 25 steps, whereas text-only agents required 37 steps.
- Generalization: The agent showed superior performance on "Out-of-Distribution" tasks involving unseen objects, as it could query ConceptNet for new entities in real-time.
Conclusion and Future Directions
The study highlights that the primary benefit of common sense in RL is its ability to act as a filter, pruning the vast action space of text games. However, challenges remain; all agents struggled with "Hard" difficulty levels involving multiple rooms, indicating that long-term spatial planning is still a significant hurdle. Future research may focus on using common sense for "look-ahead" planning to predict environmental changes before actions are taken.
Summary updated