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

AdaLomo:具有自适应学习率的低内存优化

AdaLomo: Low-memory Optimization with Adaptive Learning Rate

School of Computer Science, Fudan University(复旦大学计算机科学学院);Shanghai AI Laboratory(上海人工智能实验室)

Kai Lv, Hang Yan, Qipeng Guo, Haijun Lv, Xipeng Qiu

AI总结:

AdaLomo通过为每个参数引入自适应学习率、用非负矩阵分解压缩二阶矩状态并采用分组更新归一化,在保持低内存的同时达到AdamW水平的训练性能。

摘要:

大型语言模型已取得显著成功,但其庞大的参数规模使得训练需要大量内存,从而设置了很高的门槛。虽然最近提出的低内存优化(LOMO)减少了内存占用,但其优化技术与随机梯度下降类似,对超参数敏感且收敛性欠佳,未能达到大型语言模型主流优化器AdamW的性能。通过对Adam优化器的实证分析,我们发现,与动量相比,自适应学习率对于弥合这一差距更为关键。基于这一认识,我们提出了具有自适应学习率的低内存优化(AdaLomo),它为每个参数提供自适应学习率。为了保持内存效率,我们在优化器状态中采用非负矩阵分解进行二阶矩估计。此外,我们建议使用分组更新归一化来稳定收敛。我们在指令微调和进一步预训练上的实验表明,AdaLomo取得了与AdamW相当的结果,同时显著降低了内存需求,从而降低了训练大型语言模型的硬件门槛。代码可在https://github.com/OpenLMLab/LOMO获取。

英文摘要:

Large language models have achieved remarkable success, but their extensive parameter size necessitates substantial memory for training, thereby setting a high threshold. While the recently proposed low-memory optimization (LOMO) reduces memory footprint, its optimization technique, akin to stochastic gradient descent, is sensitive to hyper-parameters and exhibits suboptimal convergence, failing to match the performance of the prevailing optimizer for large language models, AdamW. Through empirical analysis of the Adam optimizer, we found that, compared to momentum, the adaptive learning rate is more critical for bridging the gap. Building on this insight, we introduce the low-memory optimization with adaptive learning rate (AdaLomo), which offers an adaptive learning rate for each parameter. To maintain memory efficiency, we employ non-negative matrix factorization for the second-order moment estimation in the optimizer state. Additionally, we suggest the use of a grouped update normalization to stabilize convergence. Our experiments with instruction-tuning and further pre-training demonstrate that AdaLomo achieves results on par with AdamW, while significantly reducing memory requirements, thereby lowering the hardware barrier to training large language models. The code is accessible at https://github.com/OpenLMLab/LOMO.

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

↑