Improving Generalization in Reinforcement Learning with Mixture Regularization

Kaixin Wang, Bingyi Kang, Jie Shao, Jiashi Feng · DOI

Abstract

Deep reinforcement learning (RL) agents trained in a limited set of environments tend to suffer overfitting and fail to generalize to unseen testing environments. To improve their generalizability, data augmentation approaches (e.g. cutout and random convolution) are previously explored to increase the data diversity. However, we find these approaches only locally perturb the observations regardless of the training environments, showing limited effectiveness on enhancing the data diversity and the generalization performance. In this work, we introduce a simple approach, named mixreg, which trains agents on a mixture of observations from different training environments and imposes linearity constraints on the observation interpolations and the supervision (e.g. associated reward) interpolations. Mixreg increases the data diversity more effectively and helps learn smoother policies. We verify its effectiveness on improving generalization by conducting extensive experiments on the large-scale Procgen benchmark. Results show mixreg outperforms the well-established baselines on unseen testing environments by a large margin. Mixreg is simple, effective and general. It can be applied to both policy-based and value-based RL algorithms.

Introduction

In reinforcement learning, agents often struggle with a significant generalization gap: they excel in training environments but fail in novel testing scenarios. This is often due to the agent "memorizing" specific visual features or layouts of the training levels rather than learning robust policies.

Traditional data augmentation techniques, such as cutout or random convolutions, attempt to mitigate this by adding noise to the input. However, these methods are essentially local perturbations—they modify a single state in isolation. The authors of this paper argue that such local changes are insufficient for capturing the complex relationships between different environmental states, leading to limited improvements in generalization on large-scale benchmarks like Procgen.

Methodology: The Mixreg Approach

To overcome the limitations of local augmentations, the authors propose mixreg (Mixture Regularization). Inspired by the "mixup" technique used in supervised computer vision, mixreg creates synthetic training samples by interpolating between two different observations and their corresponding supervision signals.

Comparison between local augmentation (left) and the proposed mixreg approach (right). While standard augmentation only perturbs a single state $s$, mixreg interpolates between two distinct states $s_i$ and $s_j$ to create a mixed observation $s_{mix}$.

Specifically, for two samples $(s_i, y_i)$ and $(s_j, y_j)$ from a training batch, mixreg generates a mixed sample $(\tilde{s}, \tilde{y})$:

$$\tilde{s} = \lambda s_i + (1 - \lambda)s_j$$ $$\tilde{y} = \lambda y_i + (1 - \lambda)y_j$$

where $\lambda$ is a random weight drawn from a Beta distribution. The supervision signal $y$ is adapted based on the RL algorithm:

  • Policy Gradient (PPO): Interpolates state-values and advantages.
  • Deep Q-Learning (Rainbow): Interpolates rewards and target Q-distributions.

By enforcing this linearity constraint, mixreg encourages the network to learn a smoother mapping from observations to actions and values, effectively regularizing the agent's behavior across the state space.

Experimental Setup

The effectiveness of mixreg was evaluated on the Procgen Benchmark, a suite of 16 procedurally generated environments. The experiments focused on 6 games known for large generalization gaps: Caveflyer, Climber, Dodgeball, Fruitbot, Jumper, and Starpilot. Agents were trained on a limited set of 500 levels and then tested "zero-shot" on completely unseen levels to measure their ability to generalize.

Key Results and Insights

  • Mandatory Label Mixing: A critical finding is that interpolating the supervision signals (labels) is essential. Mixing only the images without the corresponding rewards or values confuses the agent and degrades performance.
  • Policy Smoothing: Mixreg acts as a powerful smoother. Analysis of the empirical Lipschitz constant showed that mixreg-trained agents have significantly smoother value functions compared to standard baselines.
  • Superior Generalization: Mixreg consistently outperformed standard PPO and Rainbow baselines, as well as other popular augmentations like random crop and cutout, by a substantial margin on the Procgen benchmark.
  • Representation Robustness: The method helps agents learn more robust visual features. Models trained with mixreg adapted faster when fine-tuned on new levels, even when the vision backbone was frozen.

Conclusion

Mixreg is a simple, effective, and general regularization technique that significantly improves the generalization of RL agents. By training on mixtures of observations and supervision signals, it encourages the learning of smoother policies and more robust representations. While demonstrated here on visual benchmarks, its principles of linearity and interpolation offer a promising path for improving RL robustness across diverse domains.

Summary updated

BibTeX
@inproceedings{wang2020improving,
  author = {Kaixin Wang and Bingyi Kang and Jie Shao and Jiashi Feng},
  title = {{Improving Generalization in Reinforcement Learning with Mixture Regularization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=VIR4JlUqHVP},
}
Figure