techlist.io

Overfitting

2 posts

OpenAI2019-12-042 min readCurated summary

Deep double descent

# Deep Double Descent OpenAI's research shows that the double descent phenomenon appears in modern deep learning architectures, including CNNs, ResNets, and transformers. Performance first improves, then worsens, then improves again as model size, data size, or training time increases. The effect is often hidden by careful regularization. The authors do not yet fully understand why it happens and call further study an important research direction. ## Model-wise Double Descent Test error follows a non-monotonic curve as parameter count grows, which contradicts both classical statistics ("larger models overfit") and the modern view that bigger is always better. - Test error decreases, rises, and then decreases again as the number of parameters increases. - The peak occurs at the "critical regime" (the interpolation threshold), where the model is just barely able to fit the training set. - Changes that move the interpolation threshold, such as the optimizer, the number of training samples, or the amount of label noise, move the test error peak with it. - The effect is most visible with added label noise. Without it, the peak is smaller and easy to miss. ## Sample-wise Non-monotonicity Adding more training data can make performance worse. - In transformer experiments on a language-translation task without label noise, more samples generally lower the test error curve. - More samples also require larger models to fit, which shifts the interpolation threshold and its test error peak to the right. - For intermediate model sizes, these two effects combine, and training on 4.5x more samples actually hurts test performance. ## Epoch-wise Double Descent The double descent pattern also appears over training time for a fixed model size. - As training proceeds, test and train error decrease, increase, and decrease again. - The peak again appears when the model is just barely able to fit the training set. - The authors' intuition is that at the interpolation threshold, only one model fits the training data, and forcing it to fit slightly noisy labels destroys its global structure. - In the over-parameterized regime, many models fit the training set, and some of them generalize well. The implicit bias of stochastic gradient descent appears to steer training toward these models, though the authors do not yet understand why. ## Practical Takeaway Regularization and early stopping can hide the peak, so practitioners should not assume that more data, larger models, or longer training always helps. Performance can degrade in the critical regime before it recovers.

OpenAI2018-12-053 min readCurated summary

Quantifying generalization in reinforcement learning

# Quantifying Generalization in Reinforcement Learning OpenAI introduces CoinRun, a procedurally generated platformer environment that measures how well reinforcement learning agents transfer their experience to unseen levels. The authors show that RL agents overfit heavily to their training levels, even when trained on thousands of them, and that common supervised-learning regularization techniques can meaningfully reduce this gap. CoinRun gives the research community a simple, quantifiable benchmark for evaluating generalization. ## The Generalization Problem - RL agents can solve complex tasks but struggle to transfer skills to new environments. - Benchmarks typically test agents on the same environments they trained on, which is comparable to evaluating on the training set in supervised learning. - Earlier benchmarks (the Sonic benchmark, procedurally generated gridworld mazes, and the General Video Game AI framework) showed similar overfitting. Sonic agents performed well on training levels but poorly on test levels without fine-tuning, maze agents memorized large numbers of training levels, and GVG-AI agents failed on difficulty settings they had not seen during training. ## CoinRun Environment Design - Levels are procedurally generated, giving agents a large, easily quantifiable supply of training data. - The goal is to collect a single coin at the end of each level while avoiding stationary and non-stationary obstacles. - Touching an obstacle causes immediate death. The only reward is a fixed positive constant for collecting the coin. - Episodes end on death, coin collection, or after 1000 time steps. - The environment is deliberately simpler than Sonic but still challenging for state-of-the-art algorithms. ## Measuring Overfitting - Nine agents were trained with Proximal Policy Optimization for 256M timesteps, each on a different number of levels: eight fixed sets ranging from 100 to 16,000 levels, and one on an unrestricted set where it never saw the same level twice (roughly 2 million distinct levels). - Each agent used a 3-layer convolutional architecture called Nature-CNN. Performance was averaged over 10,000 test episodes on unseen levels. - Substantial overfitting appeared with fewer than 4,000 training levels and persisted even at 16,000. - Agents trained on the unrestricted set performed best. - The IMPALA-CNN architecture generalized noticeably better than Nature-CNN across all training set sizes. ## Regularization Techniques Experiments used a fixed set of 500 levels, which the authors recommend as a shared benchmark: - **Dropout and L2 regularization:** Both reduced the generalization gap, with L2 having the larger effect. - **Data augmentation and batch normalization:** A modified Cutout augmentation and batch normalization both significantly improved generalization. - **Environmental stochasticity:** Training with stochastic environments improved generalization more than any of the other techniques. - The authors note that RL policies are often trained without these supervised-learning methods, but in this setting they helped, indicating that earlier policies were overfitting to particular MDPs. ## Additional Environments - **CoinRun-Platforms:** A variant where several coins are scattered across platforms in a larger, fixed-size level. Agents must explore more and sometimes retrace their steps. Trained with 2B timesteps using the IMPALA-CNN followed by an LSTM. - **RandomMazes:** A simple maze navigation environment that also uses an LSTM, since memory is needed. - Both environments showed strong overfitting under the baseline setup. RandomMazes was especially severe, with a large generalization gap remaining even at 20,000 training levels. ## Future Directions The authors suggest several research questions: - How environment complexity relates to the number of training levels needed for good generalization - Whether different recurrent architectures generalize better in these environments - How to combine multiple regularization methods effectively