[Paper Review] Inherently Explainable Reinforcement Learning in Natural Language
This paper introduces HEX-RL, an inherently explainable reinforcement learning agent for text-based games that uses a symbolic knowledge graph (KG) and hierarchical graph attention to generate both immediate, step-by-step natural language explanations and post-hoc, temporally extended explanations of long-term dependencies. The agent achieves state-of-the-art task performance while significantly outperforming baselines in explanation quality, as rated by human evaluators unfamiliar with the environment.
We focus on the task of creating a reinforcement learning agent that is inherently explainable -- with the ability to produce immediate local explanations by thinking out loud while performing a task and analyzing entire trajectories post-hoc to produce causal explanations. This Hierarchically Explainable Reinforcement Learning agent (HEX-RL), operates in Interactive Fictions, text-based game environments in which an agent perceives and acts upon the world using textual natural language. These games are usually structured as puzzles or quests with long-term dependencies in which an agent must complete a sequence of actions to succeed -- providing ideal environments in which to test an agent's ability to explain its actions. Our agent is designed to treat explainability as a first-class citizen, using an extracted symbolic knowledge graph-based state representation coupled with a Hierarchical Graph Attention mechanism that points to the facts in the internal graph representation that most influenced the choice of actions. Experiments show that this agent provides significantly improved explanations over strong baselines, as rated by human participants generally unfamiliar with the environment, while also matching state-of-the-art task performance.
Motivation & Objective
- To develop a reinforcement learning agent that is inherently explainable, producing both immediate and temporally extended natural language explanations during and after task execution.
- To address the challenge of explaining long-horizon decision-making in partially observable, language-based environments like text-based games.
- To integrate symbolic knowledge graph state representations with deep reinforcement learning to enable human-interpretable reasoning and explanation generation.
- To evaluate explanation quality using human annotators unfamiliar with the domain, ensuring explanations are intuitive and trustworthy.
- To maintain state-of-the-art task performance while significantly improving explanation quality compared to strong baselines.
Proposed method
- The agent maintains a dynamic, symbolic knowledge graph (KG) that encodes world state, including objects, locations, player inventory, and relationships, updated as the agent explores.
- A hierarchical graph attention mechanism is applied to the KG to identify sub-graphs most influential in action selection, enabling immediate, localized explanations.
- For temporally extended explanations, the agent performs post-hoc trajectory analysis to identify critical intermediate states and actions that fulfill long-term dependencies.
- The KG is encoded using a Graph Attention Network (GAT) with hierarchical attention heads that focus on different semantic sub-graphs (e.g., objects in room, player inventory, location).
- Explanations are generated by grounding action choices in specific facts from the KG, using attention weights to highlight relevant evidence.
- The framework is evaluated in Interactive Fiction environments such as zork1, using the Jericho framework for agent-environment interaction.
Experimental results
Research questions
- RQ1Can a reinforcement learning agent generate immediate, step-by-step natural language explanations that are both accurate and interpretable by humans?
- RQ2Can the same agent produce temporally extended explanations that capture long-term dependencies necessary for task completion?
- RQ3Does integrating a symbolic knowledge graph with hierarchical attention improve explanation quality compared to black-box attention mechanisms?
- RQ4Can such an inherently explainable agent maintain state-of-the-art performance in complex text-based game environments?
- RQ5Do human evaluators rate the explanations from this agent as significantly more understandable than those from strong baselines?
Key findings
- Human participants unfamiliar with the game environment rated the explanations generated by HEX-RL as significantly more comprehensible than those from strong baselines.
- The agent achieved state-of-the-art task performance on text-based games such as zork1, matching or exceeding the performance of prior knowledge graph-based agents.
- The hierarchical graph attention mechanism successfully identified relevant sub-graphs in the KG that influenced action selection, enabling precise, localized explanations.
- Post-hoc trajectory analysis enabled the generation of temporally extended explanations that condensed critical intermediate steps, highlighting dependencies such as picking up a lamp early for later use.
- The use of a symbolic, human-readable KG as the internal state representation allowed for faithful and interpretable explanation generation without sacrificing policy performance.
- The evaluation demonstrated that explainability can be built into the agent's architecture from the start, rather than added as a post-hoc layer, resulting in more reliable and trustworthy explanations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.