arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2304.13013cs.LGcs.CV
收藏

大规模视觉-语言模型的稳定与低精度训练

Stable and low-precision training for large-scale vision-language models

University of Washington(华盛顿大学);Meta AI Research, FAIR Team(Meta AI研究院FAIR团队);Allen Institute for AI(艾伦人工智能研究所);LAION

Mitchell Wortsman, Tim Dettmers, Luke Zettlemoyer, Ari Morcos, Ali Farhadi, Ludwig Schmidt

AI总结:

本文提出加速与稳定大规模视觉-语言模型训练的新方法:SwitchBack线性层实现int8量化训练(加速13-25%,性能损失小于0.1%),并推荐AdamW-Adafactor混合优化器以避免损失尖峰。

摘要:

我们引入了新方法,用于1)加速和2)稳定大型语言-视觉模型的训练。1)对于加速,我们引入了SwitchBack,一种用于int8量化训练的线性层,在1B参数CLIP ViT-Huge模型上提供了13-25%的加速,同时与bfloat16训练的性能差距在0.1个百分点以内——这是迄今为止最大的int8训练。我们的主要关注点是int8,因为GPU对float8的支持很少,不过我们也通过模拟分析了float8训练。虽然SwitchBack对float8也证明有效,但我们表明,如果网络以抑制大特征幅度的方式进行训练和初始化,标准技术也能成功,我们通过用零初始化的层缩放来实现这一点。2)对于稳定性,我们分析了损失尖峰,发现它们总是出现在平方梯度被其AdamW二阶矩估计器低估后的1-8次迭代之后。因此,我们推荐一种AdamW-Adafactor混合方法,在训练CLIP ViT-Huge模型时避免损失尖峰,并且在我们测试的规模上优于梯度裁剪。

英文摘要:

We introduce new methods for 1) accelerating and 2) stabilizing training for large language-vision models. 1) For acceleration, we introduce SwitchBack, a linear layer for int8 quantized training which provides a speed-up of 13-25% while matching the performance of bfloat16 training within 0.1 percentage points for the 1B parameter CLIP ViT-Huge -- the largest int8 training to date. Our main focus is int8 as GPU support for float8 is rare, though we also analyze float8 training through simulation. While SwitchBack proves effective for float8, we show that standard techniques are also successful if the network is trained and initialized so that large feature magnitudes are discouraged, which we accomplish via layer-scale initialized with zeros. 2) For stability, we analyze loss spikes and find they consistently occur 1-8 iterations after the squared gradients become under-estimated by their AdamW second moment estimator. As a result, we recommend an AdamW-Adafactor hybrid which avoids loss spikes when training a CLIP ViT-Huge model and outperforms gradient clipping at the scales we test.

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

↑