TL;DR
Learning from demonstrations accelerates reinforcement learning, but acquiring high-quality expert data is often expensive or impossible. Co-Imitation Learning (CoIL) circumvents the need for human experts by training two independent agents that explore simultaneously and selectively imitate each other's successful actions. By filtering peer experiences through each agent’s own value estimates, CoIL enables collaborative policy improvement and deeper exploration in sparse-reward environments.
What Problem Does This Paper Address?
Standard Reinforcement Learning (RL) typically demands millions of environment interactions to discover effective policies, particularly in environments with sparse or delayed rewards. Imitation Learning (IL) mitigates sample inefficiency using expert demonstrations, but real-world domains—such as robotics, autonomous driving, and medicine—rarely have cheap or readily available expert trajectories.
Self-Imitation Learning (SIL) previously attempted to solve this by having a single agent store and re-imitate its own past high-reward trajectories. However, SIL hits an exploration ceiling: because a single agent re-mines its own historical actions, it struggles to break out of local optima or discover novel pathways in hard-exploration mazes without external guidance.
Methods
CoIL introduces a peer-to-peer framework where two independently parameterized agents ($\pi_\theta$ and $\hat{\pi}_{\hat{\theta}}$) explore the environment concurrently and maintain separate replay buffers ($\mathcal{D}$ and $\hat{\mathcal{D}}$). Instead of imitating external experts or solely relying on themselves, each agent selectively learns from the other’s experiences.
-
Utility Estimation: To avoid imitating misleading or suboptimal peer trajectories, an agent evaluates the potential utility of peer state-action pairs using the advantage over its own value function: $$P_\pi(\hat{a}, \hat{s}) = \hat{R} - V_\theta(\hat{s})$$ If the peer’s discounted cumulative return $\hat{R}$ exceeds the agent’s own state-value estimate $V_\theta(\hat{s})$, the transition is deemed valuable.
-
Co-Imitation Objective: The agents update their policy and value networks via an off-policy actor-critic loss over high-utility peer experiences: $$\mathcal{L}^{co}_{policy} = -\log \pi_\theta(\hat{a} \mid \hat{s})(\hat{R} - V_\theta(\hat{s}))_+$$ $$\mathcal{L}^{co}_{value} = \frac{1}{2} \|(\hat{R} - V_\theta(\hat{s}))_+\|^2$$ where $(\cdot)_+ = \max(\cdot, 0)$.
-
Base RL Integration: CoIL alternates standard on-policy RL updates (e.g., PPO or A2C) with $M$ off-policy co-imitation updates sampled from the peer's replay buffer.
Datasets & Environments
The authors evaluated CoIL across continuous control and discrete grid-world navigation tasks:
- MuJoCo Benchmarks (Continuous Control): Evaluated on
Swimmer-v2,HalfCheetah-v2,Ant-v2, andWalker2d-v2, as well as their delayed-reward counterparts where accumulated reward is only returned every 20 steps. - Gym-MiniGrid Benchmarks (Sparse Reward & Hard Exploration): Evaluated on procedurally generated grid worlds including
Empty-16x16,DoorKey-6x6,DoorKey-8x8,KeyCorridorS3R1,KeyCorridorS3R3,SimpleCrossingS9N3,FourRooms,MultiRoom-N4, andMultiRoom-N6.
Key Insights and Ideas
- Mutual Cross-Pollination Breaks Local Optima: In complex exploration environments (like multi-room mazes), individual agents often get stuck exploring different dead ends. When one agent stumbles upon a door or key, its high return signals high utility to the peer agent, guiding both agents past bottlenecks without an external teacher.
- Self-Regulating Filtering: The advantage clipping $(\hat{R} - V_\theta(\hat{s}))_+$ ensures that an agent only imitates actions that outperformed its own current capability, naturally filtering out irrelevant or noisy transitions from the peer.
- Orthogonal to Intrinsic Exploration: CoIL readily combines with intrinsic curiosity and count-based exploration bonuses like BEBOLD, demonstrating that mutual experience exploitation complements novel state discovery.
Key Results
- Continuous Control (MuJoCo): Combined with PPO, CoIL achieved major performance gains. On
HalfCheetah-v2,PPO+CoILreached a reward near 5000, whereas standard PPO and PPO+SIL remained below 2000. OnSwimmer-v2, CoIL reached a score of ~360. - Robustness to Delayed Feedback: Performance advantages widened in delayed-reward setups, showing superior stability on
DelayedAnt-v2andDelayedWalker2d-v2. - Sparse-Reward MiniGrid: In
KeyCorridorS3R1, both baseline A2C and SIL failed completely, while CoIL successfully solved the task. InMultiRoom-N6, CoIL combined with BEBOLD uncovered all six rooms and reached the goal within 1.5M steps, whereas RL and SIL baselines remained stuck in the second and third rooms.
Limitations and Future Work
- Compute Overhead: Training two agents simultaneously requires maintaining two policies, two value functions, and dual replay buffers, increasing memory and interaction overhead per training step compared to single-agent baselines.
- Lack of Explicit Diversity Incentives: As training progresses, the two agents' policies may converge to similar trajectories, potentially diminishing the diversity of peer experiences. The authors note that explicitly enforcing behavioral diversity between agents is an important direction for future research.
Summary updated