让大模型微调更省电又不丢精度,通过硬件感知的低秩适配技术。
HaLoRA: Hardware-aware Low-Rank Adaptation for Large Language Models Based on Hybrid Compute-in-Memory Architecture
- 在混合存算架构上部署模型,用RRAM存主权重、SRAM存低秩分支。
- 实测能耗降至A100 GPU的3%,推理精度提升最高达22.7分。
- 针对存储噪声设计抗噪训练机制,适合边缘设备部署场景。
低秩适配(LoRA)是高效微调大语言模型的主流方法。同时,存算一体(CIM)架构因阵列级并行计算,在能效方面表现优异。本文提出将LoRA微调后的模型部署于混合式CIM架构:预训练权重存入节能的电阻式随机存取内存(RRAM),而LoRA分支则部署于无噪声的静态随机存取内存(SRAM),使能耗降低至Nvidia A100 GPU的约3%。然而,RRAM固有的噪声会导致性能下降。为此,我们设计了硬件感知低秩适配(HaLoRA)方法:训练一个对噪声鲁棒的LoRA分支,并将其部署于无噪声的SRAM中;由于LoRA参数量远小于预训练权重(如LLaMA-3.2 1B模型仅占0.15%),额外开销可忽略不计。为提升鲁棒性,我们从理论上分析了理想与噪声环境下LoRA优化轨迹的差距,并引入额外损失以最小化该差距的上界。实验表明,对Qwen和LLaMA系列模型进行微调后,哈洛拉在多个推理任务中均有效,平均得分最高提升22.7,且在多种噪声类型与强度下仍保持稳定性。
原文摘要 · Abstract (English)
Low-rank adaptation (LoRA) is a predominant parameter-efficient finetuning method for adapting large language models (LLMs) to downstream tasks. Meanwhile, Compute-in-Memory (CIM) architectures demonstrate superior energy efficiency due to their array-level parallel in-memory computing designs. In this paper, we propose deploying the LoRA-finetuned LLMs on the hybrid CIM architecture (i.e., pretrained weights onto energy-efficient Resistive Random-Access Memory (RRAM) and LoRA branches onto noise-free Static Random-Access Memory (SRAM)), reducing the energy cost to about 3\% compared to the Nvidia A100 GPU. However, the inherent noise of RRAM on the saved weights leads to performance degradation, simultaneously. To address this issue, we design a novel Hardware-aware Low-rank Adaptation (HaLoRA) method. The key insight is to train a LoRA branch that is robust toward such noise and then deploy it on noise-free SRAM, while the extra cost is negligible since the parameters of LoRAs are much fewer than pretrained weights (e.g., 0.15\% for LLaMA-3.2 1B model). To improve the robustness towards the noise, we theoretically analyze the gap between the optimization trajectories of the LoRA branch under both ideal and noisy conditions and further design an extra loss to minimize the upper bound of this gap. Therefore, we can enjoy both energy efficiency and accuracy during inference. Experiments finetuning the Qwen and LLaMA series demonstrate the effectiveness of HaLoRA across multiple reasoning tasks, achieving up to \textbf{22.7} improvement in average score while maintaining robustness at various noise types and noise levels.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。