让稀疏大模型在不增加推理开销下,快速恢复性能。
Dynamic Low-Rank Sparse Adaptation for Large Language Models
- 动态调整低秩适配权重,使稀疏模型可无缝集成LoRA。
- 在高稀疏度下仍能降低困惑度68.73,零样本准确率提升16.32%。
- 适合需要高效部署稀疏大模型的研究者与工程师。
尽管网络稀疏性可缓解大语言模型(LLM)的部署压力,但仍面临显著性能下降问题。将低秩适配(LoRA)应用于稀疏LLM微调虽具直观优势,但存在两大缺陷:1)无法在训练后将LoRA权重集成到稀疏模型中;2)在高稀疏比下性能恢复不足。本文提出动态低秩稀疏适配(LoSA),在统一框架内将低秩适配无缝融入LLM稀疏化过程,从而在不增加推理延迟的前提下提升稀疏LLM性能。具体而言,LoSA在微调过程中根据对应稀疏权重动态稀疏化LoRA输出,确保训练后可直接集成;同时利用表示互信息(RMI)评估层重要性,高效确定分层稀疏率,并基于层间重构误差变异调整LoRA秩,为各层分配合适微调策略,减少稠密与稀疏模型间的输出差异。大量实验表明,LoSA可在数小时内显著提升稀疏LLM效能,无额外推理负担。例如,对稀疏版LLaMA-2-7B,LoSA将困惑度降低68.73,零样本准确率提升16.32%,在CPU上实现2.60×加速,GPU上达2.23×加速,仅需单块NVIDIA A100 80GB GPU运行45分钟即可完成微调。代码已开源。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。