Return-based Scaling: Yet Another Normalisation Trick for Deep RL

Tom Schaul, Georg Ostrovski, Iurii Kemaev, Diana BorsaarXiv 2021

Abstract

Scaling issues are mundane yet irritating for practitioners of reinforcement learning. Error scales vary across domains, tasks, and stages of learning; sometimes by many orders of magnitude. This can be detrimental to learning speed and stability, create interference between learning tasks, and necessitate substantial tuning. We revisit this topic for agents based on temporal-difference learning, sketch out some desiderata and investigate scenarios where simple fixes fall short. The mechanism we propose requires neither tuning, clipping, nor adaptation. We validate its effectiveness and robustness on the suite of Atari games. Our scaling method turns out to be particularly helpful at mitigating interference, when training a shared neural network on multiple targets that differ in reward scale or discounting.

Introduction: The Scaling Challenge in Reinforcement Learning

In supervised learning, data normalization (often called "whitening") is a standard practice to ensure stable training by scaling inputs to zero mean and unit variance. However, Reinforcement Learning (RL) presents a unique challenge: the targets the agent tries to predict—future returns—are non-stationary, shifting as the agent's policy improves.

This leads to extreme variations in signal scales. As illustrated in the figure below, metrics such as score, reward magnitude, and episode length can vary by several orders of magnitude not only between different games but also between the early and late stages of training within a single task.

Variation in reward and episode statistics across early and late stages of learning in Atari games, highlighting the massive shifts in scale that RL agents must navigate.

These scaling issues manifest in three primary ways:

  1. Hyperparameter Sensitivity: Learning rates that work for one task might be too aggressive or too slow for another due to differing reward magnitudes.
  2. Interference: In multi-head architectures (e.g., predicting multiple discount factors), heads with larger numerical scales dominate gradients, effectively drowning out the learning signals of others.
  3. Instability: Sudden "reward spikes" can cause gradients to explode, leading to catastrophic forgetting.

Proposed Method: Return-based Scaling

The authors introduce Return-based Scaling, a parameter-free normalization technique. Instead of using the raw Temporal Difference (TD) error ($\delta_t$), the learning signal is divided by an adaptive scale factor $\sigma$: $$\bar{\delta}_t := \frac{\delta_t}{\sigma}$$

The core contribution is the derivation of $\sigma$ from problem-side statistics rather than agent-side predictions, which ensures high stability. By analyzing the variance of TD errors during the transient phase of learning, the authors propose: $$\sigma^2 := \mathbb{V}[R] + \mathbb{V}[\gamma]\mathbb{E}[G^2]$$ Where:

  • $\mathbb{V}[R]$ is the variance of rewards.
  • $\mathbb{V}[\gamma]$ captures the variance in the discount factor (crucial for handling episode boundaries).
  • $\mathbb{E}[G^2]$ is the second moment of the returns.

This method is agent-agnostic and requires no manual tuning, clipping, or complex adaptation mechanisms.

Experimental Results and Insights

The researchers validated their method using the Atari 57 benchmark, which represents a massive diversity of reward scales and densities.

Mitigating Multi-Head Interference

A key finding involves agents with multiple "heads" predicting values for different time horizons. Without scaling, the head with the highest discount factor (and thus the largest return scale) dictates the network's updates. Return-based scaling levels the playing field, allowing the agent to learn effectively from all objectives simultaneously. In tests with a 10-head R2D2 agent, this led to a massive performance increase over unscaled baselines.

The Role of Optimizers

The study found that the popular Adam optimizer already performs a form of "implicit" normalization for single-head agents. This explains why scaling issues might have been overlooked in previous research—the optimizer was quietly masking the problem. However, Adam's internal scaling is often insufficient for multi-head setups or extreme non-stationarity.

Stability and Robustness

Unlike adaptive methods like Pop-Art, which track recent statistics and can collapse during sudden reward shifts (such as the score reset in Asterix), Return-based Scaling uses "all-time" statistics. This design choice prioritizes long-term stability over rapid adaptation. Furthermore, the method helps solve "offset" problems in games like Skiing, where large negative rewards typically delay the agent's realization of the baseline value; by using return statistics to initialize the network's bias, agents reach human-level performance much faster.

Conclusion

Return-based Scaling offers a robust, parameter-free solution to the pervasive problem of reward scaling in RL. By standardizing the TD error using fundamental return statistics, it enables more stable training and more effective multi-objective learning. Future work may explore "whitening" across correlated heads and the interaction between this scaling method and various regularization techniques like L2 loss.

Summary updated

BibTeX
@misc{schaul2021return,
  author = {Tom Schaul and Georg Ostrovski and Iurii Kemaev and Diana Borsa},
  title = {{Return-based Scaling: Yet Another Normalisation Trick for Deep RL}},
  year = {2021},
  eprint = {2105.05347},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.05347},
}
Figure