Full Parameter Fine-tuning for Large Language Models with Limited Resources

Kai Lv, Yuqing Yang, Tengxiao Liu, Qinghui Gao, Qipeng Guo +1 more
6/16/2023
cs.CL

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

Abstract

Large Language Models (LLMs) have revolutionized Natural Language Processing (NLP) but demand massive GPU resources for training. Lowering the threshold for LLMs training would encourage greater participation from researchers, benefiting both academia and society. While existing approaches have focused on parameter-efficient fine-tuning, which tunes or adds a small number of parameters, few have addressed the challenge of tuning the full parameters of LLMs with limited resources. In this work, we propose a new optimizer, LOw-Memory Optimization (LOMO), which fuses the gradient computation and the parameter update in one step to reduce memory usage. By integrating LOMO with existing memory saving techniques, we reduce memory usage to 10.8% compared to the standard approach (DeepSpeed solution). Consequently, our approach enables the full parameter fine-tuning of a 65B model on a single machine with 8 RTX 3090, each with 24GB memory.Code and data are available 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{lv2023full,
  title  = {Full Parameter Fine-tuning for Large Language Models with Limited Resources},
  author = {Kai Lv and Yuqing Yang and Tengxiao Liu and Qinghui Gao and Qipeng Guo and Xipeng Qiu},
  year   = {2023},
  eprint = {2306.09782},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.09782v2}
}

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/2306.09782.svg)](https://codeofpaper.com/paper/2306.09782)

Discussion