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

GradPruner: 通过梯度引导的层剪枝实现LLM高效微调与推理

GradPruner: Gradient-Guided Layer Pruning Enabling Efficient Fine-Tuning and Inference for LLMs

Ant Group Beijing, China(蚂蚁集团北京)

Wei Huang, Anda Cheng, Yinggui Wang

AI总结:

GradPruner通过梯度引导的层剪枝技术,在保持高精度的同时实现LLM微调和推理的高效优化。

摘要:

对大型语言模型(LLM)进行微调通常被认为耗时且昂贵。结构化剪枝方法主要用于提高预训练模型的推理效率。然而,这些方法往往需要额外的时间和内存用于训练、知识蒸馏、结构搜索等策略,使高效模型微调难以实现。为了同时提高下游任务微调的训练和推理效率,我们引入了GradPruner,它可以在微调的早期阶段通过梯度引导对LLM的层进行剪枝。GradPruner利用微调初期每个参数的累积梯度计算初始梯度信息积累矩阵(IGIA-Matrix)以评估层的重要性并进行剪枝。我们根据IGIA-Matrix对剪枝后的层进行稀疏化,并将其与剩余的层合并。仅合并符号相同的元素以减少符号变化带来的干扰。我们在两个LLM上进行了广泛的实验,覆盖八个下游数据集,包括医疗、金融和通用基准任务。结果表明,GradPruner实现了40%的参数减少,仅以0.99%的精度下降为代价。我们的代码已公开可用。

英文摘要:

Fine-tuning Large Language Models (LLMs) with downstream data is often considered time-consuming and expensive. Structured pruning methods are primarily employed to improve the inference efficiency of pre-trained models. Meanwhile, they often require additional time and memory for training, knowledge distillation, structure search, and other strategies, making efficient model fine-tuning challenging to achieve. To simultaneously enhance the training and inference efficiency of downstream task fine-tuning, we introduce GradPruner, which can prune layers of LLMs guided by gradients in the early stages of fine-tuning. GradPruner uses the cumulative gradients of each parameter during the initial phase of fine-tuning to compute the Initial Gradient Information Accumulation Matrix (IGIA-Matrix) to assess the importance of layers and perform pruning. We sparsify the pruned layers based on the IGIA-Matrix and merge them with the remaining layers. Only elements with the same sign are merged to reduce interference from sign variations. We conducted extensive experiments on two LLMs across eight downstream datasets. Including medical, financial, and general benchmark tasks. The results demonstrate that GradPruner has achieved a parameter reduction of 40% with only a 0.99% decrease in accuracy. Our code is publicly available.

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

↑