arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.00477cs.CLcs.AIcs.LG
收藏

使预训练模型可逆:从参数高效到内存高效微调

Make Pre-trained Model Reversible: From Parameter to Memory Efficient Fine-Tuning

University of Amsterdam(阿姆斯特丹大学)

Baohao Liao, Shaomu Tan, Christof Monz

AI总结:

本文提出内存高效微调方法MEFT,通过在保留预训练模型起始点的前提下插入适配器使其可逆,无需额外预训练即可在保持性能的同时显著减少激活内存。

摘要:

预训练语言模型(PLMs)的参数高效微调(PEFT)已成为一种非常成功的方法,它仅训练少量参数而不牺牲性能,并随着PLMs规模的增大成为事实上的学习范式。然而,现有的PEFT方法在内存上并不高效,因为它们仍需缓存大部分中间激活值以用于梯度计算,这与微调类似。降低激活内存的一种有效方法是应用可逆模型,这样中间激活值无需缓存且可被重新计算。尽管如此,将PLM修改为其可逆变体并非易事,因为可逆模型与当前发布的PLMs具有不同的架构。在本文中,我们首先研究了现有PEFT方法成功的关键因素是什么,并认识到在初始化PEFT方法时保留PLM的起始点至关重要。基于这一发现,我们提出了内存高效微调(MEFT),它将适配器插入到PLM中,保留PLM的起始点并使其可逆而无需额外的预训练。我们在GLUE基准和五个问答任务上使用不同的骨干网络(BERT、RoBERTa、BART和OPT)评估了MEFT。MEFT显著减少了激活内存,最高可减少至全量微调的84%,且可训练参数量微乎其微。此外,MEFT在GLUE上取得了与全量微调相同的分数,在问答任务上取得了相当的分数。在图像分类任务中也观察到了类似的结果。

英文摘要:

Parameter-efficient fine-tuning (PEFT) of pre-trained language models (PLMs) has emerged as a highly successful approach, with training only a small number of parameters without sacrificing performance and becoming the de-facto learning paradigm with the increasing size of PLMs. However, existing PEFT methods are not memory-efficient, because they still require caching most of the intermediate activations for the gradient calculation, akin to fine-tuning. One effective way to reduce the activation memory is to apply a reversible model, so the intermediate activations are not necessary to be cached and can be recomputed. Nevertheless, modifying a PLM to its reversible variant is not straightforward, since the reversible model has a distinct architecture from the currently released PLMs. In this paper, we first investigate what is a key factor for the success of existing PEFT methods, and realize that it's essential to preserve the PLM's starting point when initializing a PEFT method. With this finding, we propose memory-efficient fine-tuning (MEFT) that inserts adapters into a PLM, preserving the PLM's starting point and making it reversible without additional pre-training. We evaluate MEFT on the GLUE benchmark and five question-answering tasks with various backbones, BERT, RoBERTa, BART and OPT. MEFT significantly reduces the activation memory up to 84% of full fine-tuning with a negligible amount of trainable parameters. Moreover, MEFT achieves the same score on GLUE and a comparable score on the question-answering tasks as full fine-tuning. A similar finding is also observed for the image classification task.

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

↑