LISA:面向内存高效大语言模型微调的逐层重要性采样
LISA: Layerwise Importance Sampling for Memory-Efficient Large Language Model Fine-Tuning
AI总结:
本文提出LISA方法,利用LoRA微调中层间权重范数偏斜的观察,对不同层进行重要性采样并随机冻结大多数中间层,以LoRA级内存成本超越LoRA和全参数微调性能。
摘要:
自大语言模型(LLMs)首次出现以来,机器学习社区见证了令人瞩目的进展。然而,其巨大的内存消耗已成为大规模训练的重大障碍。例如,一个7B模型在全参数训练时通常至少需要60 GB的GPU内存,这给无法访问高资源环境的研究人员带来了挑战。诸如低秩适配(Low-Rank Adaptation, LoRA)等参数高效微调技术被提出来缓解这一问题。然而,在大多数大规模微调场景中,LoRA的性能无法达到全参数训练的水平,因为它们将参数搜索限制在低秩子空间内。为了弥补这一不足,我们研究了LoRA在微调任务中的逐层特性,并观察到不同层之间权重范数存在一种意外但一致的偏斜现象。利用这一关键观察,我们发现了一种出奇简单的训练策略,该策略在广泛的设置中以低至LoRA的内存成本超越了LoRA和全参数训练。我们将其命名为逐层重要性采样AdamW(Layerwise Importance Sampled AdamW, LISA),这是LoRA的一种有前景的替代方案,它将重要性采样的思想应用于LLMs中的不同层,并在优化过程中随机冻结大多数中间层。实验结果表明,在GPU内存消耗相似或更少的情况下,LISA在下游微调任务中超越了LoRA甚至全参数微调,其中LISA在MT-Bench得分上持续比LoRA高出10%-35%,同时在MMLU、AGIEval和WinoGrande上达到相当或更好的性能。在大型模型上,特别是LLaMA-2-70B,LISA在MT-Bench、GSM8K和PubMedQA上超越了LoRA,证明了其在不同领域的有效性。
英文摘要:
The machine learning community has witnessed impressive advancements since large language models (LLMs) first appeared. Yet, their massive memory consumption has become a significant roadblock to large-scale training. For instance, a 7B model typically requires at least 60 GB of GPU memory with full parameter training, which presents challenges for researchers without access to high-resource environments. Parameter Efficient Fine-Tuning techniques such as Low-Rank Adaptation (LoRA) have been proposed to alleviate this problem. However, in most large-scale fine-tuning settings, their performance does not reach the level of full parameter training because they confine the parameter search to a low-rank subspace. Attempting to complement this deficiency, we investigate the layerwise properties of LoRA on fine-tuning tasks and observe an unexpected but consistent skewness of weight norms across different layers. Utilizing this key observation, a surprisingly simple training strategy is discovered, which outperforms both LoRA and full parameter training in a wide range of settings with memory costs as low as LoRA. We name it Layerwise Importance Sampled AdamW (LISA), a promising alternative for LoRA, which applies the idea of importance sampling to different layers in LLMs and randomly freezes most middle layers during optimization. Experimental results show that with similar or less GPU memory consumption, LISA surpasses LoRA or even full parameter tuning in downstream fine-tuning tasks, where LISA consistently outperforms LoRA by over 10%-35% in terms of MT-Bench score while achieving on-par or better performance in MMLU, AGIEval and WinoGrande. On large models, specifically LLaMA-2-70B, LISA surpasses LoRA on MT-Bench, GSM8K, and PubMedQA, demonstrating its effectiveness across different domains.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。