2025-02-20 · 进阶 · 自然语言处理 · 机器学习

Train Small, Infer Large: Memory-Efficient LoRA Training for Large Language Models

该论文提出了一种名为LORAM的内存高效的LoRA训练方案,通过训练一个修剪的小型模型来减少大语言模型的内存占用,同时保持推理性能。

更新于 2025-02-20。作者:Jun Zhang、Jue Wang、Huan Li、Lidan Shou、Ke Chen、Yang You、Guiming Xie、Xuejian Gong、Kunlong Zhou。

中文摘要

大型语言模型(LLMs)在自然语言处理领域取得了显著进步,具有卓越的任务泛化能力。低秩适配(LoRA)提供了一种成本效益高的微调解决方案,通过冻结原始模型参数,仅训练轻量级的低秩适配矩阵。然而,LoRA的内存占用主要受原始模型参数的影响。为了缓解这一问题,我们提出了LoRAM,这是一种基于以下直觉的内存高效LoRA训练方案:在过度参数化的LLMs中,许多神经元在训练中的效用较低,但对于推理却是必不可少的。LoRAM提出了一个独特的思路:在修剪(小型)模型上进行训练,以获得修剪的低秩矩阵,然后恢复并利用原始(大型)模型进行推理。此外,由模型发布者在事先进行的低成本持续预训练,使修剪模型和原始模型之间的知识差异得到对齐。我们广泛的实验表明,LoRAM在各种修剪策略和下游任务中均表现出有效性。对于拥有700亿参数的模型,LoRAM允许在只有20G HBM的GPU上进行训练,取代了用于LoRA训练的A100-80G GPU和用于完全微调的15个GPU。具体来说,通过结构化修剪结合4位量化实现的QLoRAM,针对LLaMA-3.1-70B(LLaMA-2-70B),将低秩矩阵训练中占主导地位的参数存储成本降低了15.81倍(16.95倍),同时实现了相对于原始LLaMA-3.1-70B(LLaMA-2-70B)和LoRA训练的LLaMA-3.1-8B(LLaMA-2-13B)的显著性能提升。

英文摘要

Large Language Models (LLMs) have significantly advanced natural language processing with exceptional task generalization capabilities. Low-Rank Adaption (LoRA) offers a cost-effective fine-tuning solution, freezing the original model parameters and training only lightweight, low-rank adapter matrices. However, the memory footprint of LoRA is largely dominated by the original model parameters. To mitigate this, we propose LoRAM, a memory-efficient LoRA training scheme founded on the intuition that many neurons in over-parameterized LLMs have low training utility but are essential for inference. LoRAM presents a unique twist: it trains on a pruned (small) model to obtain pruned low-rank matrices, which are then recovered and utilized with the original (large) model for inference. Additionally, minimal-cost continual pre-training, performed by the model publishers in advance, aligns the knowledge discrepancy between pruned and original models. Our extensive experiments demonstrate the efficacy of LoRAM across various pruning strategies and downstream tasks. For a model with 70 billion parameters, LoRAM enables training on a GPU with only 20G HBM, replacing an A100-80G GPU for LoRA training and 15 GPUs for full fine-tuning. Specifically, QLoRAM implemented by structured pruning combined with 4-bit quantization, for LLaMA-3.1-70B (LLaMA-2-70B), reduces the parameter storage cost that dominates the memory usage in low-rank matrix training by 15.81times (16.95times), while achieving dominant performance gains over both the original LLaMA-3.1-70B (LLaMA-2-70B) and LoRA-trained LLaMA-3.1-8B (LLaMA-2-13B).

解读

一句话总结

该论文提出了一种名为LORAM的内存高效的LoRA训练方案,通过训练一个修剪的小型模型来减少大语言模型的内存占用,同时保持推理性能。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt