arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.07698cs.LG
收藏

利用低秩结构增强语言模型的零阶微调

Enhancing Zeroth-order Fine-tuning for Language Models with Low-rank Structures

Beijing International Center for Mathematical Research, Peking University(北京大学北京国际数学研究中心);Center for Data Science, Peking University(北京大学数据科学中心);Center for Machine Learning Research, Peking University(北京大学机器学习研究中心)

Yiming Chen, Yuan Zhang, Liyuan Cao, Kun Yuan, Zaiwen Wen

AI总结:

针对零阶微调难以捕捉低秩梯度结构的问题,提出低秩零阶算法LOZO,有效捕捉LLMs低秩结构并支持动量技术,实验证明其优于现有ZO方法且逼近一阶算法性能。

摘要:

参数高效微调(PEFT)在将大语言模型(LLMs)适配至下游应用时显著降低了内存成本。然而,传统的第一阶(FO)微调算法由于在梯度计算期间需要存储反向传播的激活值,会带来巨大的内存开销,尤其是在长上下文微调任务中。零阶(ZO)算法通过利用函数值的有限差分来近似梯度,从而消除了激活值存储的需求,提供了一种极具前景的替代方案。尽管如此,现有的ZO方法难以捕捉LLM微调中常见的低秩梯度结构,导致性能欠佳。本文提出了一种低秩ZO梯度估计器,并引入了一种新型低秩ZO算法(LOZO),能够有效捕捉LLMs中的这种结构。我们通过将LOZO构建为子空间优化方法,为其提供了收敛性保证。此外,其低秩特性使得LOZO能够与动量技术相结合,同时仅产生可忽略不计的额外内存开销。在多种模型规模和下游任务上的广泛实验表明,LOZO及其基于动量的变体优于现有的ZO方法,并紧密逼近FO算法的性能。

英文摘要:

Parameter-efficient fine-tuning (PEFT) significantly reduces memory costs when adapting large language models (LLMs) for downstream applications. However, traditional first-order (FO) fine-tuning algorithms incur substantial memory overhead due to the need to store activation values for back-propagation during gradient computation, particularly in long-context fine-tuning tasks. Zeroth-order (ZO) algorithms offer a promising alternative by approximating gradients using finite differences of function values, thus eliminating the need for activation storage. Nevertheless, existing ZO methods struggle to capture the low-rank gradient structure common in LLM fine-tuning, leading to suboptimal performance. This paper proposes a low-rank ZO gradient estimator and introduces a novel low-rank ZO algorithm (LOZO) that effectively captures this structure in LLMs. We provide convergence guarantees for LOZO by framing it as a subspace optimization method. Additionally, its low-rank nature enables LOZO to integrate with momentum techniques while incurring negligible extra memory costs. Extensive experiments across various model sizes and downstream tasks demonstrate that LOZO and its momentum-based variant outperform existing ZO methods and closely approach the performance of FO algorithms.

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

↑