arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.09685cs.CLcs.AIcs.LG
收藏

LoRA:大语言模型的低秩适应

LoRA: Low-Rank Adaptation of Large Language Models

Microsoft Corporation(微软公司)

Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen

摘要:

自然语言处理的一个重要范例包括对一般领域数据的大规模预训练和对特定任务或领域的适应。当我们预训练更大的模型时,重新训练所有模型参数的完全微调变得不太可行。以GPT-3 175 B为例--部署微调模型的独立实例,每个实例都有175 B个参数,这是非常昂贵的。我们提出了低秩适应,简称LoRA),它冻结了预先训练的模型权重,并将可训练的秩分解矩阵注入到Transformer架构的每一层中,大大减少了下游任务的可训练参数数量。与使用Adam微调的GPT-3 175 B相比,LoRA可以将可训练参数的数量减少10,000倍,并将GPU内存需求减少3倍。LoRA在RoBERTa、DeBERTa、GPT-2和GPT-3上的模型质量表现相当或优于微调,尽管可训练参数更少,训练吞吐量更高,而且与适配器不同,没有额外的推理延迟。我们还提供了一个实证调查等级不足的语言模型适应,揭示了LoRA的有效性。我们发布了一个软件包,可以促进LoRA与PyTorch模型的集成,并在https://github.com/microsoft/LoRA上为RoBERTa,DeBERTa和GPT-2提供我们的实现和模型检查点。

英文摘要:

An important paradigm of natural language processing consists of large-scale pre-training on general domain data and adaptation to particular tasks or domains. As we pre-train larger models, full fine-tuning, which retrains all model parameters, becomes less feasible. Using GPT-3 175B as an example -- deploying independent instances of fine-tuned models, each with 175B parameters, is prohibitively expensive. We propose Low-Rank Adaptation, or LoRA, which freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture, greatly reducing the number of trainable parameters for downstream tasks. Compared to GPT-3 175B fine-tuned with Adam, LoRA can reduce the number of trainable parameters by 10,000 times and the GPU memory requirement by 3 times. LoRA performs on-par or better than fine-tuning in model quality on RoBERTa, DeBERTa, GPT-2, and GPT-3, despite having fewer trainable parameters, a higher training throughput, and, unlike adapters, no additional inference latency. We also provide an empirical investigation into rank-deficiency in language model adaptation, which sheds light on the efficacy of LoRA. We release a package that facilitates the integration of LoRA with PyTorch models and provide our implementations and model checkpoints for RoBERTa, DeBERTa, and GPT-2 at https://github.com/microsoft/LoRA.

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

↑