Table of Contents
Fetching ...

AdaLomo: Low-memory Optimization with Adaptive Learning Rate

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

TL;DR

AdaLomo addresses the memory bottleneck of training large language models by introducing per-parameter adaptive learning rates built on a factorized second-moment estimate. By storing the second moment as a non-negative matrix factorization (r_i, c_i) and employing grouped update normalization, AdaLomo achieves memory usage near LoRA while approaching AdamW's convergence and performance. The approach is validated across instruction-tuning, Chinese and Python-domain further pre-training, and scratch pre-training, with memory and throughput profiling showing favorable efficiency trade-offs. The work highlights the critical role of the second moment in optimization for transformers and outlines practical implications for democratizing access to large-scale language-model training.

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.

AdaLomo: Low-memory Optimization with Adaptive Learning Rate

TL;DR

AdaLomo addresses the memory bottleneck of training large language models by introducing per-parameter adaptive learning rates built on a factorized second-moment estimate. By storing the second moment as a non-negative matrix factorization (r_i, c_i) and employing grouped update normalization, AdaLomo achieves memory usage near LoRA while approaching AdamW's convergence and performance. The approach is validated across instruction-tuning, Chinese and Python-domain further pre-training, and scratch pre-training, with memory and throughput profiling showing favorable efficiency trade-offs. The work highlights the critical role of the second moment in optimization for transformers and outlines practical implications for democratizing access to large-scale language-model training.

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.
Paper Structure (28 sections, 6 equations, 10 figures, 8 tables, 1 algorithm)

This paper contains 28 sections, 6 equations, 10 figures, 8 tables, 1 algorithm.

Figures (10)

  • Figure 1: Empirical analysis on different optimization methods. Both Adam and SGD with variance exhibit a stepwise decline in loss as the training epochs increase, ultimately achieving a lower loss than both SGD and SGD with momentum.
  • Figure 2: Results of further pre-training in the Chinese domain.
  • Figure 3: Results of further pre-training in the Python code domain.
  • Figure 4: Results of pre-training LLaMA-1.1B from scratch on C4 corpus.
  • Figure 5: Memory footprint and throughput using different optimization methods.
  • ...and 5 more figures