arXiv:2412.14426cs.CLcs.AI2024-12被引 7

提出统一微调与剪枝方法,动态优化领域大模型结构。

All-in-One Tuning and Structural Pruning for Domain-Specific LLMs

  • 单阶段联合微调与剪枝,动态生成最优网络结构。
  • 剪枝40%参数后仍保留88%-91%原模型性能,优于两阶段方法。
  • 兼容LoRA,支持低资源领域应用,适合法律医疗等场景。

针对领域专用大模型的剪枝技术通常采用两阶段流程:先剪枝预训练通用模型,再在特定领域微调。但剪枝决策基于原始权重,在微调过程中不再更新,导致剪枝与更新后的权重不匹配,影响性能。为此,本文提出ATP:全一阶段微调与结构化剪枝方法,通过可训练的剪枝决策生成器,在微调过程中动态识别当前最优子结构。考虑到领域数据有限,常用低秩适配(LoRA)进行微调。ATP引入LoRA感知的前向传播和稀疏正则化,确保剪枝后可直接移除对应子结构。在法律与医疗领域任务中,ATP性能超越现有两阶段剪枝方法。具体而言,对LLaMA2-7B和LLaMA3-8B模型剪枝40%参数时,分别恢复了88%和91%的密集模型性能。

原文摘要 · Abstract (English)

Existing pruning techniques for large language models (LLMs) targeting domain-specific applications typically follow a two-stage process: pruning the pretrained general-purpose LLMs and then fine-tuning the pruned LLMs on specific domains. However, the pruning decisions, derived from the pretrained weights, remain unchanged during fine-tuning, even if the weights have been updated. Therefore, such a combination of the pruning decisions and the finetuned weights may be suboptimal, leading to non-negligible performance degradation. To address these limitations, we propose ATP: All-in-One Tuning and Structural Pruning, a unified one-stage structural pruning and fine-tuning approach that dynamically identifies the current optimal substructure throughout the fine-tuning phase via a trainable pruning decision generator. Moreover, given the limited available data for domain-specific applications, Low-Rank Adaptation (LoRA) becomes a common technique to fine-tune the LLMs. In ATP, we introduce LoRA-aware forward and sparsity regularization to ensure that the substructures corresponding to the learned pruning decisions can be directly removed after the ATP process. ATP outperforms the state-of-the-art two-stage pruning methods on tasks in the legal and healthcare domains. More specifically, ATP recovers up to 88% and 91% performance of the dense model when pruning 40% parameters of LLaMA2-7B and LLaMA3-8B models, respectively.

大模型剪枝微调优化领域模型LoRA

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