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

PaCA:用于高效微调的部分连接适配

PaCA: Partial Connection Adaptation for Efficient Fine-Tuning

Seoul National University(首尔大学)

Sunghyeon Woo, Sol Namkung, Sunwoo Lee, Inho Jeong, Beomseok Kim, Dongsuk Jeon

AI总结:

PaCA 通过微调预训练权重内随机选择的部分连接替代适配器层,在保持精度的同时减少 22% 训练时间和 16% 内存使用,并支持更长序列和更高吞吐量。

摘要:

先前的参数高效微调(PEFT)算法通过仅训练少量额外的适配器参数而非整个模型,降低了微调大型神经网络模型的内存使用和计算成本。然而,PEFT 带来的计算成本降低并不一定转化为训练时间的减少;尽管适配器层的计算成本远小于预训练层,但众所周知,这两类层在 GPU 上是顺序处理的,从而导致显著的延迟开销。LoRA 及其变体在推理期间将低秩适配器矩阵与预训练权重合并以避免延迟开销,但在训练期间,预训练权重保持冻结,而适配器矩阵持续更新,从而阻止了这种合并。为了缓解这一问题,我们提出了部分连接适配(PaCA),它微调预训练权重内随机选择的部分连接,而不是在模型中引入适配器层。PaCA 不仅通过消除适配器层和预训练层顺序处理带来的时间开销来提高训练速度,而且还减少了激活内存,因为只需存储部分激活而非完整激活用于梯度计算。与 LoRA 相比,PaCA 将训练时间减少了 22%,总内存使用减少了 16%,同时在各种微调场景中保持相当的准确率,例如在 MMLU 数据集上的微调和在 Oasst1 数据集上的指令微调。PaCA 还可以与量化相结合,从而能够微调诸如 LLaMA3.1-70B 之类的大型模型。此外,与 LoRA 相比,PaCA 在 NVIDIA A100 GPU 和 INTEL Gaudi2 HPU 上均支持训练长度增加 23% 的序列,并将吞吐量提高了 16%。代码可在 https://github.com/WooSunghyeon/paca 获取。

英文摘要:

Prior parameter-efficient fine-tuning (PEFT) algorithms reduce memory usage and computational costs of fine-tuning large neural network models by training only a few additional adapter parameters, rather than the entire model. However, the reduction in computational costs due to PEFT does not necessarily translate to a reduction in training time; although the computational costs of the adapter layers are much smaller than the pretrained layers, it is well known that those two types of layers are processed sequentially on GPUs, resulting in significant latency overhead. LoRA and its variants merge low-rank adapter matrices with pretrained weights during inference to avoid latency overhead, but during training, the pretrained weights remain frozen while the adapter matrices are continuously updated, preventing such merging. To mitigate this issue, we propose Partial Connection Adaptation (PaCA), which fine-tunes randomly selected partial connections within the pretrained weights instead of introducing adapter layers in the model. PaCA not only enhances training speed by eliminating the time overhead due to the sequential processing of the adapter and pretrained layers but also reduces activation memory since only partial activations, rather than full activations, need to be stored for gradient computation. Compared to LoRA, PaCA reduces training time by 22% and total memory usage by 16%, while maintaining comparable accuracy across various fine-tuning scenarios, such as fine-tuning on the MMLU dataset and instruction tuning on the Oasst1 dataset. PaCA can also be combined with quantization, enabling the fine-tuning of large models such as LLaMA3.1-70B. In addition, PaCA enables training with 23% longer sequence and improves throughput by 16% on both NVIDIA A100 GPU and INTEL Gaudi2 HPU compared to LoRA. The code is available at https://github.com/WooSunghyeon/paca.

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

↑