Table of Contents
Fetching ...

Learning to Play Like Humans: A Framework for LLM Adaptation in Interactive Fiction Games

Jinming Zhang, Yunfei Long

TL;DR

This work presents a cognitively inspired framework that guides Large Language Models (LLMs) to learn and play IF games systematically, offering a new path toward robust, context-aware gameplay in complex text-based environments.

Abstract

Interactive Fiction games (IF games) are where players interact through natural language commands. While recent advances in Artificial Intelligence agents have reignited interest in IF games as a domain for studying decision-making, existing approaches prioritize task-specific performance metrics over human-like comprehension of narrative context and gameplay logic. This work presents a cognitively inspired framework that guides Large Language Models (LLMs) to learn and play IF games systematically. Our proposed **L**earning to **P**lay **L**ike **H**umans (LPLH) framework integrates three key components: (1) structured map building to capture spatial and narrative relationships, (2) action learning to identify context-appropriate commands, and (3) feedback-driven experience analysis to refine decision-making over time. By aligning LLMs-based agents' behavior with narrative intent and commonsense constraints, LPLH moves beyond purely exploratory strategies to deliver more interpretable, human-like performance. Crucially, this approach draws on cognitive science principles to more closely simulate how human players read, interpret, and respond within narrative worlds. As a result, LPLH reframes the IF games challenge as a learning problem for LLMs-based agents, offering a new path toward robust, context-aware gameplay in complex text-based environments.

Learning to Play Like Humans: A Framework for LLM Adaptation in Interactive Fiction Games

TL;DR

This work presents a cognitively inspired framework that guides Large Language Models (LLMs) to learn and play IF games systematically, offering a new path toward robust, context-aware gameplay in complex text-based environments.

Abstract

Interactive Fiction games (IF games) are where players interact through natural language commands. While recent advances in Artificial Intelligence agents have reignited interest in IF games as a domain for studying decision-making, existing approaches prioritize task-specific performance metrics over human-like comprehension of narrative context and gameplay logic. This work presents a cognitively inspired framework that guides Large Language Models (LLMs) to learn and play IF games systematically. Our proposed **L**earning to **P**lay **L**ike **H**umans (LPLH) framework integrates three key components: (1) structured map building to capture spatial and narrative relationships, (2) action learning to identify context-appropriate commands, and (3) feedback-driven experience analysis to refine decision-making over time. By aligning LLMs-based agents' behavior with narrative intent and commonsense constraints, LPLH moves beyond purely exploratory strategies to deliver more interpretable, human-like performance. Crucially, this approach draws on cognitive science principles to more closely simulate how human players read, interpret, and respond within narrative worlds. As a result, LPLH reframes the IF games challenge as a learning problem for LLMs-based agents, offering a new path toward robust, context-aware gameplay in complex text-based environments.
Paper Structure (26 sections, 6 equations, 3 figures, 9 tables)

This paper contains 26 sections, 6 equations, 3 figures, 9 tables.

Figures (3)

  • Figure 1: Example of RL approach, the basic LLM approach, and our LPLH approach
  • Figure 2: LPLH Framework. The Dynamic KG-map incrementally constructs a knowledge graph from observed items. The Action Space separates valid actions into verb-object pairs for efficient generation. The Experience Lib captures and summarizes key steps as reusable experiences to guide future decisions.
  • Figure 3: Zork1 learning curve in scaled steps. For reference, human player's best trajectory gets 350 scores in 412 steps with 48 verbs, 57 objects (total 105 unique words), and 63 rooms.