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

双层零阶优化:高效的LLM微调与元训练

Bilevel ZOFO: Efficient LLM Fine-Tuning and Meta-Training

Department of Computer Science University of Maryland - College Park(计算机科学系马里兰大学- College Park);Department of Computer Science and Engineering University of Texas at Arlington(计算机科学与工程系德克萨斯理工大学阿灵顿分校)

Reza Shirkavand, Peiran Yu, Qi He, Heng Huang

AI总结:

Bilevel-ZOFO结合了快速的FO-PEFT内循环和稳定的ZO外循环,实现高效LLM微调与元训练,提升训练速度和泛化能力。

摘要:

使用一阶(FO)优化器对预训练的大语言模型(LLM)进行下游任务微调存在显著的计算挑战。参数高效微调(PEFT)方法通过冻结大部分模型参数并仅训练一小部分参数来解决这些问题。然而,当需要高任务特定精度时,PEFT通常不如全微调表现。零阶(ZO)方法通过仅使用前向传递估计梯度来微调整个预训练模型,无需反向传播。虽然内存效率高,但ZO方法在收敛速度和提示选择敏感性方面存在不足。我们通过双层零阶优化(Bilevel-ZOFO)弥合这两个世界,这是一种双层优化方法,将快速、局部的FO-PEFT适应(内层)与稳定、内存高效的ZO更新(外层)相结合。FO-PEFT内循环执行快速、低内存的局部适应,减少ZO估计的方差并稳定搜索,引导外层ZO更新整个模型,减少提示敏感性。同时,外层ZO为PEFT提供了更好的泛化能力。我们提供了理论收敛保证,并通过实验证明,Bilevel-ZOFO显著优于现有ZO和FO-PEFT方法,实现了2-4倍更快的训练速度,同时保持相似的内存效率。此外,我们通过使用ZO更新整个模型并仅对每个任务适应一小块FO-PEFT块,展示了Bilevel-ZOFO结合了完整模型容量和少样本效率,使其成为一种非常高效的元学习算法,能够快速适应新任务。

英文摘要:

Fine-tuning pre-trained Large Language Models (LLMs) for downstream tasks using First-Order (FO) optimizers presents significant computational challenges. Parameter-Efficient Fine-Tuning (PEFT) methods address these by freezing most model parameters and training only a small subset. However, PEFT often underperforms compared to full fine-tuning when high task-specific accuracy is required. Zeroth-Order (ZO) methods fine-tune the entire pre-trained model without back-propagation, estimating gradients through forward passes only. While memory-efficient, ZO methods suffer from slow convergence and high sensitivity to prompt selection. We bridge these two worlds with Bilevel-ZOFO, a bilevel optimization method that couples fast, local FO-PEFT adaptation at the inner level with stable, memory-efficient ZO updates of the full backbone at the outer level. The FO-PEFT inner loop performs fast, low-memory local adaptation that reduces the variance of ZO estimates and stabilizes the search, guiding the outer ZO updates of the full backbone and reducing prompt sensitivity. In the mean time, the outer ZO provides better generalization ability for PEFT. We provide theoretical convergence guarantees and empirically demonstrate that Bilevel-ZOFO significantly outperforms existing ZO and FO-PEFT methods, achieving 2-4 times faster training while maintaining similar memory efficiency. Additionally, we show by updating the backbone with ZO and adapting only a tiny FO-PEFT block per task, Bilevel-ZOFO combines full-model capacity with few-shot efficiency, making it a very efficient meta-learning algorithm that quickly adapts to new tasks.

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

↑