Manuscript Offprint

arXiv:2610.28010

RANGER: Retrieval Agent for Navigating Graphs with Semantic Evaluation Rewards

Artem Mikhaylov, Pavel Konoplev, Nikolay Efanov, Artyom Sorokin, Evgeny Burnaev

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

The integration of Large Language Models and Reinforcement Learning offers a promising direction for complex sequential decision-making tasks, such as multi-hop question answering over knowledge graphs. While LLMs provide strong semantic understanding and reasoning capabilities, they often struggle with precise, multi-step navigation in structured environments. Conversely, RL agents excel at learning navigation policies but are hindered by the difficulty of designing semantically meaningful reward functions. This paper introduces a novel hybrid approach in which an LLM serves as a mentor to an RL agent during training by providing dense, semantically informed reward signals. The RL agent, built on a Transformer-based policy and trained with Group Relative Policy Optimization, learns to navigate a knowledge graph to retrieve relevant information. The LLM evaluates the semantic relevance of the agent's traversed paths, generating reward signals that align the agent's behavior with the information needs expressed in a query. We integrate this Retrieval Agent for Navigating Graphs with Semantic Evaluation Rewards (RANGER) into a complete question-answering pipeline and evaluate it on the open question answering datasets. Experimental results show that the proposed approach outperforms both a baseline retrieval-augmented system with classical graph search and one using an RL agent trained with heuristic rewards, achieving a significant increase in NLP metrics and LLM-as-a-Judge scores. Our findings demonstrate that deep integration of LLMs into the RL training loop yields more effective and semantically aligned retrieval policies for complex reasoning tasks.

INDEX TERMS Graph traversal, knowledge graphs, LLM-as-a-Mentor, LLM-based reward, multi-hop question answering, reinforcement learning, self-supervision, semantic feedback, transformer policy.

I. INTRODUCTION

Recent progress in Large Language Models (LLMs) has precipitated a substantial increase in their functional capacities, facilitating their deployment in complex task execution and their role as the core reasoning engines for autonomous agents operating [1]. Despite their remarkable semantic understanding and planning abilities, LLM-based agents often struggle with tasks that require precise multi-step navigation within structured complex environments [2], [3], especially in Knowledge Graphs (KGs), where the combinatorial explosion of possible paths and the need for long-term, goal-oriented exploration pose significant challenges for purely LLM-driven approaches, which are often not optimized for sequential decision-making in such discrete, dynamic spaces. Furthermore, they can be computationally expensive and prone to hallucinations when tasked with exhaustive exploration [2], [3].

However, Reinforcement Learning (RL) provides a powerful paradigm for learning optimal decision-making policies through interaction with an environment. RL agents show promising results in tasks involving sequential information search [4], [5] and can, in principle, learn to traverse a KG to find relevant information [6], [7]. However, traditional RL faces its own set of formidable challenges: difficulty in credit assignment over long trajectories, and the laborious, often heuristic-driven process of reward function

SEARCH QUERY

{eq=EIFFEL TOWER,rq=LOCATED_IN,}\left\{e_{q} = \text{EIFFEL TOWER}, r_{q} = \text{LOCATED\_IN},\right\}

TARGET

{ea=PARIS}\left\{e_{a} = \text{PARIS}\right\}

REWARDS

PATHS

FOUND

BY THE

SEARCH

AGENT

Figure

LLMH
+1.0+1.0
+0.5+1.0
0.0+1.0

FIGURE 1: Comparison of heuristic and LLM-based rewards for paths in knowledge graphs. In this example the question is formed from the triplet (eq=Eiffel Tower,rq=located_in,ea=Paris)(e_q = \text{Eiffel Tower}, r_q = \text{located\_in}, e_a = \text{Paris}) . Given (eq,rq)(e_q, r_q) , the agent must restore the initial triplet (direct rqr_q transition is masked out in the KG). The procedural heuristic (H) assigns the same reward to every path that reaches eae_a , regardless of whether the intermediate triples provide evidence for the original question. In contrast, the LLM-based reward (LLM) evaluates whether the discovered path supports reconstructing the original triplet: paths that justify the triplet receive a high reward, while indirect or irrelevant paths receive lower rewards.

design [2], [3]. Crafting a reward function that captures not only structural correctness but also the semantic relevance of a discovered path to a user's query is particularly complex.

Recognizing the complementary strengths of these two approaches, this paper explores a novel hybrid architecture that synergistically integrates LLMs and RL. We posit that an LLM can act as a powerful “mentor” to an RL agent, guiding its learning process and providing semantic feedback that transcends simple structural heuristics. This integration aims to overcome the limitations of each method in isolation: the LLM provides high-level semantic understanding and a dense, meaningful reward signal, while the RL agent learns a robust and adaptive policy for navigating the structured environment.

In this work, we focus on the challenging task of multi-hop question answering over knowledge graphs. We present a Retrieval Agent for Navigating Graphs with Semantic Evaluation Rewards (RANGER) in which an RL agent, based on transformer architecture and trained with Group Relative Policy Optimization (GRPO), learns to navigate a KG to retrieve information relevant to a user's query.

The main research questions addressed are whether a learned traversal policy can improve the quality of retrieved information compared to classical rule-based search procedures, and whether reward signals produced by an LLM can guide the agent more effectively than rewards based on predefined structural criteria. We also examine how capable the mentor LLM needs to be in order for its feedback to provide an advantage over heuristic rewards.

The key contributions of our work are as follows:

  1. LLM-as-a-Mentor for Reward Shaping: we move beyond simple heuristic-based rewards and employ an LLM to dynamically evaluate the semantic relevance of the path discovered by the RL agent. This LLM-generated reward provides a context-aware learning signal, directly aligning the agent's navigation policy with the information need expressed in the query.

The principle behind this distinction is illustrated in Figure 1.

  1. Self-Supervised Training from the Knowledge Graph: we demonstrate that effective training of the RL agent can be achieved by automatically generating question-answer pairs directly from the knowledge graph itself. This self-supervised approach reduces reliance on manually annotated datasets and yields a policy that can be used in QA systems for answering complex compositional questions.

  2. Integrated Retrieval Pipeline: we detail the design and implementation of a complete pipeline that integrates our LLM-mentored RL agent as a knowledge retriever within a broader question-answering system. The agent's learned policy guides the extraction of relevant triplets from the KG, which are then used by a separate LLM to generate the final answer.

  3. Empirical Evaluation and Ablation Studies: we compare RANGER with non-parametric graph traversal algorithms and conduct ablation studies to evaluate the effect of the reward design on downstream QA performance. In particular, we compare the proposed LLM-based reward with a procedural heuristic reward often used in prior KG traversal methods. Our results demonstrate a clear improvement, with RANGER achieving the highest scores across the majority of metrics, including a significant improvement in the LLM-as-a-Judge score.

Our findings underscore the potential of hybrid AI systems in which LLMs and RL agents are not merely combined, but are deeply integrated in a synergistic fashion. Using the semantic prowess of LLMs to shape the learning objective of an RL agent, we can create more effective, adaptable, and intelligent systems for complex information retrieval and reasoning tasks.

References (36)