arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.04415cs.LG
收藏

为什么现代深度学习需要权重衰减?

Why Do We Need Weight Decay in Modern Deep Learning?

EPFL(洛桑联邦理工学院)

Francesco D'Angelo, Maksym Andriushchenko, Aditya Varre, Nicolas Flammarion

AI总结:

本文揭示权重衰减在现代深度学习中的角色并非显式正则化,而是通过改变训练动态(如损失稳定和偏差-方差权衡)提升性能,从视觉ResNet到LLMs统一解释其作用。

摘要:

权重衰减是一种广泛使用的技术,用于训练从图像分类到大型语言模型的最先进的深度网络。尽管其使用广泛且在经典文献中已被深入研究,但其在深度学习中的作用仍未被充分理解。在这项工作中,我们强调权重衰减在现代深度学习中的作用不同于其在经典学习理论中研究的正则化效果。对于在视觉任务上使用多遍SGD训练的深度网络,我们展示了权重衰减如何通过损失稳定机制修改优化动态,增强SGD中始终存在的隐式正则化。相比之下,对于使用近单遍训练的大型语言模型,我们描述了权重衰减如何平衡随机优化中的偏差-方差权衡,从而降低训练损失并提高训练稳定性。总体而言,我们从视觉任务上的ResNet到LLMs提出了一个统一视角:权重衰减从来不是作为显式正则化器有用,而是以期望的方式改变训练动态。代码可在https://github.com/tml-epfl/why-weight-decay获取。

英文摘要:

Weight decay is a broadly used technique for training state-of-the-art deep networks from image classification to large language models. Despite its widespread usage and being extensively studied in the classical literature, its role remains poorly understood for deep learning. In this work, we highlight that the role of weight decay in modern deep learning is different from its regularization effect studied in classical learning theory. For deep networks on vision tasks trained with multipass SGD, we show how weight decay modifies the optimization dynamics enhancing the ever-present implicit regularization of SGD via the loss stabilization mechanism. In contrast, for large language models trained with nearly one-epoch training, we describe how weight decay balances the bias-variance tradeoff in stochastic optimization leading to lower training loss and improved training stability. Overall, we present a unifying perspective from ResNets on vision tasks to LLMs: weight decay is never useful as an explicit regularizer but instead changes the training dynamics in a desirable way. The code is available at https://github.com/tml-epfl/why-weight-decay

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑