Skip to main content
QUICK REVIEW

[Paper Review] Dialogue Shaping: Empowering Agents through NPC Interaction

Wei Zhou, Xiangyu Peng|arXiv (Cornell University)|Jul 28, 2023
Topic ModelingComputer Science4 citations
TL;DR

This paper proposes Dialogue Shaping, a framework that uses large language models (LLMs) to converse with non-player characters (NPCs) in text-based games, extract key game knowledge, and convert it into knowledge graphs to accelerate reinforcement learning (RL) agent training via Story Shaping. The method reduces RL convergence time by over 80% compared to baseline agents, with agents reaching optimal policies in ~10,000 steps versus ~90,000 steps in the baseline.

ABSTRACT

One major challenge in reinforcement learning (RL) is the large amount of steps for the RL agent needs to converge in the training process and learn the optimal policy, especially in text-based game environments where the action space is extensive. However, non-player characters (NPCs) sometimes hold some key information about the game, which can potentially help to train RL agents faster. Thus, this paper explores how to interact and converse with NPC agents to get the key information using large language models (LLMs), as well as incorporate this information to speed up RL agent's training using knowledge graphs (KGs) and Story Shaping.

Motivation & Objective

  • To address the slow convergence of reinforcement learning (RL) agents in text-based games due to vast action spaces and sparse rewards.
  • To explore whether conversational interaction with NPCs can extract actionable game knowledge to guide RL agents more efficiently.
  • To integrate LLM-derived knowledge into RL training through knowledge graphs and Story Shaping to accelerate policy learning.
  • To evaluate whether dialogue-based information retrieval improves RL agent performance and sample efficiency in text adventure environments.

Proposed method

  • Use a fine-tuned LLM as a dialogue agent to interact with an NPC in a text-based game, asking structured questions to extract game-relevant knowledge.
  • Construct a target knowledge graph (KG) from the LLM’s dialogue responses, filtering for agent-centric actions (subjects with 'you') to represent goal prerequisites.
  • Apply Story Shaping to provide an auxiliary reward signal to the RL agent based on the overlap between its internal KG and the target KG.
  • Train a KGA2C agent using both the environment’s sparse reward and the KG-based reward signal to guide policy learning.
  • Use the LIGHT framework to create custom text adventure games with defined win conditions and structured game states.
  • Evaluate performance using average test scores over 50 episodes at regular intervals during 100,000 training steps.

Experimental results

Research questions

  • RQ1Can LLM-powered dialogue with NPCs reliably extract key game knowledge that accelerates RL agent training?
  • RQ2How effective is knowledge graph representation of NPC dialogue in guiding RL agents toward optimal policies?
  • RQ3To what extent does Story Shaping with LLM-derived knowledge graphs reduce the number of training steps required for RL convergence?
  • RQ4Does the dialogue-based knowledge retrieval method outperform standard RL agents in sample efficiency and performance consistency?

Key findings

  • The Story Shaping agent with LLM-derived knowledge graphs converged to the optimal policy in approximately 10,000 training steps, compared to 90,000 steps for the baseline agent in Game 1.
  • The average test score of the Story Shaping agent consistently outperformed the baseline across all training steps, with non-overlapping standard deviation ranges.
  • The method reduced the required training steps by over 80%, demonstrating a significant improvement in sample efficiency.
  • The LLM dialogue agent successfully retrieved accurate game information, including object dependencies and goal prerequisites, with minimal hallucination when prompted with structured question templates.
  • The target knowledge graph generated from dialogue provided a reliable and effective auxiliary reward signal that guided the RL agent toward the optimal policy.
  • The framework demonstrated robustness across multiple text-based games, with consistent performance gains in all evaluated 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.