Revisiting the Roles of "Text" in Text Games

Yi Gu, Shunyu Yao, Chuang Gan, Josh Tenenbaum, Mo Yu

Abstract

Text-based games present a unique challenge for reinforcement learning (RL) due to partial observability and combinatorial action spaces. This paper investigates the tension between complex natural language understanding (NLU) and simple state hashing. By introducing DRRN-LOG, the authors demonstrate that while hashing effectively manages state tracking (memorization), semantic NLU remains vital for action generalization. Their approach achieves state-of-the-art performance across several classic text adventures.

Introduction

Text-based games, such as the classic Zork series, serve as a rigorous frontier for RL agents. Unlike visual environments, these games communicate state and accept actions entirely through natural language. This medium introduces two primary hurdles: Partial Observability, where the agent must maintain a mental map of the world based on fleeting descriptions, and Combinatorial Action Spaces, where the sheer variety of possible text commands makes exhaustive exploration impossible.

A gameplay trace from a text adventure illustrating the challenges of partial observability and high-stakes decision-making in environments like Zork.

The NLU vs. Hashing Debate

Recent research has sparked a debate within the community: is sophisticated NLU necessary, or can simple "state hashes" (assigning unique IDs to text strings) suffice? While hashes are computationally efficient for identifying unique states, they lack the semantic depth required to understand that "open the wooden door" and "unlock the gate" are functionally similar. This paper seeks to reconcile these views by identifying the specific roles each technique plays in an agent's success.

Methodology: DRRN-LOG

The authors propose DRRN-LOG (Location Graph), a lightweight enhancement to the Deep Reinforcement Relevance Network (DRRN). The core innovation is a "Location Graph" that tracks:

  1. A Spatial Map: A record of adjacent rooms discovered during exploration to resolve ambiguities (e.g., distinguishing between different "Dark Places").
  2. Recent Descriptions: A memory of the most recent "look" command for every visited location.

Instead of complex graph neural networks, DRRN-LOG hashes these components into a vector to provide context. To maintain semantic intelligence, it utilizes a BiDAF (Bidirectional Attention Flow) mechanism, allowing the agent to correlate specific words in observations with potential actions.

Experimental Results

The model was evaluated on the Jericho benchmark, focusing on six games where previous state-of-the-art (SOTA) models showed significant performance gaps. DRRN-LOG improved standard DRRN scores by an average of 29%.

Performance comparison across the Jericho benchmark, showing DRRN-LOG (ours) achieving competitive results against advanced NLU models like MPRC-DQN and KG-A2C.

As shown in the results, DRRN-LOG achieved an average normalized score of 0.36, placing it ahead of KG-A2C (0.27) and closely trailing the more complex MPRC-DQN (0.41). Notably, in Zork I, the agent reached a maximum score of 107, doubling the baseline DRRN's performance.

The "Division of Labor"

The study's most significant insight is the complementary nature of hashing and NLU. Ablation studies revealed that:

  • Hashing is for Memorization: It excels at solving partial observability by helping the agent remember exactly where it is and what it has seen.
  • NLU is for Generalization: RNN-based semantic encoders are essential for navigating the massive variety of text. When semantic encoders were removed, performance plummeted, proving that hashes alone cannot guide an agent through unfamiliar text.

Conclusion

DRRN-LOG demonstrates that state-of-the-art performance in text games does not always require massive, complex NLU architectures for state tracking. Simple location-based hashing can handle the "where am I?" problem, allowing semantic models to focus on the "what should I do?" problem. While highly effective for spatial "text fictions," future work will explore how this division of labor applies to non-spatial language tasks like goal-oriented dialogue.

Summary updated

BibTeX
@inproceedings{gu2022revisiting,
  author = {Yi Gu and Shunyu Yao and Chuang Gan and Josh Tenenbaum and Mo Yu},
  title = {{Revisiting the Roles of "Text" in Text Games}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.510},
}
Figure