Goal-Guided Efficient Exploration via Large Language Model in Reinforcement Learning

Yajie Qi, Wei Wei, Lin Li, Lijun Zhang, Zhidong Gao, Da Wang, Huizhong Song · DOI

Abstract

Reinforcement Learning (RL) agents often struggle in open-world environments characterized by sparse rewards and complex task hierarchies. While Large Language Models (LLMs) offer a potential solution for high-level reasoning, their direct integration into RL loops is often hindered by high latency and semantic gaps. We present the Structured Goal-guided Reinforcement Learning (SGRL) framework, which utilizes LLMs as "software architects" to generate reusable Python code for goal planning and action pruning. This approach significantly enhances exploration efficiency and achievement depth in benchmarks like Crafter and Craftax-Classic while maintaining high computational performance.

Introduction

Traditional RL has achieved remarkable success in closed-loop games, yet "open-world" environments like Minecraft present unique challenges. These domains require long-horizon planning and hierarchical task completion—for instance, mining diamonds necessitates a sequence of crafting wooden, stone, and iron tools. Existing LLM-based RL methods typically suffer from two primary issues: extreme computational overhead due to frequent API calls and "policy rigidity," where agents fail to adapt when high-level linguistic goals do not align perfectly with low-level motor requirements.

Methodology

The SGRL framework addresses these challenges by decoupling LLM reasoning from the high-frequency RL execution loop through two primary components.

Structured Goal Planner

Instead of querying an LLM at every timestep, SGRL prompts the LLM to generate a reusable Python function. This function, the PriGoal class, processes environment observations to output a prioritized list of goals. The LLM only "refactors" this code at long intervals (e.g., every 2 million steps), which drastically reduces API costs and latency compared to step-by-step prompting.

Goal-Conditioned Action Pruner

To narrow the search space, the LLM identifies actions relevant to specific goals (e.g., masking "Attack" when the goal is "Sleep"). This is managed via a Goal-Action Mask Bank. To prevent the agent from being overly constrained by initial LLM priors, SGRL employs a three-phase cosine annealing schedule. This schedule transitions from strict masking to relaxed masking, allowing the agent to discover environment-specific nuances and refine its policy beyond the LLM's initial common-sense priors.

The SGRL framework overview, illustrating (a) the Structured Goal Planner, (b) the Goal-Conditioned Action Pruner, and (c) the overall interaction with the RL agent and environment.

Experimental Setup

SGRL was evaluated on two challenging open-world benchmarks:

  • Crafter: A 2D survival game where agents must unlock 22 distinct achievements.
  • Craftax-Classic: A high-performance, JAX-based reimplementation of Crafter that allows for significantly faster experimentation.

Results and Discussion

SGRL demonstrates superior performance in both success rates and exploration depth compared to standard PPO and other LLM-enhanced methods like ELLM and AdaRefiner.

Achievement Depth and Success Rate

On Craftax-Classic, SGRL achieved a total score of 33.8%, significantly outperforming PPO (24.8%). Notably, SGRL was the only method capable of unlocking the "Collect Diamond" achievement (Depth 8) within a 5M step budget, whereas baselines typically plateaued at earlier stages (Depth 6 or 7).

Success rates across various hierarchical tasks. SGRL (labeled as CodeGoal in the plots) consistently reaches higher success rates faster than baselines like PPO, ELLM, and AdaRefiner.

Computational Efficiency

By utilizing reusable code, SGRL maintains a training speed of $18.5 \times 10^2$ Steps Per Second (SPS). In contrast, methods like AdaRefiner, which rely on frequent LLM calls, operate at only $0.3 \times 10^2$ SPS due to the bottleneck of API latency.

Conclusion

The SGRL framework highlights the power of using LLMs as code generators rather than step-by-step controllers. By providing structured, executable guidance that the RL agent can query locally, SGRL bridges the gap between high-level reasoning and efficient low-level exploration. Future work will explore dynamic action pruning and scaling these techniques to complex 3D environments.

Summary updated

BibTeX
@misc{qi2025goal,
  author = {Yajie Qi and Wei Wei and Lin Li and Lijun Zhang and Zhidong Gao and Da Wang and Huizhong Song},
  title = {{Goal-Guided Efficient Exploration via Large Language Model in Reinforcement Learning}},
  year = {2025},
  eprint = {2509.22008},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.22008},
}
Figure