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

从PEFT到DEFT:用于降低Transformer中激活密度的参数高效微调方法

From PEFT to DEFT: Parameter Efficient Finetuning for Reducing Activation Density in Transformers

IBM Research(IBM研究院)

Bharat Runwal, Tejaswini Pedapati, Pin-Yu Chen

AI总结:

本研究针对大模型传统微调成本高的问题,提出密度高效微调方法DEFT及自适应变体ADA-DEFT,结合主流PEFT技术降低Transformer激活密度,显著提升推理效率且可与量化、剪枝方法互补。

摘要:

预训练语言模型(Pretrained Language Models,PLMs)已成为下游任务微调的事实标准起点。然而,随着模型规模持续增大,对所有参数进行传统微调的难度不断提升。为解决这一问题,参数高效微调(Parameter-Efficient Fine-Tuning,PEFT)方法作为高效适配PLMs的手段得到广泛应用。与此同时,近期研究发现Transformer的多层感知机(multilayer perceptron,MLP)模块中间输出存在激活稀疏性,低激活密度可在支持稀疏计算的硬件上实现高效模型推理。基于这一洞见,本研究提出一种全新的密度损失函数,用于提升预训练模型的激活稀疏性(即降低激活密度)。我们通过QLoRA、LoRA、Adapter、Prompt/Prefix Tuning等主流PEFT技术验证了该方法的有效性,可支撑模型在多样下游任务上的高效适配。实验结果表明,与PEFT相比,本文提出的DEFT(Density-Efficient Fine-Tuning,密度高效微调)方法在GLUE基准测试的RoBERTa_Large模型上可稳定降低激活密度最高达44.94%;在SQuAD问答基准的Flan-T5_XXL(11B参数)模型上,编码器密度降低53.19%,解码器密度降低90.60%。我们还提出了DEFT的自适应变体ADA-DEFT,可在推理阶段显著节省内存与运行时间:例如在Flan-T5_XL模型上,ADA-DEFT可减少8.79%的运行时间与17.46%的内存占用;在Flan-T5_XXL模型上则分别减少2.79%与2.54%。此外,研究还证实DEFT可与量化模型、剪枝模型协同发挥作用。

英文摘要:

Pretrained Language Models (PLMs) have become the de facto starting point for fine-tuning on downstream tasks. However, as model sizes continue to increase, traditional fine-tuning of all the parameters becomes challenging. To address this, parameter-efficient fine-tuning (PEFT) methods have gained popularity as a means to adapt PLMs effectively. In parallel, recent studies have revealed the presence of activation sparsity within the intermediate outputs of the multilayer perceptron (MLP) blocks in transformers. Low activation density enables efficient model inference on sparsity-aware hardware. Building upon this insight, in this work, we propose a novel density loss that encourages higher activation sparsity (equivalently, lower activation density) in the pre-trained models. We demonstrate the effectiveness of our approach by utilizing mainstream PEFT techniques, including QLoRA, LoRA, Adapter, and Prompt/Prefix Tuning, to facilitate efficient model adaptation across diverse downstream tasks. Experiments show that our proposed method, \textbf{DEFT} (Density-Efficient Fine-Tuning), can consistently reduce activation density by up to \textbf{44.94\%} on RoBERTa$_\mathrm{Large}$ and by \textbf{53.19\%} (encoder density) and \textbf{90.60\%} (decoder density) on Flan-T5$_\mathrm{XXL}$ (\textbf{11B}) compared to PEFT, using GLUE and QA (SQuAD) benchmarks respectively. We also introduce \textbf{ADA-DEFT}, an adaptive variant of our DEFT approach, which achieves significant memory and runtime savings during inference. For instance, ADA-DEFT reduces runtime by \textbf{8.79\%}and memory usage by \textbf{17.46\%} in Flan-T5$_\mathrm{XL}$, and by \textbf{2.79\%} and \textbf{2.54\%} respectively in Flan-T5$_\mathrm{XXL}$. Additionally, we showcase that DEFT works complementarily with quantized and pruned models.

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

↑