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

面向高效视觉Transformer微调的自适应层选择方法

Adaptive Layer Selection for Efficient Vision Transformer Fine-Tuning

La Sapienza, University of Rome(罗马大学(智慧大学));The University of Edinburgh(爱丁堡大学);CNIT(全国大学电信联盟(CNIT))

Alessio Devoto, Federico Alvetreti, Jary Pomponi, Paolo Di Lorenzo, Pasquale Minervini, Simone Scardapane

AI总结:

针对视觉Transformer微调资源消耗高的问题,提出自适应层选择微调方法ALaST,按小批量数据动态评估层重要性并分配计算预算,可显著降低训练成本且能与其他参数高效微调方法结合。

摘要:

近年来,基于视觉Transformer(Vision Transformers, ViTs)的基础模型已得到广泛应用。然而,其微调过程资源消耗极高,阻碍了这类模型在各类边缘或低能耗场景中的部署应用。针对这一问题,本文提出了一种名为ALaST(Adaptive Layer Selection Fine-Tuning for Vision Transformers,视觉Transformer自适应层选择微调)的高效ViT微调方法,可在加快微调进程的同时降低计算成本、内存负载与训练时长。\n本方法的核心依据是如下观察:微调过程中并非所有层的重要性都相同,且各层的重要性会随当前小批量(mini-batch)数据的变化而改变。因此,在每一步微调中,我们会自适应评估所有层的重要性,并据此分配我们所称的“计算预算”。分配到较低预算的层,要么使用数量缩减的输入token进行训练,要么被保持冻结状态。冻结层通过阻止权重更新来降低计算成本与内存占用,而丢弃token则可移除冗余数据,加快处理速度并降低内存需求。\n实验表明,这种自适应计算分配机制能够实现近乎最优的层间计算资源调度方案。与传统的全量微调方法相比,该方法可大幅缩短训练时长(最高提升1.5倍速度)、减少浮点运算量(FLOPs,最高降低2倍)与内存负载(最高降低2倍)。此外,该方法还可与LoRA等其他参数高效微调方法成功结合使用。

英文摘要:

Recently, foundation models based on Vision Transformers (ViTs) have become widely available. However, their fine-tuning process is highly resource-intensive, and it hinders their adoption in several edge or low-energy applications. To this end, in this paper we introduce an efficient fine-tuning method for ViTs called $\textbf{ALaST}$ ($\textit{Adaptive Layer Selection Fine-Tuning for Vision Transformers}$) to speed up the fine-tuning process while reducing computational cost, memory load, and training time. Our approach is based on the observation that not all layers are equally critical during fine-tuning, and their importance varies depending on the current mini-batch. Therefore, at each fine-tuning step, we adaptively estimate the importance of all layers and we assign what we call ``compute budgets'' accordingly. Layers that were allocated lower budgets are either trained with a reduced number of input tokens or kept frozen. Freezing a layer reduces the computational cost and memory usage by preventing updates to its weights, while discarding tokens removes redundant data, speeding up processing and reducing memory requirements. We show that this adaptive compute allocation enables a nearly-optimal schedule for distributing computational resources across layers, resulting in substantial reductions in training time (up to 1.5x), FLOPs (up to 2x), and memory load (up to 2x) compared to traditional full fine-tuning approaches. Additionally, it can be successfully combined with other parameter-efficient fine-tuning methods, such as LoRA.

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

↑