TL;DR
Reinforcement Learning (RL) agents often struggle to generalize, performing brilliantly on training levels but failing on unseen ones. This paper introduces mixreg, a simple yet powerful regularization technique that trains agents on convex combinations of observations and their corresponding supervision signals (rewards or values) from different environments, significantly narrowing the generalization gap.
The Generalization Gap in RL
Deep RL has achieved superhuman performance in closed systems like Go or Chess, but it remains notoriously brittle when faced with "distribution shift." An agent trained to navigate a specific set of video game levels often overfits to those specific textures, layouts, or backgrounds. When dropped into a new level, the agent fails—a phenomenon known as the generalization gap.
While standard computer vision tricks like "cutout" or "random convolution" help by adding local noise to images, the authors argue these are merely "local perturbations." They don't fundamentally increase the diversity of the training data enough to help the agent understand the underlying structure of the task. The challenge is to find a way to make RL agents learn smoother, more robust policies that aren't distracted by environmental "noise."
Introducing Mixture Regularization (mixreg)
To address this, the authors propose mixreg (Mixture Regularization), inspired by the "mixup" technique used in supervised learning.
Instead of training on a single observation $s_i$, the agent trains on a mixture of two observations $s_i$ and $s_j$ sampled from different environments: $$\tilde{s} = \lambda s_i + (1 - \lambda)s_j$$ Where $\lambda$ is a random coefficient drawn from a Beta distribution.
The Critical Twist: Simply mixing the images isn't enough. If you mix a "Level A" image with a "Level B" image, what is the correct action or reward? The authors found that you must also interpolate the supervision signals (the rewards or state values): $$\tilde{y} = \lambda y_i + (1 - \lambda)y_j$$
By enforcing this linearity, mixreg acts as a structural regularizer. It forces the neural network to behave predictably in the "empty spaces" between training examples, leading to a smoother policy and value function. The paper demonstrates how to integrate this into both policy-based (PPO) and value-based (Rainbow/DQN) algorithms.
Experimental Setup: The Procgen Benchmark
The researchers evaluated their method on the Procgen Benchmark, a suite of 16 procedurally generated environments designed specifically to measure RL generalization.
- Training: Agents were typically restricted to a "500-level" training set.
- Testing: Performance was measured on a separate, unseen set of levels.
- Focus: They highlighted results on 6 games with particularly large generalization gaps: Caveflyer, Climber, Dodgeball, Fruitbot, Jumper, and Starpilot.
Key Insights and Results
- Beyond Local Perturbations: Unlike random cropping or color jittering, mixreg performs "global interpolation." It forces the agent to map the relationship between distant points in the state space, which is much more effective for learning generalizable features.
- The Importance of Supervision Mixing: An ablation study revealed that mixing only the observations (the images) often yields little to no improvement. The "magic" happens when you also mix the rewards/values, providing a consistent and smooth training signal for the interpolated states.
- Smoothness as a Virtue: Visualization of the learned value functions shows that mixreg produces much smoother "landscapes" than standard PPO. This prevents the agent from being "tricked" by small visual changes in the environment.
- Superior Performance & Sample Efficiency: Mixreg consistently outperformed well-established baselines (including batch normalization, $L_2$ regularization, and various data augmentations) on the Procgen benchmark. Furthermore, mixreg-trained agents often reached the same level of testing performance as the baseline using significantly fewer training levels.
- Algorithm Agnostic: The benefits were consistent across both PPO (policy gradient) and Rainbow (Q-learning), and across different model sizes.
Limitations and Future Work
- Visual Focus: The paper primarily focuses on tackling visual changes (backgrounds, textures). While the authors suggest the method is general, its effectiveness on purely dynamical or structural changes (e.g., changing gravity or physics) remains to be fully explored.
- Mixing Schemes: The current implementation uses simple linear interpolation. The authors note that more flexible or expressive mixing schemes for observations and supervisions could be a fruitful area for future research.
- Domain Diversity: The study is centered on the game domain (Procgen). Testing mixreg in other high-stakes domains like finance or real-world robotics is a necessary next step to prove its broader utility.
Summary updated