Robust Domain Randomised Reinforcement Learning through Peer-to-Peer Distillation

Chenyang Zhao, Timothy M. Hospedales

Abstract

In reinforcement learning, domain randomisation is a popular technique for learning general policies that are robust to new environments and domain-shifts at deployment. However, naively aggregating diverse domains often leads to high gradient variance and underfitting. This paper introduces Peer-to-Peer Distillation Reinforcement Learning (P2PDRL), a decentralized framework where multiple agents train on local domains and share knowledge via mutual KL-divergence regularization. This approach stabilizes training and improves zero-shot generalization to unseen environments without the need for a central teacher model.

Introduction

Deep Reinforcement Learning (RL) agents are notoriously brittle, often failing when deployed in environments that differ slightly from their training simulations—a phenomenon known as the "sim-to-real" gap. Domain Randomization (DR) attempts to solve this by training agents across a wide distribution of environments with varying physical parameters like friction, mass, and gravity.

However, training a single model on a highly diverse set of environments introduces significant optimization challenges. The high variance in gradient estimates can lead to underfitting, where the agent fails to learn the task entirely. While previous "divide-and-conquer" methods used local experts to teach a central global policy, these approaches are computationally heavy and require complex data-sharing pipelines.

Methodology: Peer-to-Peer Distillation

The authors propose Peer-to-Peer Distillation Reinforcement Learning (P2PDRL), which utilizes an ensemble of $K$ agents (peers) that learn collaboratively without a central teacher.

Comparison of distillation architectures. (d) illustrates the proposed P2PDRL framework where agents regularize each other directly through mutual distillation.

In this framework, each agent is assigned a local domain sampled from the randomized distribution. Alongside standard Proximal Policy Optimization (PPO), each agent's objective includes a Kullback-Leibler (KL) divergence distillation loss. This loss penalizes an agent if its predicted action distribution differs from those of its peers. This decentralized approach is highly efficient, as agents only need to share model parameters to compute the KL penalty rather than raw trajectory data.

Experimental Setup

The method was evaluated on five continuous control tasks from the OpenAI Gym simulated in MuJoCo: Walker2d, Ant, Humanoid, Hopper, and HalfCheetah. To test domain generalization, the researchers introduced a randomization scalar $\epsilon \in [0, 1]$ to control the variance of dynamic parameters, including wind conditions, gravity, and robot mass.

Results and Discussion

P2PDRL consistently outperformed baselines such as standard PPO, Distral, and DnC when evaluated on novel, held-out testing domains. A key insight is that P2PDRL explicitly lowers the variance of gradient estimates during training, allowing it to handle much wider domain distributions than standard DR methods.

Training and testing returns for Walker and Ant tasks. P2PDRL maintains robust testing performance even as domain randomization increases, whereas standard methods typically collapse.

In the Walker task, for instance, standard PPO's performance typically crashes when randomization strength exceeds 0.5. In contrast, P2PDRL maintains high testing returns well beyond this threshold. Furthermore, experiments demonstrated that this success is not merely due to increased entropy; P2PDRL achieves higher testing performance at lower entropy levels than heavily regularized PPO, indicating it learns genuinely more generalizable features.

Conclusion

P2PDRL provides a robust and efficient framework for training RL agents that generalize to unseen environments. By replacing centralized distillation with peer-to-peer regularization, the method stabilizes training under extreme domain randomization. Future research may extend this framework to visual domain randomization and physical robot validation to further bridge the sim-to-real gap.

Summary updated

BibTeX
@inproceedings{zhao2021robust,
  author = {Chenyang Zhao and Timothy M. Hospedales},
  title = {{Robust Domain Randomised Reinforcement Learning through Peer-to-Peer Distillation}},
  booktitle = {ACML},
  year = {2021},
  url = {https://openreview.net/forum?id=6lIV1kXlis},
}
Figure