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

Activated LoRA: 面向内在功能模块的微调大语言模型

Activated LoRA: Fine-tuned LLMs for Intrinsics

IBM Research(IBM研究院)

Kristjan Greenewald, Luis Lastras, Thomas Parnell, Vraj Shah, Lucian Popa, Giulio Zizzo, Chulaka Gunasekara, Ambrish Rawat, David Cox

AI总结:

针对多轮场景中切换LoRA需重算KV缓存效率低的问题,提出仅适配调用后token权重的Activated LoRA架构,可复用基础模型KV缓存实现即时激活,构建的内在功能模块准确率对标标准LoRA且推理效率显著提升,相关实现已贡献至Huggingface PEFT库。

摘要:

低秩适配(Low-Rank Adaptation, LoRA)已成为微调大型基础模型权重的高效框架,也是大语言模型(LLM)数据驱动定制化的主流方法。尽管其在实现高度定制化行为与能力方面前景可观,但在多轮对话场景中切换相关LoRA的效率极低——生成开始前必须用LoRA权重重新计算整轮对话历史的键值(KV)缓存。为解决这一问题,我们提出Activated LoRA(aLoRA,激活式低秩适配),这是一种改进LoRA框架的适配器架构,仅对aLoRA被调用后序列中的token进行权重适配。这一关键改动使得aLoRA可以直接复用基础模型针对输入字符串生成的KV缓存,意味着aLoRA可在推理链中按需即时激活,无需重新计算之前的键和值。这一特性支持构建我们所称的“内在功能模块(intrinsics)”——即被调用后对输入链或对话的部分内容执行明确定义操作的专用模型,其余内容默认使用基础模型处理。我们训练了一组基于aLoRA的内在功能模块模型,实验证明其准确率与标准LoRA相当,同时显著提升了推理效率。我们已将Activated LoRA的实现贡献至Huggingface PEFT库,地址为https://github.com/huggingface/peft。

英文摘要:

Low-Rank Adaptation (LoRA) has emerged as a highly efficient framework for finetuning the weights of large foundation models, and has become the go-to method for data-driven customization of LLMs. Despite the promise of highly customized behaviors and capabilities, switching between relevant LoRAs in a multiturn setting is inefficient, as the key-value (KV) cache of the entire turn history must be recomputed with the LoRA weights before generation can begin. To address this problem, we propose Activated LoRA (aLoRA), an adapter architecture which modifies the LoRA framework to only adapt weights for the tokens in the sequence after the aLoRA is invoked. This change crucially allows aLoRA to accept the base model's KV cache of the input string, meaning that aLoRA can be instantly activated whenever needed in a chain without recomputing the prior keys and values. This enables building what we call intrinsics, i.e. specialized models invoked to perform well-defined operations on portions of an input chain or conversation that otherwise uses the base model by default. We train a set of aLoRA-based intrinsics models, demonstrating competitive accuracy with standard LoRA while significantly improving inference efficiency. We contributed our Activated LoRA implementation to the Huggingface PEFT library https://github.com/huggingface/peft.

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

↑