Text-Based Games as a Challenging Benchmark for Large Language Models

Qinyue Tan, Ashkan Kazemi, Rada MihalceaOpenReview 2023 · Submission to Tiny Papers @ ICLR

TL;DR

While Large Language Models (LLMs) have mastered many linguistic tasks, they still struggle with the complex reasoning required for interactive, text-based games (TBGs). This research demonstrates that even capable LLMs fail to compete with specialized reinforcement learning agents or humans in these environments, primarily due to deficiencies in long-term memory, goal orientation, and the ability to learn from trial and error.

Introduction

The researchers aim to determine if the impressive linguistic performance of LLMs translates into human-like reasoning and "thinking." To test this, they look toward Text-Based Games (TBGs), also known as interactive fiction.

Example interface of the text-based game 'Detective'

TBGs are unique because the entire world, the player's actions, and the feedback are delivered exclusively via natural language. Unlike a standard open-ended chatbot interaction, these games are structured puzzles. They require a player to understand an environment, remember past events, and reason through non-linear challenges to achieve a high score. The authors argue that TBGs serve as a superior benchmark for Artificial General Intelligence (AGI) because they provide clear, objective scoring metrics that are often missing in standard dialogue evaluation.

Methodology

The authors treated TBGs as a zero-shot or few-shot prompting task, evaluating how models perform "out of the box" without game-specific fine-tuning. The experimental setup involved:

  • The Loop: At each step, the game’s environment description was fed into the LLM as a prompt, followed by a specific query: "What should you do?"
  • Action Execution: The text generated by the model was then sent back to the game engine as a command.
Example of the prompt and model output loop used to play the game

They evaluated three models of varying sizes via publicly available APIs: Flan-T5 (80M), OPT (125M), and T-NLG (7B). Results were compared against RC-DQN (a state-of-the-art deep reinforcement learning agent) and human performance baselines.

The primary testbed was Detective, an "easy" game selected from the Jericho benchmark (a collection of interactive fiction environments), interfaced through the TextWorld framework. Performance was measured by the game score (maximum score of 360) over 100 trials, with a strict limit of 1,000 steps per trial.

Key Insights

The authors identified three fundamental reasons why LLMs struggle with these interactive text environments:

  1. The Learning Gap: TBGs are inherently designed for "trial and error." A player might need to try several reasonable-looking actions before finding the one that advances the plot. Because these LLMs are pre-trained and static during inference, they cannot "learn" from a failed attempt within a single game session.
  2. The Memory Bottleneck: Success in interactive fiction requires remembering details from many "scenes" ago. Most LLMs tested lacked explicit state memory and relied entirely on the current prompt. Given strict token limits, it is often impossible to feed the entire game history back into the model context.
  3. Statistical vs. Goal-Oriented Generation: LLMs are trained to predict the most likely next token based on statistical patterns. In a game, the "most likely" next sentence might be a continuation of the story's prose rather than a concise command to solve a puzzle. For example, the OPT model occasionally forgot it was a player and simply started narrating the scene further instead of issuing an actionable command.

Results

The performance gap between specialized agents and LLMs was stark:

Model Model Size Avg Score Max Score
Human Performance - - 350
RC-DQN (SOTA) - 317 -
T-NLG 7B 56 90
Flan-T5 80M 37 50
OPT 125M 10 10

Even the largest LLM tested (T-NLG) only achieved a maximum score of 90, which is less than a third of the score achieved by the specialized reinforcement learning agent (RC-DQN). The smaller OPT model barely engaged with the game mechanics at all, achieving a flat score of 10 across the board.

Limitations and Future Work

The authors acknowledge that these experiments were preliminary and focused on smaller, older models. They suggest several paths forward for future research:

  • The "Golden Prompt": The study did not exhaustively search for the perfect prompt engineering strategy that might unlock better performance.
  • Modern Models: Newer models with better instruction-following capabilities and significantly longer context windows might bridge some of this performance gap.
  • Strategy Learning: Future research should focus on how to help LLMs learn effective game-playing strategies in real-time, rather than relying solely on static pre-trained knowledge.

Summary updated

BibTeX
@misc{tan2023text,
  author = {Qinyue Tan and Ashkan Kazemi and Rada Mihalcea},
  title = {{Text-Based Games as a Challenging Benchmark for Large Language Models}},
  year = {2023},
  url = {https://openreview.net/forum?id=2g4m5S_knF},
  howpublished = {OpenReview},
  note = {Submitted to Tiny Papers @ ICLR},
}
Figure