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

面向大语言模型的动态低秩稀疏适配

Dynamic Low-Rank Sparse Adaptation for Large Language Models

Xiamen University(厦门大学);Huawei Technologies(华为技术有限公司);Institute of Artificial Intelligence, Xiamen University(厦门大学人工智能研究院);Peng Cheng Laboratory(鹏城实验室)

Weizhong Huang, Yuxin Zhang, Xiawu Zheng, Yang Liu, Jing Lin, Yiwu Yao, Rongrong Ji

AI总结:

针对稀疏大语言模型性能下降及现有LoRA微调方法的缺陷,本文提出动态低秩稀疏适配LoSA,通过动态稀疏化LoRA输出、层间自适应分配稀疏率与秩,在无额外推理开销下高效提升稀疏LLM性能。

摘要:

尽管网络稀疏化在缓解大语言模型(Large Language Models, LLMs)部署压力方面具备有效性,但它会遭遇显著的性能下降问题。将低秩适配(Low-Rank Adaptation, LoRA)应用于稀疏LLMs的微调是应对这一困境的直观思路,然而该方法存在两大缺陷:1)训练后无法将LoRA权重整合到稀疏LLMs中;2)高稀疏率下性能恢复不足。本文提出动态低秩稀疏适配(dynamic Low-rank Sparse Adaptation, LoSA),这是一种将低秩适配无缝融入LLM稀疏化的统一框架下的全新方法,能够在不增加推理延迟的前提下提升稀疏LLMs的性能。具体而言,LoSA在微调过程中根据对应的稀疏权重动态对LoRA输出进行稀疏化,从而保证训练后LoRA模块可被整合进稀疏LLMs。此外,LoSA利用表示互信息(Representation Mutual Information, RMI)作为指标判断层的重要性,进而在微调过程中高效确定各层的稀疏率。在此基础上,LoSA根据各层重构误差的差异性调整LoRA模块的秩,为每一层分配适配的微调强度,以缩小稠密LLM与稀疏LLM之间的输出差异。大量实验表明,LoSA可在数小时内有效提升稀疏LLMs的性能,且不会带来任何额外推理负担。例如,LoSA将稀疏LLaMA-2-7B的困惑度降低了68.73,零样本准确率提升了16.32%,在CPU上实现2.60倍加速,在GPU上实现2.23倍加速,而仅需在单张NVIDIA A100 80GB GPU上进行45分钟的微调。代码可在https://github.com/wzhuang-xmu/LoSA获取。

英文摘要:

Despite the efficacy of network sparsity in alleviating the deployment strain of Large Language Models (LLMs), it endures significant performance degradation. Applying Low-Rank Adaptation (LoRA) to fine-tune the sparse LLMs offers an intuitive approach to counter this predicament, while it holds shortcomings include: 1) The inability to integrate LoRA weights into sparse LLMs post-training, and 2) Insufficient performance recovery at high sparsity ratios. In this paper, we introduce dynamic Low-rank Sparse Adaptation (LoSA), a novel method that seamlessly integrates low-rank adaptation into LLM sparsity within a unified framework, thereby enhancing the performance of sparse LLMs without increasing the inference latency. In particular, LoSA dynamically sparsifies the LoRA outcomes based on the corresponding sparse weights during fine-tuning, thus guaranteeing that the LoRA module can be integrated into the sparse LLMs post-training. Besides, LoSA leverages Representation Mutual Information (RMI) as an indicator to determine the importance of layers, thereby efficiently determining the layer-wise sparsity rates during fine-tuning. Predicated on this, LoSA adjusts the rank of the LoRA module based on the variability in layer-wise reconstruction errors, allocating an appropriate fine-tuning for each layer to reduce the output discrepancies between dense and sparse LLMs. Extensive experiments tell that LoSA can efficiently boost the efficacy of sparse LLMs within a few hours, without introducing any additional inferential burden. For example, LoSA reduced the perplexity of sparse LLaMA-2-7B by 68.73 and increased zero-shot accuracy by 16.32$\%$, achieving a 2.60$\times$ speedup on CPU and 2.23$\times$ speedup on GPU, requiring only 45 minutes of fine-tuning on a single NVIDIA A100 80GB GPU. Code is available at https://github.com/wzhuang-xmu/LoSA.

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

↑