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.


翻译:使用一阶优化器对预训练大语言模型进行下游任务微调面临显著的计算挑战。参数高效微调方法通过冻结大部分模型参数、仅训练少量子集来解决这一问题。然而,当需要高任务特定精度时,PEFT方法通常表现不及全参数微调。零阶方法无需反向传播即可对整个预训练模型进行微调,仅通过前向传播估计梯度。虽然内存效率高,但ZO方法存在收敛速度慢、对提示选择高度敏感的问题。我们通过双层ZOFO方法桥接这两种范式:该方法采用双层优化框架,在内层通过快速、局部的一阶PEFT进行适配,在外层通过稳定、内存高效的零阶更新优化完整骨干网络。一阶PEFT内循环执行快速、低内存的局部适配,降低零阶估计的方差并稳定搜索过程,从而指导外层对完整骨干网络的零阶更新并减少提示敏感性。同时,外层零阶优化为PEFT提供了更好的泛化能力。我们提供了理论收敛性证明,并通过实验验证双层ZOFO方法显著优于现有零阶和一阶PEFT方法,在保持相近内存效率的同时实现2-4倍的训练加速。此外,我们证明通过零阶更新骨干网络、仅针对每个任务适配微型一阶PEFT模块,双层ZOFO能够融合全模型容量与少样本效率,成为一种可快速适应新任务的高效元学习算法。

0
下载
关闭预览

相关内容

【NeurIPS2024】IPO: 面向视觉-语言模型的可解释提示优化
专知会员服务
22+阅读 · 2024年10月23日
专知会员服务
30+阅读 · 2020年9月18日
语义分割中的深度学习方法全解:从FCN、SegNet到DeepLab
炼数成金订阅号
26+阅读 · 2017年7月10日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员