How Can LLM Guide RL? A Value-Based Approach

Shenao Zhang, Sirui Zheng, Shuqi Ke, Zhihan Liu, Wanxin Jin, Jianbo Yuan, Yingxiang Yang, Hongxia Yang, Zhaoran Wang · DOI

Abstract

Reinforcement Learning (RL) is a powerful paradigm for learning from environmental feedback but often struggles with sample inefficiency in sparse-reward settings. Large Language Models (LLMs) offer rich world knowledge and "common sense" but are limited by hallucinations and an inability to autonomously refine strategies based on external rewards. This paper introduces a value-based framework that treats the LLM as a policy prior to regularize RL. By combining LLM-driven intuition with RL's feedback-driven learning, the proposed LINVIT and its practical variant SLINVIT achieve state-of-the-art performance and superior sample efficiency across diverse interactive benchmarks.

Introduction

The challenge of sample inefficiency in Reinforcement Learning (RL) often stems from the "cold start" problem: in complex environments, an agent may wander aimlessly before receiving any meaningful reward signal. Large Language Models (LLMs) present a potential solution by providing immediate, reasonable plans. However, LLMs are not perfect; they frequently "hallucinate" actions or fail to adapt when their initial plan fails.

Comparison of RL, LLM, and the proposed RL with LLM as a Prior approach on a household task.

As shown in the figure above, pure RL requires many random interactions to find a successful path, while a pure LLM approach might repeatedly make the same hallucination mistakes (e.g., trying to take a "towel" when the task requires a "cloth"). The proposed approach uses the LLM as a prior to jump-start the RL process, while using the RL feedback loop to correct the LLM’s errors.

Methodology

The authors propose a value-based regularization framework consisting of two main components:

1. LINVIT (Language-INtegrated Value Iteration)

LINVIT is a theoretical framework that incorporates LLM guidance as a regularization factor. Instead of solely maximizing expected rewards, the agent optimizes an objective that includes a KL-divergence penalty for deviating from the LLM's suggested policy. This ensures the agent follows "common-sense" paths unless the environment's reward signal indicates a better alternative exists.

2. SLINVIT (Simplified LINVIT)

To make the framework practical for real-world tasks, SLINVIT introduces two key optimizations:

  • Sub-goal Decomposition: Long-horizon tasks are broken down into manageable sub-problems to reduce search complexity.
  • Value Estimators: The system uses LLM-generated rule-based functions (e.g., checking preconditions in Python) and Monte-Carlo rollouts to estimate the potential of current states.

At each decision point, the agent performs a Breadth-First Search (BFS) to look ahead and select actions that maximize the combined value of environment rewards and LLM-derived potential.

Experimental Evaluation

The framework was evaluated on three distinct interactive benchmarks: ALFWorld (household tasks), InterCode (SQL & Bash coding), and BlocksWorld (classic planning).

Key Results

  • State-of-the-Art Performance: On ALFWorld, SLINVIT achieved a 97.01% success rate, significantly outperforming LLM-only methods like ReAct (61.94%) and Reflexion (92.54%).
  • Superior Sample Efficiency: In InterCode-SQL tasks, SLINVIT reached a 70.6% success rate, notably higher than ReAct (58.7%) while using the same number of environment samples.
  • Correction of Hallucinations: Qualitative analysis confirmed that the framework successfully overrides LLM hallucinations. When an LLM incorrectly identifies an object, the RL exploration mechanism allows the agent to find the correct item and complete the task where a pure LLM would fail.

Discussion and Insights

The core insight of this work is that LLMs are most effective when used as a prior rather than a primary controller. This "LLM as a Prior" approach provides a theoretical guarantee: sample complexity is proportional to the KL divergence between the LLM's policy and the optimal policy. The better the LLM's initial "hunch," the faster the RL agent learns.

However, the approach does have limitations. The use of BFS and lookahead sequences increases computational overhead and LLM query costs. Additionally, the rule-based value estimators currently require human verification of the LLM-generated code to ensure reliability.

Conclusion

By integrating LLMs as policy priors in a value-based RL framework, this research demonstrates a robust path toward more sample-efficient and reliable autonomous agents. Future work will focus on scaling these methods to continuous action spaces and reducing the computational cost of the search process.

Summary updated

BibTeX
@misc{zhang2024how,
  author = {Shenao Zhang and Sirui Zheng and Shuqi Ke and Zhihan Liu and Wanxin Jin and Jianbo Yuan and Yingxiang Yang and Hongxia Yang and Zhaoran Wang},
  title = {{How Can LLM Guide RL? A Value-Based Approach}},
  year = {2024},
  eprint = {2402.16181},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.16181},
}
Figure