Abstract
Recent years have witnessed significant progresses in deep Reinforcement Learning (RL). Empowered with large scale neural networks, carefully designed architectures, novel training algorithms and massively parallel computing devices, researchers are able to attack many challenging RL problems. However, in machine learning, more training power comes with a potential risk of more overfitting. As deep RL techniques are being applied to critical problems such as healthcare and finance, it is important to understand the generalization behaviors of the trained agents. In this paper, we conduct a systematic study of standard RL agents and find that they could overfit in various ways. Moreover, overfitting could happen "robustly": commonly used techniques in RL that add stochasticity do not necessarily prevent or detect overfitting. In particular, the same agents and learning algorithms could have drastically different test performance, even when all of them achieve optimal rewards during training. The observations call for more principled and careful evaluation protocols in RL. We conclude with a general discussion on overfitting in RL and a study of the generalization behaviors from the perspective of inductive bias.
Introduction
In supervised learning, the protocol for evaluating generalization is well-established: data is split into training, validation, and test sets. In Reinforcement Learning (RL), however, these boundaries are frequently blurred. Agents are often trained and evaluated on the same environment, with the assumption that inherent stochasticity—such as random starts or "sticky actions"—will naturally force the agent to learn generalizable skills rather than memorizing specific sequences. This study investigates the validity of this assumption, exploring whether deep RL agents are truly learning tasks or simply memorizing environments.
Experimental Methodology
To systematically study generalization, the researchers utilized the Asynchronous Actor-Critic (A3C) algorithm within a custom-built, configurable 2D gridworld maze environment. Unlike standard benchmarks like Atari, this environment allows for an explicit separation of training and testing levels based on random seeds.
The study employed three maze configurations:
- BASIC: A simple 9x9 empty room.
- BLOCKS: A 13x13 room containing random single-block obstacles.
- TUNNEL: A 13x13 room with complex corridors.
By varying the number of training levels from 10 to 10,000, the authors could precisely measure the relationship between training set diversity and generalization performance.
Results: The Generalization Gap and Memorization
The experiments revealed a significant "generalization gap." Agents trained on a small number of levels (10 or 100) quickly achieved optimal rewards on their training sets but failed almost entirely when presented with unseen test levels. Significant generalization only emerged when the training set size reached 1,000 levels or more.
Furthermore, the study demonstrated the immense memorization capacity of deep neural networks in RL. By randomly flipping the signs of rewards in training levels (effectively turning rewards into noise), the researchers found that agents could still "solve" the training mazes. This confirms that agents can achieve high rewards through pure memorization of state-reward associations, independent of any underlying task logic.
Robust Overfitting and Stochasticity
A key finding of this research is that overfitting in RL is "robust." While overfitting is often characterized as a brittle state, deep RL agents can learn "soft lookup tables" that remain resilient to local perturbations. Common techniques intended to prevent overfitting, such as "sticky actions" (where the environment repeats the previous action with a certain probability), were found to be ineffective. Agents could overfit so thoroughly that their training performance remained high despite the added noise, while their test performance remained near zero. This suggests that environment stochasticity is a poor proxy for true generalization.
Conclusion
The study highlights that achieving optimal rewards during training is an insufficient metric for agent performance. The massive capacity of deep networks to memorize environments necessitates more rigorous evaluation protocols. The authors recommend that the RL community move away from relying on stochasticity as a measure of robustness and instead adopt strict held-out test environments to certify generalization.
Summary updated