arXiv:2412.06289cs.LGcs.AI2024-12NeurIPS被引 13

通过结构化稀疏提升大模型微调效率与泛化能力

S$^{2}$FT: Efficient, Scalable and Generalizable LLM Fine-tuning by Structured Sparsity

  • 选择性激活注意力头和前馈通道,结合权重重排形成密集子矩阵
  • 相比LoRA平均提升10%,在常识与算术推理上优于全参数微调11.5%
  • 支持多模型快速切换与并行部署,训练内存减少3倍,延迟降低1.5-2.7倍

当前大模型参数高效微调方法难以同时实现高质量、训练高效与推理可扩展。为此,我们研究结构化稀疏微调,发现其显著提升泛化能力。提出S²FT方法,通过‘稀疏选择、密集计算’实现三者兼得:在每个Transformer层中分别选取少量注意力头和前馈通道,对耦合结构两侧的权重矩阵进行协同重排,将选中的组件连接成密集子矩阵,并在子矩阵上就地更新梯度。理论与实证表明,该方法有效防止遗忘,简化优化过程,在常识与算术推理任务上分别比LoRA提升4.6%和1.3%,指令微调后在跨域泛化上超越全参数微调11.5%。采用部分反向传播算法,训练内存节省最高达3倍,推理延迟降低1.5-2.7倍,且平均性能优于LoRA 10%。进一步证明,权重更新可解耦为适配器,支持模型融合、快速切换与高效并行服务。

原文摘要 · Abstract (English)

Current PEFT methods for LLMs can achieve either high quality, efficient training, or scalable serving, but not all three simultaneously. To address this limitation, we investigate sparse fine-tuning and observe a remarkable improvement in generalization ability. Utilizing this key insight, we propose a family of Structured Sparse Fine-Tuning (S$^{2}$FT) methods for LLMs, which concurrently achieve state-of-the-art fine-tuning performance, training efficiency, and inference scalability. S$^{2}$FT accomplishes this by "selecting sparsely and computing densely". It selects a few heads and channels in the MHA and FFN modules for each Transformer block, respectively. Next, it co-permutes weight matrices on both sides of the coupled structures in LLMs to connect the selected components in each layer into a dense submatrix. Finally, S$^{2}$FT performs in-place gradient updates on all submatrices. Through theoretical analysis and empirical results, our method prevents forgetting while simplifying optimization, delivers SOTA performance on both commonsense and arithmetic reasoning with 4.6% and 1.3% average improvements compared to LoRA, and surpasses full FT by 11.5% when generalizing to various domains after instruction tuning. Using our partial backpropagation algorithm, S$^{2}$FT saves training memory up to 3$\times$ and improves latency by 1.5-2.7$\times$ compared to full FT, while delivering an average 10% improvement over LoRA on both metrics. We further demonstrate that the weight updates in S$^{2}$FT can be decoupled into adapters, enabling effective fusion, fast switch, and efficient parallelism for serving multiple fine-tuned models.

大模型微调稀疏训练高效推理适配器

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。