Skip to main content
QUICK REVIEW

[Paper Review] Pre-trained Language Models as Prior Knowledge for Playing Text-based Games

Ishika Singh, Gargi Singh|arXiv (Cornell University)|Jul 18, 2021
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes a reinforcement learning framework that leverages pre-trained language models (PLMs) as prior knowledge to enhance semantic understanding in text-based game agents. By fine-tuning BERT-based representations within a deep Q-network, the method achieves a new state-of-the-art score of 44.7 on Zork1—1.6 points higher than prior work—demonstrating improved reasoning and sample efficiency in partially observable, natural language environments.

ABSTRACT

Recently, text world games have been proposed to enable artificial agents to understand and reason about real-world scenarios. These text-based games are challenging for artificial agents, as it requires an understanding of and interaction using natural language in a partially observable environment. Agents observe the environment via textual descriptions designed to be challenging enough for even human players. Past approaches have not paid enough attention to the language understanding capability of the proposed agents. Typically, these approaches train from scratch, an agent that learns both textual representations and the gameplay online during training using a temporal loss function. Given the sample-inefficiency of RL approaches, it is inefficient to learn rich enough textual representations to be able to understand and reason using the textual observation in such a complicated game environment setting. In this paper, we improve the semantic understanding of the agent by proposing a simple RL with LM framework where we use transformer-based language models with Deep RL models. We perform a detailed study of our framework to demonstrate how our model outperforms all existing agents on the popular game, Zork1, to achieve a score of 44.7, which is 1.6 higher than the state-of-the-art model. Overall, our proposed approach outperforms 4 games out of the 14 text-based games, while performing comparable to the state-of-the-art models on the remaining games.

Motivation & Objective

  • Address the sample inefficiency and poor semantic understanding in reinforcement learning agents trained from scratch in text-based games.
  • Overcome the limitations of online RL in learning rich textual representations solely from game-generated observations.
  • Integrate pre-trained language models as prior knowledge to improve policy learning and decision-making in partially observable, natural language environments.
  • Demonstrate that leveraging pre-trained representations leads to better generalization and performance across diverse text-based games.
  • Reduce reliance on hand-designed reward functions by enabling agents to learn from natural language descriptions and implicit cues in the environment.

Proposed method

  • Fine-tune a pre-trained BERT-based language model on game-specific textual observations to extract semantically rich state representations.
  • Integrate the PLM encoder into a deep Q-network (DQN) architecture to produce action-value predictions based on contextualized embeddings.
  • Use a standard deep reinforcement learning objective with a temporal difference loss function to train the policy end-to-end.
  • Apply curriculum learning and exploration strategies to improve sample efficiency during training.
  • Maintain the same action space and environment interface as prior work, ensuring fair comparison across baselines.
  • Train the agent using only sparse rewards from the game environment, without access to ground-truth goal or reward shaping.

Experimental results

Research questions

  • RQ1Can pre-trained language models serve as effective prior knowledge to improve semantic understanding in text-based game agents?
  • RQ2Does integrating PLMs into a deep RL framework lead to higher sample efficiency and better performance compared to training from scratch?
  • RQ3How does the proposed method compare to state-of-the-art agents in terms of final game scores and generalization across multiple games?
  • RQ4Can the agent learn to extract and utilize implicit cues (e.g., object interactions, environmental descriptions) more effectively using pre-trained representations?
  • RQ5Does the use of PLMs reduce the need for complex reward shaping or curriculum design in text-based game environments?

Key findings

  • The proposed DBERT-DRRN model achieves a game score of 44.7 on Zork1, setting a new state-of-the-art, which is 1.6 points higher than the previous best model.
  • The model outperforms existing agents on 4 out of 14 standard text-based games, demonstrating broader effectiveness beyond a single environment.
  • The integration of pre-trained language models significantly improves the agent's ability to interpret complex textual descriptions and extract relevant cues for action selection.
  • The agent demonstrates improved reasoning in challenging scenarios, such as correctly using the lantern and egg in dark rooms, as shown in the gameplay trace.
  • The model maintains strong performance on remaining games, matching or closely approaching state-of-the-art results, indicating robustness and generalization.
  • The results confirm that pre-trained language models provide strong inductive bias that enhances learning efficiency and final performance in partially observable, natural language environments.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.