Skip to main content
QUICK REVIEW

[Paper Review] Deep Reinforcement Learning with Stacked Hierarchical Attention for Text-based Games

Yunqiu Xu, Meng Fang|arXiv (Cornell University)|Oct 22, 2020
Topic ModelingComputer Science58 references12 citations
TL;DR

This paper proposes SHA-KG, a deep reinforcement learning agent for text-based games that integrates knowledge graphs (KGs) with a stacked hierarchical attention mechanism to enable explicit, interpretable reasoning. By modeling relational and temporal awareness through sub-graphs of the KG and using multi-level attention to weigh textual observations and action history, the method achieves state-of-the-art performance on benchmark games, outperforming existing agents in both sample efficiency and final scores.

ABSTRACT

We study reinforcement learning (RL) for text-based games, which are interactive simulations in the context of natural language. While different methods have been developed to represent the environment information and language actions, existing RL agents are not empowered with any reasoning capabilities to deal with textual games. In this work, we aim to conduct explicit reasoning with knowledge graphs for decision making, so that the actions of an agent are generated and supported by an interpretable inference procedure. We propose a stacked hierarchical attention mechanism to construct an explicit representation of the reasoning process by exploiting the structure of the knowledge graph. We extensively evaluate our method on a number of man-made benchmark games, and the experimental results demonstrate that our method performs better than existing text-based agents.

Motivation & Objective

  • Address the lack of reasoning capabilities in existing reinforcement learning agents for text-based games.
  • Enable interpretable, multi-step reasoning by leveraging structured knowledge from knowledge graphs (KGs).
  • Overcome limitations of single KG representations that fail to capture relational and temporal nuances.
  • Improve multi-modal input integration (textual observations, KGs, action history) through a hierarchical attention mechanism.
  • Develop a method that supports explicit inference and decision-making grounded in knowledge, enhancing generalization and performance.

Proposed method

  • Construct dynamic sub-graphs from the knowledge graph based on semantic roles (e.g., object locations, item types, action history) to encode relational and temporal awareness.
  • Design a stacked hierarchical attention mechanism that processes inputs at two levels: (1) local attention over individual input modalities (e.g., observation, inventory, action history), and (2) global attention across modalities.
  • Use multi-head attention to compute attention weights for textual observations, KG sub-graphs, and historical actions, allowing the model to focus on relevant information.
  • Aggregate attention outputs via residual connections and layer normalization to stabilize training and improve representation learning.
  • Train the agent using deep reinforcement learning (e.g., DQN or PPO) with sparse rewards, where the policy network is conditioned on the hierarchical attention output.
  • Extract new knowledge triples from environment observations and update the KG in real time to maintain up-to-date world state representation.

Experimental results

Research questions

  • RQ1Can explicit reasoning with knowledge graphs improve performance in text-based game environments compared to standard RL agents?
  • RQ2How does hierarchical attention over multi-modal inputs (text, KG, action history) enhance decision-making in partially observable, sparse-reward settings?
  • RQ3To what extent do sub-graphs of the KG—representing different semantic roles—improve reasoning and interpretability?
  • RQ4Does the stacked attention mechanism outperform simple concatenation or attention over raw inputs in terms of sample efficiency and final score?
  • RQ5Can the model generalize across diverse, complex text-based games while maintaining interpretable inference paths?

Key findings

  • The proposed SHA-KG agent achieves state-of-the-art performance on multiple benchmark text-based games, outperforming existing learning-based agents.
  • The model demonstrates improved sample efficiency, reaching higher scores with fewer training steps compared to baseline agents like LSTM-DRQN and DRRN.
  • Attention analysis shows that the model consistently attends to relevant information—such as object locations, inventory items, and recent actions—demonstrating effective reasoning over time.
  • The use of sub-graphs from the knowledge graph enables the agent to track relational and temporal changes (e.g., object movement, item acquisition), enhancing decision accuracy.
  • The stacked hierarchical attention mechanism effectively balances multi-modal inputs, with attention weights showing meaningful distribution across observation, inventory, and action history modalities.
  • The agent successfully completes complex tasks such as combining items (e.g., putting 'multi' on 'gores') and navigating multi-step puzzles, indicating robust reasoning capability.

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.