Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs

📄 arXiv: 2310.08915v3 📥 PDF

作者: Yuxin Zhang, Lirui Zhao, Mingbao Lin, Yunyun Sun, Yiwu Yao, Xingjia Han, Jared Tanner, Shiwei Liu, Rongrong Ji

分类: cs.AI

发布日期: 2023-10-13 (更新: 2024-02-26)

备注: Published as a conference paper at ICLR 2024

🔗 代码/项目: GITHUB


💡 一句话要点

提出动态稀疏无训练方法以解决稀疏LLM微调问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 稀疏模型 微调 动态稀疏训练 大型语言模型 网络剪枝 高效算法 自然语言处理

📋 核心要点

  1. 现有的网络剪枝方法在大型语言模型的微调中面临高昂的成本,限制了其在设备端的应用。
  2. 本文提出的DSnoT方法通过动态稀疏训练,避免了反向传播,能够高效地微调稀疏LLMs。
  3. 实验结果表明,DSnoT在多个基准测试中显著提升了稀疏LLMs的性能,尤其在高稀疏度情况下表现突出。

📝 摘要(中文)

随着大型语言模型(LLMs)的不断发展,尽管为实现通用人工智能开辟了潜在路径,但在设备端部署时面临着巨大的挑战。网络剪枝作为降低模型复杂度的成熟方法,在LLMs时代却因其昂贵的微调需求而滞后。为此,本文提出了动态稀疏无训练(DSnoT)方法,这是一种无需训练的微调方法,能够在不进行反向传播和权重更新的情况下,轻微更新稀疏LLMs。DSnoT通过最小化稠密与稀疏LLMs之间的重构误差,采用迭代权重剪枝与增长的方式,显著提升稀疏LLMs的性能,尤其在高稀疏度下表现优异。实验结果显示,DSnoT在LLaMA-7B模型上以70%稀疏度超越了现有最优方法Wanda,提升幅度达到26.79困惑度。

🔬 方法详解

问题定义:本文旨在解决在大型语言模型(LLMs)中,网络剪枝方法因高昂的微调成本而难以应用的问题。现有方法在处理庞大的模型参数和训练数据时,微调过程复杂且耗时。

核心思路:DSnoT方法的核心思想是通过动态稀疏训练,避免传统的反向传播和权重更新,从而实现高效的微调。该方法通过最小化稠密与稀疏LLMs之间的重构误差,进行权重的迭代剪枝与增长。

技术框架:DSnoT的整体架构包括两个主要阶段:首先是对稀疏LLMs进行动态权重剪枝,其次是根据不同输入数据的方差进行权重的增长。此过程在时间复杂度上是线性的,显著提高了效率。

关键创新:DSnoT的创新之处在于其无需训练的微调方式,避免了传统方法中反向传播的复杂性。这一设计使得在高稀疏度下仍能有效提升模型性能,突破了现有方法的限制。

关键设计:在DSnoT中,重构误差的计算和权重增长的方差考虑是关键设计要素。通过精确设置这些参数,DSnoT能够在保持稀疏性的同时,优化模型的表现。具体的损失函数和网络结构设计也为方法的有效性提供了保障。

📊 实验亮点

在多个基准测试中,DSnoT方法在LLaMA-7B模型上以70%稀疏度超越了现有最优方法Wanda,提升幅度达到26.79困惑度,显示出其在高稀疏度下的显著优势。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、对话系统以及其他需要高效模型部署的场景。DSnoT方法的高效性使其在资源受限的设备上实现大型语言模型的应用成为可能,具有重要的实际价值和广泛的影响力。

📄 摘要(原文)

The ever-increasing large language models (LLMs), though opening a potential path for the upcoming artificial general intelligence, sadly drops a daunting obstacle on the way towards their on-device deployment. As one of the most well-established pre-LLMs approaches in reducing model complexity, network pruning appears to lag behind in the era of LLMs, due mostly to its costly fine-tuning (or re-training) necessity under the massive volumes of model parameter and training data. To close this industry-academia gap, we introduce Dynamic Sparse No Training (DSnoT), a training-free fine-tuning approach that slightly updates sparse LLMs without the expensive backpropagation and any weight updates. Inspired by the Dynamic Sparse Training, DSnoT minimizes the reconstruction error between the dense and sparse LLMs, in the fashion of performing iterative weight pruning-and-growing on top of sparse LLMs. To accomplish this purpose, DSnoT particularly takes into account the anticipated reduction in reconstruction error for pruning and growing, as well as the variance w.r.t. different input data for growing each weight. This practice can be executed efficiently in linear time since its obviates the need of backpropagation for fine-tuning LLMs. Extensive experiments on LLaMA-V1/V2, Vicuna, and OPT across various benchmarks demonstrate the effectiveness of DSnoT in enhancing the performance of sparse LLMs, especially at high sparsity levels. For instance, DSnoT is able to outperform the state-of-the-art Wanda by 26.79 perplexity at 70% sparsity with LLaMA-7B. Our paper offers fresh insights into how to fine-tune sparse LLMs in an efficient training-free manner and open new venues to scale the great potential of sparsity to LLMs. Codes are available at https://github.com/zyxxmu/DSnoT.