TL;DR
This paper demonstrates that integrating pre-trained transformer-based language models (LMs) into Reinforcement Learning (RL) agents significantly improves their performance in text-based Interactive Fiction (IF) games. By leveraging the linguistic and "world-sense" priors of a fine-tuned DistilBERT model, the authors achieved new state-of-the-art results on classic titles like Zork1, proving that agents don't need to learn the basics of the world from scratch to win.
What Problem Does This Paper Address?
Reinforcement Learning agents typically struggle with text-based games (like Zork or The Hitchhiker's Guide to the Galaxy) for three main reasons:
- Sample Inefficiency: Standard RL agents start as a "blank slate," learning both the language and the game logic simultaneously. This is incredibly slow.
- Combinatorial Action Space: In text games, the number of possible text commands is effectively infinite, making it hard for an agent to "stumble" upon the right move.
- Lack of Common Sense: An agent doesn't inherently know that if it’s dark, it should turn on a lantern, or that a "jewel-encrusted egg" is likely a valuable treasure.
Existing approaches often try to build explicit Knowledge Graphs to track the state of the world, but these are complex to maintain and often fail to capture the nuance of human-written narratives.
Methods
The authors propose a framework that combines DistilBERT (a compact, efficient version of BERT) with two established RL architectures: the Deep Reinforcement Relevance Network (DRRN) and the Template-Deep Q-Network (TDQN).
The core innovation lies in the training pipeline:
- "Game Sense" Fine-tuning: Before playing the target games, the authors fine-tuned DistilBERT on the ClubFloyd dataset (human gameplay transcripts) using Masked Language Modeling (MLM). This teaches the model the specific "dialect" of interactive fiction.
- The DBERT-DRRN/TDQN Architecture: Instead of learning text embeddings from scratch, the RL agent uses the fine-tuned DistilBERT (DBERT) to encode observations and actions. These high-quality representations are then fed into GRU encoders and an MLP to estimate Q-values (the expected reward for an action).
- Frozen vs. Active: To keep the language model generalizable, the authors used a single instance of the trained DBERT and did not fine-tune it further for specific games during the RL phase.
Datasets
- ClubFloyd: A collection of human gameplay trajectories across 590 different games. It provided roughly 217,000 observation-action pairs for the initial LM fine-tuning.
- Jericho Game-Suite: A standard benchmark for RL in text games. The authors evaluated their model on 14 games from this suite, including Zork1, Inhumane, and Spellbreaker, spanning various difficulty levels.
Key Insights and Ideas
- Linguistic Priors as "World Knowledge": The most striking insight is that pre-trained LMs act as a repository of common sense. In Zork1, the DBERT-equipped agent "guessed" that the egg was important and that the lantern was necessary for survival in the dark, whereas standard agents had to die repeatedly to learn these basic facts.
- Efficiency Gains: The proposed model achieved state-of-the-art (SOTA) results using less than half the training steps required by previous baselines. This suggests that starting with a "literate" agent is far more effective than training a "illiterate" one to read while it plays.
- Semantic Transfer: The authors found that an agent trained on Zork1 could transfer some knowledge to Zork3 more effectively than a standard DRRN agent, indicating that the model is learning game semantics rather than just memorizing specific trajectories.
Key Results
- New SOTA: The DBERT-DRRN model achieved state-of-the-art results on 4 out of 14 games (Zork1, Inhumane, Snacktime, and Jewel).
- Zork1 Performance: On the iconic Zork1, the model reached a score of 44.7, outperforming the previous best model (MPRC-DQN) by 1.6 points and maintaining a much higher stability in its learning curve.
- Normalized Score: Across all games, the model achieved an average normalized score of 15.7% (where 100% is a human optimal walkthrough). While this sounds low, it was the highest among all compared baselines, including those using complex Knowledge Graphs.
Limitations and Future Work
Despite the improvements, the authors acknowledge that text-based games are far from "solved." * The Exploration Bottleneck: Even with better language understanding, agents still struggle to explore deep into games where rewards are very sparse. The average completion rate of ~16% highlights a massive "human-machine gap." * Memorization vs. Reasoning: There is a lingering suspicion that agents might still be memorizing successful paths rather than truly reasoning about the plot. * Future Directions: The authors suggest that future work should focus on curiosity-driven exploration and incorporating explicit commonsense knowledge bases to help agents understand object "affordances" (e.g., knowing that a key is for a lock).
Summary updated