Go for a Walk and Arrive at the Answer: Reasoning Over Paths in Knowledge Bases using Reinforcement Learning

Rajarshi Das, Shehzaad Dhuliawala, Manzil Zaheer, Luke Vilnis, Ishan Durugkar, Akshay Krishnamurthy, Alexander J. Smola, Andrew McCallum

Abstract

Knowledge Bases (KBs) are essential for many AI tasks but are often incomplete. Traditional methods for link prediction either rely on opaque embedding-based models or path-based models that require pre-defined rules or start-end pairs. We present MINERVA, a reinforcement learning agent that learns to answer queries by navigating a knowledge graph. By "walking" from a source entity to a predicted destination, MINERVA provides interpretable reasoning paths and achieves state-of-the-art performance on large-scale benchmarks without the need for exhaustive entity ranking.

Introduction

Knowledge Bases like Freebase and NELL store vast amounts of factual information, yet they remain incomplete. Filling these gaps is typically approached via embedding-based models, which map entities to high-dimensional vectors, or path-based models, which look for relational chains. While embeddings are powerful, they lack interpretability. Conversely, traditional path-based methods often struggle with scalability or require knowing both endpoints of a relation.

MINERVA (Meandering In Networks of Entities to Reach Verisimilar Answers) addresses the query answering problem: given a starting entity and a relation (e.g., “Who did Malala Yousafzai share her Nobel Peace Prize with?”), how can an agent efficiently find the unknown target entity in a graph containing millions of nodes?

Methods

MINERVA frames query answering as a Reinforcement Learning (RL) problem within a partially observed Markov Decision Process (MDP).

An example of a knowledge graph where an agent can navigate paths to answer queries like "Who shared a Nobel Prize with Malala Yousafzai?".

The agent starts at a source node and observes its immediate neighborhood. At each step, it selects an outgoing edge to follow, guided by an LSTM (Long Short-Term Memory) policy that maintains a history of the path taken. This history is vital for multi-hop reasoning. The agent can also choose a "NO_OP" action to terminate the walk if it believes it has reached the target. Training is conducted using the REINFORCE algorithm, rewarding the agent only if it arrives at the correct entity. To encourage exploration, the authors employ entropy regularization.

Datasets

The model was evaluated across seven datasets of varying scale and complexity, ranging from small synthetic tasks to massive real-world graphs.

Summary of the seven datasets used for evaluation, showing the number of entities, relations, facts, and queries.

The benchmarks include:

  • Small/Synthetic: COUNTRIES (testing logical rules), UMLS (biomedical), and KINSHIP.
  • Large-scale: WN18RR (WordNet), NELL-995, and FB15K-237 (Freebase).
  • Natural Language: WikiMovies, where queries are provided as partially structured text rather than formal triples.

Key Results and Insights

  • Efficiency through Local Search: Unlike embedding models that must rank every single entity in the KB to answer a query, MINERVA only explores a small neighborhood around the source entity. This makes it significantly faster; for instance, inference on WN18RR took 63 seconds compared to 211 seconds for a GPU-optimized implementation of DistMult.
  • Interpretable Provenance: Because the agent literally "walks" to the answer, the path it takes serves as an explanation. To find a person's nationality, the agent might walk through their birthplace and the country that city belongs to.
  • Competitive Performance: MINERVA matched or outperformed state-of-the-art embedding models like ConvE and DistMult on several benchmarks. It showed particular strength on complex multi-hop reasoning tasks in the COUNTRIES dataset.
  • Robustness: In synthetic grid-world tests, MINERVA proved much more robust than competing models as the required path length increased, showing minimal degradation even on long reasoning chains.

Conclusion

MINERVA demonstrates that RL agents can effectively navigate large-scale KBs to provide accurate and interpretable answers. While it faces challenges with 1-to-many relations—where multiple valid answers exist but only one is rewarded—it represents a significant step toward transparent and efficient knowledge base reasoning. Future work will explore more advanced RL techniques and direct operation on natural language queries and documents.

Summary updated

BibTeX
@inproceedings{das2018go,
  author = {Rajarshi Das and Shehzaad Dhuliawala and Manzil Zaheer and Luke Vilnis and Ishan Durugkar and Akshay Krishnamurthy and Alexander J. Smola and Andrew McCallum},
  title = {{Go for a Walk and Arrive at the Answer: Reasoning Over Paths in Knowledge Bases using Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=Syg-YfWCW},
}
Figure