Abstract
In Hindsight Experience Replay (HER), a reinforcement learning agent is trained by treating whatever it has achieved as virtual goals. However, in previous work, the experience was replayed at random. This paper introduces Energy-Based Prioritization (EBP), a novel method to improve HER in reinforcement learning for robotics. By prioritizing the replay of episodes where the robot expends more physical energy on an object, the agent learns from more valuable, difficult interactions. This approach doubles sample efficiency and improves success rates without the heavy computational overhead of traditional Prioritized Experience Replay (PER).
Introduction
In robotic reinforcement learning (RL), rewards are often sparse—a robot either successfully places an object on a shelf (reward) or fails (no reward). Hindsight Experience Replay (HER) tackles this by treating failed attempts as successful attempts at virtual goals, giving the agent a denser reward signal to learn from.
However, standard HER samples these past episodes uniformly at random from its replay buffer. This is inefficient because not all failures are equally educational. An episode where the robot completely misses the object is less informative than one where it successfully picks the object up but accidentally drops it near the goal. While Prioritized Experience Replay (PER) exists to rank episodes by their Temporal Difference (TD) error, updating TD-errors across a massive replay buffer after every training step is computationally crippling. This paper proposes Energy-Based Prioritization (EBP) to efficiently identify and prioritize the most valuable episodes for an RL agent to replay.
Methodology
The authors propose Energy-Based Prioritization (EBP), a framework inspired by the work-energy principle in physics. Instead of relying on model-dependent TD-errors, EBP uses the physical trajectory of the target object to determine an episode's value. A trajectory energy function calculates the sum of the transition energy over an episode, including changes in Potential Energy (height), Kinetic Energy (linear velocity), and Rotational Energy (angular velocity).
When a new trajectory is added to the replay buffer, its total trajectory energy is calculated once. During training, the RL agent samples trajectories from the buffer with a probability proportional to this energy. Episodes with higher energy—meaning the robot did more physical work on the object—are prioritized.
Experimental Setup
The approach is evaluated in simulated robotic environments using the MuJoCo physics engine within OpenAI Gym. The authors test on four standard multi-goal RL benchmarks:
- FetchPickAndPlace: A 7-DOF robot arm with a two-finger gripper.
- HandManipulateBlock, HandManipulateEgg, HandManipulatePen: A complex 24-DOF Shadow Dexterous robotic hand tasked with manipulating objects into target orientations.
Results and Analysis
EBP significantly improves both sample efficiency and final performance across all tested environments. On average, EBP cuts the number of training samples needed to reach a target success rate by nearly half (1.96x improvement). For example, in the FetchPickAndPlace task, vanilla HER required 93,100 samples to reach a 93.8% success rate, while HER+EBP needed only 48,000.
A key insight is that physical work acts as a proxy for learning value. The authors found a strong positive correlation (Pearson's r ≈ 0.6) between trajectory energy and TD-errors, suggesting that high-energy trajectories are indeed the ones the model finds most "surprising" and valuable.
Furthermore, EBP offers massive computational savings. Because energy is an objective physical metric calculated once, it bypasses the expensive buffer-wide updates required by PER. In complex dexterous hand environments, HER+PER took roughly 10 times longer to train than HER+EBP.
Conclusion
Energy-Based Prioritization provides a simple yet effective heuristic for prioritizing experience in robotic RL. While limited to domains where physical state data is available, it demonstrates that physics-informed priors can drastically improve learning efficiency. Future work may involve integrating more domain-specific knowledge to further guide curriculum learning in modern RL paradigms.
Summary updated