TL;DR
High variance in Reinforcement Learning (RL) is often blamed on "randomness," but this paper reveals a more deterministic culprit: unstable network activations that saturate nonlinearities and kill gradients. By introducing simple fixes like penultimate normalization, the authors reduced the standard deviation of agents across 21 tasks by a factor of 3 while simultaneously boosting average rewards.
What Problem Does This Paper Address?
If you’ve ever trained an RL agent, you know the frustration: one random seed produces a world-class walker, while another seed—identical in every other way—results in a heap of pixels that never learns to move. This "high variance" makes RL research notoriously difficult to reproduce and creates a massive safety barrier for real-world applications like robotics or medical testing.
The common wisdom is that RL is just inherently unstable due to noisy environments or "bad" initializations. This paper challenges that assumption. The authors set out to find the root cause of these "outlier runs" (the ones that fail completely) and determine if we can engineer them out of existence.
Methods
The researchers used DRQv2, a state-of-the-art actor-critic algorithm, as their baseline. They systematically investigated and ruled out several common hypotheses for variance, including network initialization, initial exploration, and environment sensitivity.
Finding that none of those were the primary drivers, they turned to the network architecture itself. They discovered that variance is often driven by saturating nonlinearities. Specifically, if the activations before the final tanh layer become too large, the gradient vanishes (becomes near zero), and the agent stops learning entirely.
To fix this, they proposed three main modifications:
- Penultimate Normalization (pnorm): Normalizing the features right before the last layer of the actor and critic to unit norm. This prevents activations from exploding and keeps the
tanhfunction in its "active" (high-gradient) region. - Action Penalty: Adding a small squared loss to the pre-activation values to discourage the network from pushing actions into the saturated zones of the
tanhfunction. - Asymmetrically Clipped Double Q-learning: A tweak to the standard "Double Q" trick. While Double Q-learning prevents overestimation, it can be too "pessimistic" in sparse reward tasks. They suggest using the average of two critics for the target value while keeping the minimum for the actor update.
Datasets
The study utilizes the DeepMind Control Suite (dm-control), a standard benchmark for continuous control.
- Initial Analysis: Focused on 5 high-variance tasks: finger turn hard, walker walk, hopper hop, acrobot swingup, and reacher hard.
- Generalization: Evaluated the final "combined" agent across 21 different tasks categorized as easy or medium to ensure the fixes weren't just over-fitting to one specific problem.
Key Insights and Ideas
- The "Outlier" Discovery: Variance in RL isn't just "noise" around a mean; it is heavily weighted by runs that fail catastrophically in the first few episodes and never recover.
- Initialization isn't the Boogeyman: Surprisingly, the specific random weights at the start or the initial random actions have very little correlation with final performance. A "bad start" doesn't doom a run; a "stuck gradient" does.
- The Tanh Trap: Most continuous control agents use a
tanhactivation to bound actions between -1 and 1. If the input to this layer is too large, the gradient is effectively zero. The agent becomes "blind" and cannot update its policy, leading to the flat-line failure runs we often see. - Stability is a Free Lunch (Sometimes): Usually, we expect a trade-off between stability and performance. Here, increasing stability actually increased average rewards because it eliminated the "zero-score" outlier runs that were dragging the average down.
Key Results
- Massive Variance Reduction: By combining their fixes, the authors reduced the average standard deviation across 21 tasks by a factor of >3.
- Order of Magnitude Improvements: In specific tasks like Walker, the variance decreased by more than an order of magnitude.
- Higher Performance: The "Combined" agent achieved an average reward of 594.0 across the benchmark, compared to 404.8 for the state-of-the-art baseline.
- Learning Rate Robustness: The stabilized agents could tolerate much higher learning rates (e.g., 1e-3) that caused the baseline agent to fail completely.
Limitations and Future Work
- Algorithm Specificity: The study focuses on DRQv2 (an actor-critic method). While the logic of saturating nonlinearities is general, the effectiveness of these specific fixes might vary for other architectures like PPO or SAC.
- Hyperparameter Variance: The paper addresses variance across random seeds but does not deeply explore variance caused by hyperparameter sensitivity, which remains a major challenge in the field.
- Complexity: While the fixes are only a few lines of code, they do add more components to the RL "recipe," which the authors acknowledge increases agent complexity.
The authors conclude that low-variance agents are a reachable goal, and that the RL community should stop treating high variance as an unavoidable tax and start treating it as a bug that can be fixed.
Summary updated