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

有限资源下的大语言模型全参数微调

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

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

Kai Lv, Yuqing Yang, Tengxiao Liu, Qinghui Gao, Qipeng Guo, Xipeng Qiu

AI总结:

本文提出低内存优化器LOMO,将梯度计算与参数更新融合以大幅降低内存占用,并结合现有内存节省技术,使65B大语言模型可在单机8块RTX 3090上完成全参数微调。

摘要:

大语言模型(LLMs)已经彻底改变了自然语言处理(NLP),但其训练需要大量GPU资源。降低LLMs训练门槛将鼓励更多研究者参与,使学术界和社会共同受益。现有方法主要关注参数高效微调,即只调整或新增少量参数,但很少有工作解决在有限资源下对LLMs全参数进行微调的难题。本文提出一种新的优化器——低内存优化(LOMO),它将梯度计算与参数更新融合在一步中,以降低内存占用。通过将LOMO与现有内存节省技术相结合,与标准方法(DeepSpeed方案)相比,我们将内存占用降低至10.8%。因此,我们的方法使得在一台配备8块RTX 3090(每块24GB显存)的机器上对65B模型进行全参数微调成为可能。代码和数据可在https://github.com/OpenLMLab/LOMO获取。

英文摘要:

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.

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

↑