Introduction
Text-based games, such as the classic Zork series, represent a unique frontier for reinforcement learning (RL). These environments are modeled as Partially Observable Markov Decision Processes (POMDPs), where an agent receives textual descriptions of its surroundings rather than a complete state vector. To succeed, an agent must solve two distinct problems: it must maintain a memory of the world to overcome partial observability, and it must navigate a combinatorially large action space where many different text strings (e.g., "take sword" and "pick up blade") represent the same underlying intent.
In recent years, the research community has been divided on the role of Natural Language Understanding (NLU) in these games. One school of thought advocates for complex semantic machinery—such as knowledge graphs and reading comprehension models—to track state. Conversely, recent findings suggest that simple non-semantic "hashing" of text observations into unique identifiers can be surprisingly effective for state tracking. This paper reconciles these views, demonstrating that while hashing excels at state memorization, semantic encoders remain essential for action generalization.
Methodology: The DRRN-LOG Framework
To investigate the interplay between semantic and non-semantic representations, the authors introduce DRRN-LOG (LocationGraph), a modular enhancement to the standard Deep Reinforcement Relevance Network (DRRN). The framework introduces three primary innovations:
1. Location Mapping and Contextual Memory
To address partial observability, DRRN-LOG maintains a "LocationGraph." This graph tracks adjacent rooms by exploring the environment with a limited depth. This allows the agent to distinguish between rooms with identical names—a common challenge in complex game maps. Furthermore, the agent maintains a contextual memory that stores the most recent description of every visited location, providing a "global" view of the world state that persists even when the agent moves between rooms.
2. Hybrid State Representation
The model utilizes a hybrid approach to state representation. It combines non-semantic hashes of the location map and room descriptions (to ensure precise state identification) with semantic embeddings generated by a Gated Recurrent Unit (GRU). This dual-pathway allows the model to benefit from the precision of hashing and the flexibility of NLU.
3. BiDAF Action Encoding
To better match long text observations with potential actions, the authors incorporate a Bidirectional Attention Flow (BiDAF) mechanism. This attention layer helps the agent focus on relevant parts of the observation when evaluating which action to take, effectively filtering the noise inherent in long-form text descriptions.
Experimental Evaluation
The authors evaluated DRRN-LOG using the Jericho benchmark, focusing on six games known for their high degree of partial observability: Zork I, Zork III, Pentari, Detective, Ludicorp, and Inhumane.
Key Findings
- The Complementary Nature of Text: The research reveals that semantics and hashing solve different problems. Hashing is superior for "memorizing" the map and tracking the agent's exact location (solving the POMDP), while semantic RNNs are required to understand the relationship between different text-based actions (solving the action space problem).
- Performance Gains: DRRN-LOG achieved a 29% improvement in scores across the test suite compared to the standard DRRN baseline. It also proved highly competitive with state-of-the-art models, achieving the second-best average normalized score (36%) and outperforming Knowledge Graph-based agents (KG-A2C) in four out of six games.
- The Necessity of Semantics: In an ablation study where RNN encoders were removed, performance dropped to approximately 58% of the full model's score. This confirms that while hashing is powerful for navigation, it cannot replace the need for language understanding in action selection.
- Near-Optimal State Tracking: When compared to an "Oracle" version of the model using ground-truth state data from the game engine, DRRN-LOG performed almost identically. This suggests that the proposed hashing and mapping scheme is nearly optimal for distinguishing states in these environments.
Conclusion and Future Work
This study clarifies the roles of text in RL for text games. By decoupling state tracking (via hashing) from action generalization (via semantics), the authors provide a blueprint for more efficient and capable agents. While the LocationGraph approach is currently optimized for navigation-heavy adventure games, future work may extend these hybrid representations to more abstract domains, such as goal-oriented dialogue systems or complex closed-domain question answering. The results suggest that the most effective NLU agents are those that know when to understand the meaning of words and when to simply remember them.
Summary updated