Introduction
Reinforcement learning (RL) often fails when rewards are sparse—akin to trying to find a needle in a haystack without a metal detector. In many real-world scenarios, an RL agent only receives a binary reward (e.g., 0 or 1) upon successfully completing a task. Standard RL algorithms struggle in these sparse reward environments because they spend most of their time wandering aimlessly, never receiving the feedback needed to improve.
To address this, researchers often rely on reward shaping, which requires deep domain expertise to manually design complex mathematical functions. While techniques like Hindsight Experience Replay (HER) help by letting agents learn from their failures, they do not necessarily encourage the agent to explore new parts of the state space effectively. This paper introduces Competitive Experience Replay (CER), a novel method where two agents compete to explore an environment, creating an automatic curriculum that drives agents toward undiscovered areas and significantly boosts performance in complex robotic tasks.
Methodology: The Competitive Framework
The core innovation of CER is training a pair of agents instead of just one: Agent A (the primary agent) and Agent B (the competitor).
The system uses an asymmetric reward re-labeling strategy to foster competition:
- The Penalty: If Agent A visits a state that Agent B has already managed to reach, Agent A receives a penalty. This encourages Agent A to find "unique" paths or states that the competitor hasn't mastered yet.
- The Reward: Conversely, Agent B is rewarded for visiting states that Agent A has found. This pushes Agent B to constantly "chase" Agent A.
- The Framework: Both agents are trained using Multi-Agent Deep Deterministic Policy Gradient (MADDPG) with a centralized critic that observes the states and actions of both agents.
The authors propose two distinct flavors of this approach:
- Independent-CER (ind-CER): Agent B starts each episode from the standard initial state distribution.
- Interact-CER (int-CER): Agent B is initialized at a state previously visited by Agent A, forcing a more direct "cat-and-mouse" interaction. This requires the environment to be re-settable to specific states.
Experimental Setup
The method was evaluated on several challenging continuous control benchmarks, focusing heavily on navigation and manipulation:
- Ant Maze: An "Ant" robot must navigate through complex 'U'-shaped and 'S'-shaped mazes to reach a goal.
- OpenAI Gym Robotics (Fetch): Tasks involving a robotic arm, such as reaching, pushing, picking and placing, and sliding objects.
- Shadow Dexterous Hand: Highly complex tasks involving a 24-degree-of-freedom robotic hand manipulating objects, such as rotating a pen or an egg.
Key Insights and Results
CER introduces an automatic curriculum where the competition naturally scales in difficulty. Early in training, Agent B is slow, allowing Agent A to easily find new areas. As Agent B improves and catches up, Agent A is forced to explore even further to avoid penalties, creating a self-improving loop of exploration. This makes CER highly complementary to HER; while HER helps an agent learn how to reach a goal once found, CER helps the agent find the goal in the first place.
The results demonstrate a massive success rate boost. In the difficult 'S' Maze, standard baselines like DDPG and PPO failed completely. However, CER achieved a significant success rate. When combined with HER (HER+int-CER and HER+ind-CER), the system reached near-perfect performance much faster than HER alone.
This efficiency extended to complex manipulation. On the HandManipulatePenRotate task—one of the hardest in the suite—HER alone achieved roughly 20% success, while the combination of HER and CER pushed the success rate to nearly 50%. Across almost all robotic tasks, CER consistently led to faster convergence, meaning the agents learned the tasks with fewer total interactions with the environment. Furthermore, CER often outperforms traditional exploration methods like the Intrinsic Curiosity Module (ICM) because its "curiosity" is grounded in the behavior of a competitor, making the exploration more task-relevant.
Limitations and Future Work
While highly effective, the CER framework has a few limitations. First, Agent B generally performs worse than Agent A because its primary role is to act as a "sparring partner" rather than the ultimate task-solver. Second, the more effective "Interact" version of the algorithm (int-CER) requires the ability to reset the environment to specific arbitrary states, which is trivial in a simulator but often impossible in real-world robotics.
For future work, the authors suggest exploring more complex multi-agent dynamics, such as using counterfactual inference to make the reward re-labeling even more sample-efficient. They also aim to integrate CER with model-based RL to better understand and leverage environment dynamics.
Summary updated