arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2406.09723cs.LGcs.AI
收藏

梯度正则化何时会有害?

When Will Gradient Regularization Be Harmful?

Tsinghua University(清华大学)

Yang Zhao, Hao Zhang, Xiuyuan Hu

AI总结:

本文揭示梯度正则化在自适应优化与学习率预热下会导致梯度统计失稳,提出三种GR预热策略,并在Vision Transformer上验证其可显著提升性能。

摘要:

梯度正则化(GR)旨在在损失函数之上惩罚梯度范数,已在训练现代过参数化深度神经网络方面展现出良好效果。然而,我们能否信任这一强大技术?本文揭示,GR在自适应优化场景中会导致性能退化,尤其是在使用学习率预热时。我们的实证与理论分析表明,这是由于GR在训练初始阶段引发自适应优化器梯度统计的不稳定和发散。受预热启发式方法启发,我们提出三种GR预热策略,每种策略都在预热过程中一定程度上放松正则化效应,以确保梯度准确且稳定地累积。通过在Vision Transformer系列模型上的实验,我们证实三种GR预热策略能够有效规避这些问题,从而大幅提升模型性能。同时,我们注意到可扩展模型往往更依赖GR预热;在Cifar10上,与基线GR相比,其性能最高可提升3%。代码可在https://github.com/zhaoyang-0204/gnp获取。

英文摘要:

Gradient regularization (GR), which aims to penalize the gradient norm atop the loss function, has shown promising results in training modern over-parameterized deep neural networks. However, can we trust this powerful technique? This paper reveals that GR can cause performance degeneration in adaptive optimization scenarios, particularly with learning rate warmup. Our empirical and theoretical analyses suggest this is due to GR inducing instability and divergence in gradient statistics of adaptive optimizers at the initial training stage. Inspired by the warmup heuristic, we propose three GR warmup strategies, each relaxing the regularization effect to a certain extent during the warmup course to ensure the accurate and stable accumulation of gradients. With experiments on Vision Transformer family, we confirm the three GR warmup strategies can effectively circumvent these issues, thereby largely improving the model performance. Meanwhile, we note that scalable models tend to rely more on the GR warmup, where the performance can be improved by up to 3\% on Cifar10 compared to baseline GR. Code is available at \href{https://github.com/zhaoyang-0204/gnp}{https://github.com/zhaoyang-0204/gnp}.

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

↑