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

稀疏高秩适配器 (SHiRA)

Sparse High Rank Adapters

Qualcomm AI Research(高通人工智能研究部);Qualcomm Technologies, Inc.(高通技术公司)
Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi, Viswanath Ganapathy, Shreya Kadambi, Rafael Esteves, Shubhankar Borse, Paul Whatmough, Risheek Garr… 展开作者

Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi, Viswanath Ganapathy, Shreya Kadambi, Rafael Esteves, Shubhankar Borse, Paul Whatmough, Risheek Garrepalli, Mart Van Baalen, Harris Teague, Markus Nagel

AI总结:

针对LoRA在移动端部署面临的推理延迟、切换慢及多adapter概念丢失问题,提出SHiRA新范式,通过仅微调基础模型1-2%权重实现高稀疏性,在无推理开销下支持快速切换并显著减少概念丢失。

摘要:

Low Rank Adaptation (LoRA) 在近期的生成式 AI 研究中获得了极大关注。LoRA 的主要优势之一是能够与预训练模型融合,在推理期间不增加任何开销。然而,从移动端部署的角度来看,我们要么在融合模式下避免推理开销但失去快速切换 adapter 的能力,要么在未融合模式下承受显著(高达 30% 更高)的推理延迟以实现快速切换。当同时使用多个 adapter 时,LoRA 还会出现概念丢失现象。在本文中,我们提出了 Sparse High Rank Adapters (SHiRA),这是一种新范式,它不产生推理开销,支持快速切换,并显著减少了概念丢失。具体而言,SHiRA 可以通过仅直接微调基础模型 1-2% 的权重来训练,同时保持其他权重不变。这产生了一个高度稀疏的 adapter,可以直接在融合模式下进行切换。我们进一步提供了理论和实证见解,说明 SHiRA 中的高稀疏性如何通过减少概念丢失来辅助多 adapter 融合。我们在 LVMs 和 LLMs 上进行的大量实验表明,仅微调基础模型中的一小部分参数,其效果显著优于 LoRA,同时支持快速切换和多 adapter 融合。最后,我们提供了一种基于 Parameter-Efficient Finetuning (PEFT) Library 的延迟和内存高效的 SHiRA 实现,其训练速度与 LoRA 几乎相同,但峰值 GPU 内存消耗最多降低 16%,从而使 SHiRA 易于在实际用例中采用。为了展示推理期间的快速切换优势,我们展示了在 CPU 上将 SHiRA 加载到基础模型上的速度可以比 LoRA 融合快 5 倍至 16 倍。

英文摘要:

Low Rank Adaptation (LoRA) has gained massive attention in the recent generative AI research. One of the main advantages of LoRA is its ability to be fused with pretrained models, adding no overhead during inference. However, from a mobile deployment standpoint, we can either avoid inference overhead in the fused mode but lose the ability to switch adapters rapidly, or suffer significant (up to 30% higher) inference latency while enabling rapid switching in the unfused mode. LoRA also exhibits concept-loss when multiple adapters are used concurrently. In this paper, we propose Sparse High Rank Adapters (SHiRA), a new paradigm which incurs no inference overhead, enables rapid switching, and significantly reduces concept-loss. Specifically, SHiRA can be trained by directly tuning only 1-2% of the base model weights while leaving others unchanged. This results in a highly sparse adapter which can be switched directly in the fused mode. We further provide theoretical and empirical insights on how high sparsity in SHiRA can aid multi-adapter fusion by reducing concept loss. Our extensive experiments on LVMs and LLMs demonstrate that finetuning only a small fraction of the parameters in the base model significantly outperforms LoRA while enabling both rapid switching and multi-adapter fusion. Finally, we provide a latency- and memory-efficient SHiRA implementation based on Parameter-Efficient Finetuning (PEFT) Library which trains at nearly the same speed as LoRA while consuming up to 16% lower peak GPU memory, thus making SHiRA easy to adopt for practical use cases. To demonstrate rapid switching benefits during inference, we show that loading SHiRA on a base model can be 5x-16x faster than LoRA fusion on a CPU.

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

↑