LLM-Driven Policy Diffusion: Enhancing Generalization in Offline Reinforcement Learning

Hanping Zhang, Yuhong Guo · DOI

Introduction

Offline Reinforcement Learning (RL) presents a significant challenge: agents must learn optimal behaviors from static, pre-collected datasets without the benefit of environment interaction. While safer and more practical for real-world applications like robotics and autonomous driving, this paradigm often suffers from a "generalization gap." Agents frequently overfit to the specific trajectories in the training data, failing when faced with even minor variations in task objectives or environment dynamics.

To address this, LLM-Driven Policy Diffusion (LLMDPD) introduces a framework that leverages the semantic reasoning of Large Language Models (LLMs) and the sequential modeling power of Transformers to provide agents with rich contextual prompts. By conditioning a diffusion-based policy on these prompts, the system enables zero-shot generalization to entirely new tasks.

The LLMDPD Framework

LLMDPD operates by transforming task descriptions and sample trajectories into high-dimensional embeddings that guide the agent's decision-making process. The architecture consists of three core modules:

  1. LLM-Driven Text Prompt Embedding: A pre-trained Llama3-7B model processes structured text descriptions (e.g., "Objective: Push the puck to a goal"). This allows the agent to tap into the LLM's latent knowledge, understanding semantic relationships between different physical actions.
  2. Transformer-Driven Trajectory Prompt Embedding: To capture the physical nuances of a task, a Transformer encodes a short sequence of states and actions from a sample trajectory. This provides the "feel" of the environment's dynamics.
  3. Context-Aware Conditional Policy Diffusion: The agent utilizes a Diffusion Model as its policy (the "Actor"). Unlike traditional neural networks, diffusion models generate actions by iteratively refining noise. In LLMDPD, this refinement is conditioned on the combined text and trajectory embeddings. To ensure performance, the model is integrated into an Actor-Critic framework using Double Q-Learning to maximize cumulative rewards.

Experimental Evaluation

The researchers evaluated LLMDPD against two primary benchmarks to test both generalization and raw performance:

  • Meta-World (MT50): A robotic manipulation suite. The model was trained on 45 tasks and tested on 5 "unseen" tasks to measure its ability to generalize to new objectives.
  • D4RL: A standard benchmark for locomotion (HalfCheetah, Hopper, Walker2D) using "medium-replay" datasets to test learning from diverse, sub-optimal data.

Results and Analysis

Meta-World: Generalization to Unseen Tasks

LLMDPD demonstrated superior generalization capabilities compared to state-of-the-art methods like MTDIFF and S4RL. On unseen tasks, the model showed a significant performance boost. For instance, in the bin-picking task, LLMDPD achieved a success rate approximately 19% higher than the previous best-performing method.

Success rates on Meta-World tasks, comparing LLMDPD against baselines on seen and unseen tasks.

D4RL: Locomotion Performance

In the D4RL locomotion benchmarks, LLMDPD established a new state-of-the-art average normalized score of 88.5. The model proved particularly robust in the Hopper and Walker2d environments, outperforming specialized baselines like ADS and RD.

Normalized scores on D4RL locomotion benchmarks, showing LLMDPD achieving state-of-the-art average performance.

Key Insights

  • Semantic Synergy: Ablation studies confirmed that text and trajectory prompts are complementary. Textual prompts provide the high-level goal, while trajectory prompts provide the mechanical context. Removing either component led to a marked decrease in success rates for complex tasks.
  • Efficiency and Stability: By applying diffusion at the action level rather than the trajectory level, LLMDPD maintains the flexibility to handle multi-modal action distributions while remaining computationally viable for real-time control. Furthermore, the use of prompts significantly reduced performance variance, leading to more reliable agents.

Conclusion

LLM-Driven Policy Diffusion represents a significant step forward in bridging the generalization gap in offline RL. By treating task descriptions as semantic anchors and trajectories as physical context, LLMDPD allows agents to navigate unseen scenarios with unprecedented success. Future work will likely focus on reducing the computational overhead of the 7B-parameter LLM and exploring the transition from simulated environments to physical robotic hardware.

Summary updated

BibTeX
@inproceedings{zhang2025llm,
  author = {Hanping Zhang and Yuhong Guo},
  title = {{LLM-Driven Policy Diffusion: Enhancing Generalization in Offline Reinforcement Learning}},
  booktitle = {ARLET @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=wxpXHbqL1o},
}
Figure