AdaLomo: Low-memory Optimization with Adaptive Learning Rate

Kai Lv, Hang Yan, Qipeng Guo, Haijun Lv, Xipeng Qiu
10/16/2023
cs.LGcs.CL

Official code: OpenLMLab/LOMO (993 stars, MIT, last commit 2024-07-02).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

OpenLMLab/LOMOOfficial100%
MIT

LOMO: LOw-Memory Optimization

99368Shell, PythonJun 16, 20232 years agoMIT

Similar Papers

Cite this paper

@article{lv2023adalomo,
  title  = {AdaLomo: Low-memory Optimization with Adaptive Learning Rate},
  author = {Kai Lv and Hang Yan and Qipeng Guo and Haijun Lv and Xipeng Qiu},
  year   = {2023},
  eprint = {2310.10195},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.10195v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.10195.svg)](https://codeofpaper.com/paper/2310.10195)

Discussion