[Paper Review] Using reinforcement learning to learn how to play text-based games
This paper presents a reinforcement learning agent, SSAQN, that learns to play text-based games using natural language state and action descriptions. By leveraging shared text representations through an LSTM and dense layers, the agent achieves strong generalization and transfer learning across multiple games, outperforming prior models and demonstrating improved performance when training on multiple games simultaneously, including a nearly optimal reward in the complex game *Machine of Death*.
The ability to learn optimal control policies in systems where action space is defined by sentences in natural language would allow many interesting real-world applications such as automatic optimisation of dialogue systems. Text-based games with multiple endings and rewards are a promising platform for this task, since their feedback allows us to employ reinforcement learning techniques to jointly learn text representations and control policies. We present a general text game playing agent, testing its generalisation and transfer learning performance and showing its ability to play multiple games at once. We also present pyfiction, an open-source library for universal access to different text games that could, together with our agent that implements its interface, serve as a baseline for future research.
Motivation & Objective
- To develop a general-purpose reinforcement learning agent capable of learning optimal policies for playing text-based games using natural language inputs.
- To investigate the generalization and transfer learning capabilities of RL agents in the context of text-based games, which are complex sequential decision-making tasks with natural language state and action spaces.
- To create a unified, open-source interface for accessing diverse text games to enable standardized evaluation and future research in this domain.
- To evaluate whether training on multiple games simultaneously improves performance and knowledge transfer compared to individual game training.
- To assess the feasibility of using a single agent architecture to generalize across different game environments with varying linguistic and structural properties.
Proposed method
- The agent, SSAQN (Shared-Structure Actor-Critic Network), uses a shared neural network architecture with word embeddings, an LSTM layer for sequence encoding, and a dense layer for Q-value prediction.
- It employs deep Q-network (DQN) principles with experience replay and target network updates to stabilize training on text-based game environments.
- The agent processes both state and action descriptions as sequences of tokens, using shared embeddings and a joint interaction function to compute Q-values.
- The loss function is based on the temporal difference error between predicted and target Q-values, optimized via stochastic gradient descent with RMSProp.
- The agent uses epsilon-greedy exploration with a decaying epsilon schedule to balance exploration and exploitation during training.
- The pyfiction library is used as a universal interface to access and simulate various text games, enabling standardized evaluation across multiple environments.
Experimental results
Research questions
- RQ1Can a single reinforcement learning agent generalize across multiple diverse text-based games with different linguistic and structural characteristics?
- RQ2Does training on multiple games simultaneously improve performance and knowledge transfer compared to training on individual games?
- RQ3To what extent can the agent learn transferable representations of game states and actions that support generalization to unseen games?
- RQ4How does the agent's performance compare to prior work in terms of reward maximization and convergence speed?
- RQ5Can the agent achieve near-human-level performance on complex, non-deterministic games like *Machine of Death*?
Key findings
- The SSAQN agent achieved a nearly optimal average reward of 16.0 in the *Machine of Death* game, surpassing the performance of experienced human players reported in prior work.
- The agent demonstrated improved performance when trained on multiple games simultaneously, particularly in the non-deterministic *Machine of Death* game, indicating effective knowledge transfer.
- Generalization to unseen games remained difficult, even with shared representations, highlighting the sensitivity of text-based games to policy changes and the challenge of zero-shot transfer.
- The agent outperformed or matched the performance of the DRRN model from He et al. (2015) on the two games tested in that study, validating its effectiveness.
- The pyfiction library successfully enabled universal access to multiple text games, serving as a viable baseline for future research in text game RL.
- The results suggest that while current models can learn effective policies, significant challenges remain in achieving robust generalization and transfer learning across diverse text game environments.
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.