Abstract
Mastering deep reinforcement learning (DRL) proves challenging in tasks featuring scant rewards. These limited rewards merely signify whether the task is partially or entirely accomplished, necessitating various exploration actions before the agent garners meaningful feedback. Consequently, the majority of existing DRL exploration algorithms struggle to acquire practical policies within a reasonable timeframe. To address this challenge, we introduce an approach leveraging offline demonstration trajectories for swifter and more efficient online RL in environments with sparse rewards. Our pivotal insight involves treating offline demonstration trajectories as guidance, rather than mere imitation, allowing our method to learn a policy whose distribution of state-action visitation marginally matches that of offline demonstrations. We specifically introduce a novel trajectory distance relying on maximum mean discrepancy (MMD) and cast policy optimization as a distance-constrained optimization problem. We then illustrate that this optimization problem can be streamlined into a policy-gradient algorithm, integrating rewards shaped by insights from offline demonstrations. The proposed algorithm undergoes evaluation across extensive discrete and continuous control tasks with sparse and misleading rewards. The experimental findings demonstrate the significant superiority of our proposed algorithm over baseline methods concerning diverse exploration and the acquisition of an optimal policy.
Introduction: The Challenge of Sparse Rewards
In Deep Reinforcement Learning (DRL), agents typically learn through a process of trial and error. While effective in environments with frequent feedback, this approach falters in "sparse reward" scenarios—the "needle in a haystack" problem. In such cases, an agent might perform thousands of actions without receiving any signal, making exploration highly inefficient.
While "Learning from Demonstrations" (LfD) offers a potential solution, traditional methods often fall into two traps: they either use demonstrations solely for initial pre-training or attempt to force the agent to strictly mimic expert behavior (Imitation Learning). Strict mimicry is brittle; if demonstrations are imperfect or the environment shifts, the agent cannot adapt. Trajectory-Oriented Policy Optimization (TOPO) proposes a middle ground: using demonstrations as "soft guidance" to define a region of interest for exploration without being strictly bound to specific expert actions.
Methodology: Trajectory-Oriented Policy Optimization (TOPO)
The core innovation of TOPO lies in its measurement of the "distance" between an agent's current behavior and the provided expert trajectories.
MMD Trajectory Distance
Instead of comparing individual state-action pairs, TOPO utilizes Maximum Mean Discrepancy (MMD). MMD is a kernel-based statistical test used to determine if two distributions differ. In this context, it measures the disparity between the state-action visitation distribution of the agent’s policy and the offline demonstration set.
Constrained Optimization and Intrinsic Rewards
The learning task is framed as a constrained optimization problem: maximize the environmental reward while ensuring the MMD distance to the demonstrations remains below a defined threshold. To solve this using standard policy gradient methods like Proximal Policy Optimization (PPO), the constraint is converted into a penalty via a Lagrange multiplier. This creates a dense intrinsic reward signal. If the agent wanders too far from the guided area suggested by demonstrations, it receives a negative signal—effectively turning a sparse reward problem into a dense one.
Dynamic Buffer Management
TOPO allows for the demonstration buffer to be updated dynamically. If the agent discovers a trajectory that achieves a higher return than the existing demonstrations, it replaces the older data. This ensures the guidance signal improves as the agent discovers more optimal paths.
Experimental Setup
The researchers evaluated TOPO across three challenging environments designed to test exploration capabilities under sparse rewards:
- Key-Door-Treasure: A 26x36 discrete grid-world where the agent must sequence three specific tasks (pick up key, unlock door, find treasure) to receive a single reward at the end.
- SparseHalfCheetah: A continuous locomotion task where rewards are only granted if the agent's center of mass moves beyond a 10-unit threshold.
- SparseHopper: A continuous task with a 1-unit threshold but significantly more unstable dynamics than the Cheetah.
Key Results and Analysis
TOPO was benchmarked against several state-of-the-art methods, including PPO, Self-Imitation Learning (SIL), and Generative Adversarial Self-Imitation Learning (GASIL).
- Success Rate and Efficiency: In the Key-Door-Treasure task, TOPO achieved a near 100% success rate significantly faster than PPO+D and SIL. Vanilla PPO and Noisy-A2C failed to learn the task entirely.
- Continuous Control Performance: In MuJoCo tasks, TOPO demonstrated steeper learning curves. In SparseHopper, TOPO reached an average return of ~1500, outperforming the next best baseline (PPO+D), which plateaued at 1000.
- MMD Minimization: Analysis of the MMD distance over time (as seen in Figure 6b) confirms that TOPO successfully and steadily minimizes the distance between the agent's behavior and the demonstrations, validating the effectiveness of the intrinsic reward signal.
Conclusion
TOPO represents a significant advancement in leveraging offline demonstrations for RL. By treating demonstrations as a distribution to be matched rather than a sequence to be imitated, it provides a robust, dense guidance signal that excels in sparse reward environments. While future work may explore automated kernel selection and computational optimizations, TOPO demonstrates a clear path toward more sample-efficient and flexible reinforcement learning.
Summary updated