arXiv:2504.12397cs.LGcs.AI2025-04NeurIPS被引 7

让大模型的微调模块能快速启用,提升多轮对话效率

Activated LoRA: Fine-tuned LLMs for Intrinsics

  • 仅对调用后的内容动态调整权重,不重算历史缓存
  • 相比标准LoRA,推理速度提升显著,准确率相当
  • 适合需要快速切换功能模块的对话系统开发者

低秩适配(LoRA)是高效微调大模型的核心方法,但多轮对话中切换不同LoRA需重新计算全部历史键值缓存,效率低下。为此,我们提出激活式LoRA(aLoRA),仅在调用后对序列中的后续token进行权重调整,可直接复用基础模型的输入缓存。这使得aLoRA可在任意时刻即时激活,无需重算历史键值。由此可构建‘内在能力’——针对输入特定片段执行明确操作的专用模块,整体仍以基础模型为主。我们训练了多个基于aLoRA的内在模型,在保持与标准LoRA相当精度的同时,大幅提高推理效率。相关实现已贡献至HuggingFace PEFT库。

原文摘要 · Abstract (English)

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.

LoRA推理加速对话系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。