
摘要
自然语言处理领域的一个重要范式是:在通用领域数据上进行大规模预训练,随后将模型适配至特定任务或领域。随着预训练模型规模的不断增大,传统全量微调(即重新训练模型所有参数)的方式变得日益不可行。以 GPT-3 175B 为例,若为每个下游任务部署独立的微调实例,每个模型均包含 1750 亿参数,其计算与存储成本将难以承受。为此,我们提出低秩适配(Low-Rank Adaptation,简称 LoRA),该方法冻结预训练模型的原始权重,并在 Transformer 架构的每一层中注入可训练的低秩分解矩阵,从而显著减少下游任务所需的可训练参数数量。与使用 Adam 优化器对 GPT-3 175B 进行全量微调相比,LoRA 可将可训练参数数量减少 10,000 倍,同时降低 GPU 显存占用约 3 倍。尽管可训练参数更少,LoRA 在 RoBERTa、DeBERTa、GPT-2 和 GPT-3 等多个模型上的性能表现与全量微调相当,甚至更优;同时具备更高的训练吞吐率,且与适配器(adapters)不同,LoRA 在推理阶段不引入额外延迟。此外,我们还对语言模型适配过程中的秩不足(rank-deficiency)现象进行了实证研究,为 LoRA 方法的有效性提供了理论与实践依据。我们已开源一个支持 LoRA 与 PyTorch 模型集成的工具包,并在 GitHub 上发布了 RoBERTa、DeBERTa 和 GPT-2 的实现代码及预训练模型检查点,详见:https://github.com/microsoft/LoRA。
代码仓库
mistralai/mistral-finetune
pytorch
GitHub 中提及
Owen-Oertell/rlcm
pytorch
GitHub 中提及
oseyosey/ccds
pytorch
GitHub 中提及
tloen/alpaca-lora
pytorch
GitHub 中提及
arielnlee/Platypus
pytorch
GitHub 中提及
lxe/simple-llama-finetuner
pytorch
GitHub 中提及
vivo-ai-lab/bluelm
pytorch
GitHub 中提及
teelinsan/camoscio
pytorch
GitHub 中提及
zhaolingao/langptune
pytorch
GitHub 中提及
lif31up/attention-is-all-you-need
pytorch
GitHub 中提及
microsoft/LoRA
官方
jax
GitHub 中提及
theodb/asr-whisper-finetuning
pytorch
GitHub 中提及
davisyoshida/lorax
jax
GitHub 中提及
yjiangcm/lte
pytorch
GitHub 中提及
lighterswang/biomedclip-lora
pytorch
GitHub 中提及
internlm/xtuner
pytorch
GitHub 中提及
hiyouga/llama-efficient-tuning
pytorch
GitHub 中提及
mistralai/mistral-src
pytorch
GitHub 中提及
phoebussi/alpaca-cot
pytorch
GitHub 中提及
sultan-hassan/CosmoGemma
GitHub 中提及
chenlicodebank/lora_on_analog_hardware
pytorch
GitHub 中提及
flowersteam/lamorel
pytorch
GitHub 中提及
ZhangYuanhan-AI/NOAH
tf
GitHub 中提及
ykwon0407/datainf
pytorch
GitHub 中提及
zhanglab-aim/lingo
pytorch
GitHub 中提及
wwxu21/cut
pytorch
GitHub 中提及
durham/rwkv-finetune-script
pytorch
GitHub 中提及
ikergarcia1996/sequence-labeling-llms
pytorch
GitHub 中提及
flagai-open/aquila2
pytorch
GitHub 中提及
pytorch/opacus
pytorch
GitHub 中提及
QwenLM/Qwen-7B
pytorch
GitHub 中提及
pilancilab/caldera
pytorch
GitHub 中提及
h2oai/alpaca-lora
pytorch
GitHub 中提及
zjunlp/trice
pytorch
GitHub 中提及
pilancilab/Riemannian_Preconditioned_LoRA
pytorch
GitHub 中提及
Luohh5/Chain-of-Exemplar
pytorch
GitHub 中提及
brandon3964/multimodal-task-vector
pytorch
GitHub 中提及
gt-ripl/selective-projection-decay
pytorch
GitHub 中提及
tatsu-lab/stanford_alpaca
pytorch
GitHub 中提及
song-wx/sift
pytorch
GitHub 中提及
h2oai/h2o-llmstudio
pytorch
GitHub 中提及
hellokevin07/elastictrainer
tf
GitHub 中提及
facebookresearch/pytorch-dp
pytorch
GitHub 中提及
uds-lsv/llmft
pytorch
GitHub 中提及
thuml/AutoTimes
pytorch
GitHub 中提及
heekhero/DTL
pytorch
GitHub 中提及
mistralai/mistral-inference
pytorch
GitHub 中提及
mchl-labs/stambecco
GitHub 中提及
sunildkumar/lora_from_scratch
pytorch
GitHub 中提及
Davidzhangyuanhan/NOAH
tf
GitHub 中提及
liucongg/chatglm-finetuning
pytorch
GitHub 中提及
debjitpaul/refiner
pytorch
GitHub 中提及
longyuewangdcu/chinese-llama-2
jax
GitHub 中提及
dreamboat26/fuzzy-logic
pytorch
llamafamily/llama-chinese
pytorch
GitHub 中提及
google-deepmind/thunnini
jax
GitHub 中提及
Lightning-AI/lit-llama
pytorch
GitHub 中提及
aleemsidra/convlora
pytorch
GitHub 中提及
flagalpha/llama2-chinese
pytorch
GitHub 中提及
if001/rwkv-lm-lora-ja
pytorch
GitHub 中提及
hitz-zentroa/this-is-not-a-dataset
pytorch
GitHub 中提及
simula/pointdetectcount
pytorch
GitHub 中提及
KU-CVLAB/MoA
pytorch
GitHub 中提及
12kimih/hicupid
pytorch
GitHub 中提及
qwenlm/qwen
pytorch
GitHub 中提及
videocrafter/videocrafter
pytorch
GitHub 中提及
facico/chinese-vicuna
pytorch
GitHub 中提及
punica-ai/punica
pytorch
GitHub 中提及
yjiangcm/lion
pytorch
GitHub 中提及
clementromac/lamorel
pytorch
GitHub 中提及
lif31up/extended-BERT-for-low-rank-adaption
pytorch
GitHub 中提及
qwenlm/qwen-vl
pytorch
GitHub 中提及
基准测试
| 基准 | 方法 | 指标 |
|---|---|---|
| mathematical-reasoning-on-amc23 | Math-Master | Acc: 82 |
| parameter-efficient-fine-tuning-on-boolq | LLaMA2-7b | Accuracy (% ): 80.28 |
| parameter-efficient-fine-tuning-on-hellaswag | LLaMA2-7b | Accuracy (% ): 76.67 |
| parameter-efficient-fine-tuning-on-winogrande | LLaMA2-7b | Accuracy (% ): 69.85 |