Occupancy Reward Shaping: Improving Credit Assignment for Offline Goal-Conditioned Reinforcement Learning

Aravind Venugopal, Jiayu Chen, Xudong Wu, Chongyi Zheng, Benjamin Eysenbach, Jeff Schneider

TL;DR

Occupancy Reward Shaping (ORS) leverages generative world models to solve the "credit assignment" problem in offline reinforcement learning. By using optimal transport to extract temporal geometry from a learned occupancy measure, ORS creates dense rewards that guide agents toward goals without altering the optimal policy. This approach results in a 2.2× performance boost across complex robotics and nuclear fusion control tasks.

What Problem Does This Paper Address?

In Goal-Conditioned Reinforcement Learning (GCRL), an agent learns to reach various goals from an offline dataset. However, most real-world datasets use sparse rewards—the agent only receives a "1" when it hits the goal and "0" otherwise. This creates a massive credit assignment challenge: how does the agent know which of its thousands of previous actions actually led to that final success?

Standard algorithms often struggle with "value non-monotonicity," where the estimated value of a state fluctuates rather than steadily increasing as the agent gets closer to the goal. This noise makes learning unstable and inefficient, especially in long-horizon tasks like navigating a giant maze or manipulating multiple objects.

Methods

The authors introduce Occupancy Reward Shaping (ORS), which transforms a sparse reward problem into a dense one by looking at the "future."

  1. Learning the Occupancy Measure: Instead of just predicting the next state, the authors train a generative world model (using flow matching) to capture the entire distribution of future states an agent might visit from its current position. This is called the occupancy measure.
  2. Extracting Geometry via Optimal Transport: They prove that the temporal distance to a goal is encoded in the geometry of this occupancy measure. Specifically, they use the Wasserstein-2 distance to measure how "far" the distribution of future states is from the target goal.
  3. Reward Shaping: This distance is converted into a scalar reward. Crucially, they prove that this specific form of reward shaping preserves the optimal policy—meaning the "shaped" reward won't trick the agent into sub-optimal behavior, which is a common pitfall in manual reward design.
ORS translates future state distributions into dense reward gradients.

Datasets

The authors evaluated ORS on two primary benchmarks:

  • OGBench: A suite of 13 challenging offline GCRL tasks including locomotion (Antmaze), cube manipulation, combinatorial puzzles (Lights Out), and sequential scene tasks. These tasks are characterized by long horizons (up to 2000 steps).
  • Tokamak Control: Real-world data from the DIII-D nuclear fusion reactor. The goal is to control magnetic actuators to maintain plasma stability (tracking variables like electron density and ion rotation), a system with highly non-linear and stochastic dynamics.

Key Insights and Ideas

  • World Models are Geometric Maps: Generative models don't just "hallucinate" futures; they implicitly learn the connectivity and "distance" of the state space. ORS provides a formal way to extract this temporal geometry.
  • Density is the Signal: Sparse rewards are binary, but the distribution of reachable future states changes smoothly as you move through an environment. By comparing distributions (using optimal transport) rather than single points, the agent gets a much richer training signal.
  • Policy Invariance: One of the biggest fears in RL is that adding "bonus" rewards will lead to "reward hacking" (e.g., an agent running in circles to collect bonuses). The authors provide a theoretical guarantee that ORS avoids this by aligning the shaped reward with the underlying shortest-path geometry.

Key Results

ORS significantly outperformed existing state-of-the-art methods across the board:

  • 2.2× Improvement: On average, ORS improved the success rate of its base algorithm (GCIQL) by more than double across OGBench tasks.
  • Beating Hierarchical RL: ORS outperformed specialized hierarchical methods like HIQL and n-step return methods by substantial margins.
  • Robustness to Sub-optimal Data: Even when trained on "explore" datasets (random, low-quality trajectories), ORS was often the only method able to achieve non-zero success rates on the most difficult tasks.
  • Real-World Fusion: In Tokamak control, ORS consistently achieved the lowest tracking error compared to all baselines, demonstrating its utility in complex, high-stakes physical systems.
ORS significantly outperforms baseline and hierarchical RL methods.

Limitations and Future Work

While powerful, ORS has some constraints:

  • Combinatorial Complexity: In "lock-like" tasks (where only one specific sequence of actions works), the occupancy measure might still be too sparse to provide a strong signal.
  • Computational Overhead: Training a generative flow-matching model adds a layer of complexity and compute time compared to simple value-based methods.
  • Future Directions: The authors suggest that performance could be further improved by filtering the occupancy measure to focus only on "useful" future states or by combining ORS with local rewards to capture very short-range dependencies more accurately.

Summary updated

BibTeX
@inproceedings{venugopal2026occupancy,
  author = {Aravind Venugopal and Jiayu Chen and Xudong Wu and Chongyi Zheng and Benjamin Eysenbach and Jeff Schneider},
  title = {{Occupancy Reward Shaping: Improving Credit Assignment for Offline Goal-Conditioned Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=EW8DskWQ1K},
}
Figure