Efficient Planning with Latent Diffusion

Wenhao Li

Introduction

Offline Reinforcement Learning (RL) aims to learn optimal policies from fixed datasets without further environment interaction. This is notoriously difficult in domains with temporally extended tasks (long horizons) and delayed sparse rewards.

Most existing methods plan in the "raw action space," which has two major drawbacks. First, planning every single micro-step over a long horizon is computationally expensive and prone to error accumulation. Second, planners often stumble into "out-of-distribution" (OOD) actions—actions the model incorrectly evaluates as beneficial because it hasn't seen them before, ultimately leading to failure.

While "latent action" spaces—which group sequences of actions into a single abstract code—offer a solution, previous attempts were largely restricted to discrete spaces or required separate, resource-intensive planning phases. To address this, researchers have introduced LatentDiffuser, a novel offline RL framework that performs planning in a continuous latent action space using score-based diffusion models. By combining temporal abstraction with energy-guided sampling, it achieves state-of-the-art performance in high-dimensional control tasks and long-horizon problems where traditional raw-action planning fails.

The LatentDiffuser Framework

LatentDiffuser provides a unified framework that seamlessly integrates representation learning and planning.

Architecture of LatentDiffuser

The methodology is built on several core pillars:

  • Continuous Latent Action Space: Using a Variational Autoencoder (VAE) architecture, the model segments trajectories into slices of length $L$. An encoder maps these slices into a continuous latent space, while a decoder learns to reconstruct the original states and actions. This provides temporal abstraction, effectively shortening the planning horizon.
  • Latent Diffusion Prior: Instead of a simple Gaussian prior, LatentDiffuser uses a score-based diffusion model (SDM) to learn the distribution of these latent actions. This ensures that any planned latent action stays within the "support" of the behavior policy, successfully avoiding OOD issues.
  • Energy-Guided Planning: The authors prove a theoretical equivalence between optimal planning and sampling from the diffusion model guided by an "energy" function (representing the Q-value or expected return).
  • Sequence-Level Exact Sampling: The framework implements a modified version of Contrastive Energy Prediction to perform exact energy-guided sampling at the sequence level, making the planning process both high-quality and efficient.

Furthermore, using causal transformers in the encoder makes the latent actions more "predictive" (e.g., predicting rewards based on state), which significantly improves planning quality compared to non-causal architectures.

Experimental Results

The model was evaluated on standard D4RL benchmarks, including Gym Locomotion (HalfCheetah, Hopper, Walker2d) for low-dimensional control, Adroit for high-dimensional tasks, and AntMaze for long-horizon tasks with sparse rewards.

Performance on Gym Locomotion tasks

Key findings from the experiments include:

  • Competitive Low-Dimensional Control: As shown in the performance table above, LatentDiffuser (LD) demonstrates highly competitive, and often superior, performance across various Gym Locomotion datasets compared to strong baselines like CQL, Decision Transformer (TT), and standard Diffusion Q-Learning (D-QL).
  • Superiority in High Dimensions: In the complex Adroit tasks (24 degrees of freedom), LatentDiffuser significantly outperformed all baselines. For example, in the "Expert Pen" task, it achieved a score of 131.2, compared to 127.4 for the nearest hierarchical competitor and 107.6 for standard diffusion-based planning.
  • Long-Horizon Success: In AntMaze, LatentDiffuser demonstrated competitive "trajectory stitching" abilities, successfully reaching goals in large maps by splicing together suboptimal segments from the dataset.
  • Efficiency: By planning in latent space, one "decision" by the model corresponds to $L$ steps in the environment, exponentially reducing the search space. Despite the iterative nature of diffusion, LatentDiffuser's inference time is roughly 0.5 seconds per decision, making it comparable to other state-of-the-art diffusion planners while being more effective in complex tasks.

Limitations and Future Work

While LatentDiffuser marks a significant step forward, it has limitations. Like all diffusion-based methods, the iterative sampling process is slower than simple feed-forward policies. Future work could leverage "consistency models" or distillation to accelerate inference. Additionally, the latent step size ($L$) and planning horizon ($H$) are currently fixed; making these parameters adaptive to task complexity could further improve performance. Finally, testing the model's robustness in highly stochastic real-world scenarios remains an important open question.

Summary updated

BibTeX
@inproceedings{li2024efficient,
  author = {Wenhao Li},
  title = {{Efficient Planning with Latent Diffusion}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=btpgDo4u4j},
}
Figure