[Paper Review] Keep CALM and Explore: Language Models for Action Generation in Text-based Games
This paper introduces the Contextual Action Language Model (CALM), a language model trained on human gameplay transcripts to generate a compact, semantically relevant set of action candidates in text-based games. By combining CALM with a reinforcement learning agent (DRRN), the method achieves a 69% relative improvement in average score over prior state-of-the-art models on the Jericho benchmark, even outperforming models with access to ground-truth admissible actions on several games.
Text-based games present a unique challenge for autonomous agents to operate in natural language and handle enormous action spaces. In this paper, we propose the Contextual Action Language Model (CALM) to generate a compact set of action candidates at each game state. Our key insight is to train language models on human gameplay, where people demonstrate linguistic priors and a general game sense for promising actions conditioned on game history. We combine CALM with a reinforcement learning agent which re-ranks the generated action candidates to maximize in-game rewards. We evaluate our approach using the Jericho benchmark, on games unseen by CALM during training. Our method obtains a 69% relative improvement in average game score over the previous state-of-the-art model. Surprisingly, on half of these games, CALM is competitive with or better than other models that have access to ground truth admissible actions. Code and data are available at https://github.com/princeton-nlp/calm-textgame.
Motivation & Objective
- To address the challenge of combinatorially large action spaces in text-based games, where only a small fraction of actions are admissible.
- To incorporate linguistic priors and human game sense into action generation without relying on handcrafted rules or ground-truth action sets.
- To improve reinforcement learning agents' sample efficiency and performance by filtering the action space using a context-aware language model.
- To demonstrate generalization of a single CALM model across diverse, unseen text-based games.
Proposed method
- Train a language model (n-gram or GPT-2) on 426 human gameplay transcripts from 590 different text-based games to learn contextual action generation.
- Use the trained CALM to generate a top-K list of action candidates at each game state, conditioned on the current observation and game history.
- Integrate CALM with a Deep Reinforcement Relevance Network (DRRN) that re-ranks the generated actions based on predicted Q-values and in-game rewards.
- Train the DRRN end-to-end using game rewards, while keeping CALM fixed after pre-training on human data.
- Deploy a single CALM instance across multiple games without fine-tuning, ensuring zero-shot generalization to evaluation games.
- Evaluate action quality using both isolated generation (vs. ground-truth admissible actions) and end-to-end RL performance on the Jericho benchmark.
Experimental results
Research questions
- RQ1Can a language model trained on human gameplay transcripts generate semantically relevant and admissible action candidates in diverse text-based games?
- RQ2Does combining a contextual language model with a reinforcement learning agent improve performance compared to prior methods without access to ground-truth action sets?
- RQ3To what extent can a single CALM model generalize across unseen text-based games without fine-tuning?
- RQ4Can CALM-generated action candidates outperform models that have access to ground-truth admissible actions in certain scenarios?
Key findings
- The CALM + DRRN method achieves a 69% relative improvement in average normalized score over the previous state-of-the-art model on the Jericho benchmark.
- On 8 out of 28 evaluation games, CALM outperforms models that have access to ground-truth admissible actions, including a 25.7 score on the game 'inhumane' compared to 3 for the prior SOTA.
- The GPT-2 variant of CALM generates more semantically coherent and contextually relevant actions than the n-gram baseline, as shown in qualitative examples involving object interactions and commonsense actions.
- In isolation, CALM (GPT-2) generates action candidates that are highly aligned with ground-truth admissible actions, demonstrating strong linguistic and game-sense priors.
- The method generalizes effectively across diverse game environments, with a single CALM model deployed across all 28 evaluation games without any game-specific adaptation.
- The approach shows that human gameplay data can effectively distill linguistic and strategic priors into a compact, reusable action generation mechanism for text-based game agents.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.