HaLoRA: 基于混合计算-内存架构的硬件感知低秩适应法用于大型语言模型
HaLoRA: Hardware-aware Low-Rank Adaptation for Large Language Models Based on Hybrid Compute-in-Memory Architecture
AI总结:
HaLoRA通过在混合计算-内存架构中部署低秩适应,利用RRAM和SRAM实现高效能和高精度的LLM微调。
摘要:
低秩适应(LoRA)是一种主流的参数高效微调方法,用于将大型语言模型(LLMs)适应到下游任务。同时,计算-内存(CIM)架构由于其在数组级别并行内存计算设计而表现出优越的能量效率。在本文中,我们提出将微调后的LLMs部署到混合CIM架构上(即预训练权重存储在高效电阻随机访问存储器(RRAM)上,而LoRA分支存储在无噪声静态随机访问存储器(SRAM)上),将能耗降低到Nvidia A100 GPU的约3%。然而,RRAM在存储权重时固有的噪声会导致性能下降。为了解决这个问题,我们设计了一种新的硬件感知低秩适应(HaLoRA)方法。关键思路是训练一个对这种噪声具有鲁棒性的LoRA分支,并将其部署在无噪声的SRAM上,而额外的成本可以忽略不计,因为LoRA的参数远少于预训练权重(例如,对于LLaMA-3.2 1B模型,为0.15%)。为了提高对噪声的鲁棒性,我们理论分析了在理想和嘈杂条件下LoRA分支优化轨迹之间的差距,并进一步设计了一个额外的损失来最小化此差距的上界。因此,我们可以在推理过程中同时享受能量效率和准确性。在微调Qwen和LLaMA系列的实验中,HaLoRA在多个推理任务上显示出有效性,实现了平均分数的最高22.7%的提升,同时在各种噪声类型和噪声水平下保持鲁棒性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。