arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.06289cs.LGcs.AI
收藏

S$^{2}$FT:基于结构化稀疏的高效、可扩展且可泛化的LLM微调

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

CMU(卡内基梅隆大学);Georgia Tech(佐治亚理工学院);Caltech(加州理工学院);Rutgers(罗格斯大学);UNC-Chapel Hill(北卡罗来纳大学教堂山分校)

Xinyu Yang, Jixuan Leng, Geyang Guo, Jiawei Zhao, Ryumei Nakada, Linjun Zhang, Huaxiu Yao, Beidi Chen

AI总结:

提出结构化稀疏微调方法S$^{2}$FT,通过“稀疏选择,密集计算”同时实现高效训练、可扩展推理与SOTA性能,在提升泛化能力的同时显著降低内存和延迟。

摘要:

当前针对LLM的PEFT方法只能分别实现高质量、高效训练或可扩展服务,无法同时兼顾三者。为解决这一局限,我们研究了稀疏微调,并观察到泛化能力的显著提升。利用这一关键洞察,我们提出了一系列面向LLM的结构化稀疏微调(S$^{2}$FT)方法,可同时实现最先进的微调性能、训练效率和推理可扩展性。S$^{2}$FT通过“稀疏选择,密集计算”来实现。它分别为每个Transformer块的MHA和FFN模块选择少量头和通道。接着,对LLM中耦合结构两侧的权重矩阵进行协同置换,将每层选中的组件连接成一个密集子矩阵。最后,S$^{2}$FT对所有子矩阵执行原位梯度更新。通过理论分析和实验结果,我们的方法在防止遗忘的同时简化了优化,在常识和算术推理上均取得了SOTA性能,相比LoRA平均提升了4.6%和1.3%,并在指令微调后泛化到各种领域时以11.5%的优势超越全量微调。使用我们的部分反向传播算法,与全量微调相比,S$^{2}$FT节省了高达3倍的训练内存,并将延迟改善了1.5-2.7倍,同时在这两项指标上较LoRA平均提升了10%。我们进一步证明,S$^{2}$FT中的权重更新可以解耦为适配器,从而在服务多个微调模型时实现有效融合、快速切换和高效并行。

英文摘要:

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.

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

↑