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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Lv, Kai, Yang, Yuqing, Liu, Tengxiao, Gao, Qinghui, Guo, Qipeng, Qiu, Xipeng
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911906820784128
author Lv, Kai
Yang, Yuqing
Liu, Tengxiao
Gao, Qinghui
Guo, Qipeng
Qiu, Xipeng
author_facet Lv, Kai
Yang, Yuqing
Liu, Tengxiao
Gao, Qinghui
Guo, Qipeng
Qiu, Xipeng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2306_09782
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Full Parameter Fine-tuning for Large Language Models with Limited Resources
Lv, Kai
Yang, Yuqing
Liu, Tengxiao
Gao, Qinghui
Guo, Qipeng
Qiu, Xipeng
Computation and Language
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.
title Full Parameter Fine-tuning for Large Language Models with Limited Resources
topic Computation and Language
url https://arxiv.org/abs/2306.09782