用双层优化融合零阶与一阶方法,高效微调大模型并快速适应新任务。
Bilevel ZOFO: Efficient LLM Fine-Tuning and Meta-Training
- 内层用一阶参数高效微调快速适应,外层用零阶无反向传播更新全模型。
- 训练速度提升2-4倍,内存效率高,且对提示不敏感。
- 适合需要快速适配新任务的低资源场景,如小样本元学习。
针对预训练大语言模型在下游任务中使用一阶优化器微调时的高计算成本问题,现有参数高效微调(PEFT)方法虽减少参数更新,但精度常低于全量微调。零阶(ZO)方法无需反向传播,内存高效,但收敛慢且对提示敏感。本文提出双层零阶一阶优化(Bilevel-ZOFO),内层采用快速、低内存的一阶PEFT局部适应,降低零阶梯度估计方差;外层则以稳定零阶更新全模型参数。该设计既提升零阶方法稳定性,又增强PEFT泛化能力。理论证明收敛性,并实验证明:相比现有方法,本方法训练速度提升2-4倍,保持相似内存效率。通过仅更新极小部分一阶块并用零阶更新骨干网络,实现全模型容量与少样本高效性的结合,是一种高效的元学习算法。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。