Fine-tuning large language models (LLMs) with zeroth-order (ZO) optimization reduces memory by approximating gradients through function evaluations, but existing methods rely on one-step gradient estimates from random perturbations. We introduce Bayesian Subspace Zeroth-Order optimization (BSZO), a ZO optimizer that applies Kalman filtering to combine finite-difference information across multiple perturbation directions. By treating each finite-difference measurement as a noisy observation, BSZO builds a posterior distribution over the projected gradient and updates it through Bayesian inference, with a residual-based adaptive mechanism to adjust perturbation scales. Theoretical analysis shows that BSZO improves the convergence rate by a factor of $k/γ$ compared to standard ZO methods. Experiments on RoBERTa, Mistral, and OPT models show that BSZO outperforms MeZO, MeZO-Adam, and HiZOO across various tasks, achieving up to 6.67\% absolute average improvement on OPT-13B while keeping memory usage close to inference-only baselines (1.00$\times$--1.08$\times$ of MeZO).


翻译:通过零阶优化对大语言模型进行微调,可利用函数评估近似梯度以降低内存需求,但现有方法依赖于随机扰动产生的一步梯度估计。本文提出贝叶斯子空间零阶优化方法,这是一种应用卡尔曼滤波融合多个扰动方向有限差分信息的零阶优化器。BSZO将每个有限差分测量视为含噪观测,通过贝叶斯推断构建投影梯度的后验分布并进行更新,同时采用基于残差的自适应机制调整扰动尺度。理论分析表明,与标准零阶方法相比,BSZO将收敛速度提升了$k/γ$倍。在RoBERTa、Mistral和OPT模型上的实验表明,BSZO在多项任务中均优于MeZO、MeZO-Adam和HiZOO方法,在OPT-13B模型上实现了最高6.67%的绝对平均性能提升,同时保持内存使用量接近纯推理基线水平(为MeZO的1.00$\times$--1.08$\times$)。

0
下载
关闭预览

相关内容

梯度的本意是一个向量(矢量),表示某一函数在该点处的方向导数沿着该方向取得最大值,即函数在该点处沿着该方向(此梯度的方向)变化最快,变化率最大(为该梯度的模)。
【牛津大学】贝叶斯优化用于自动化机器学习,321页pdf
专知会员服务
31+阅读 · 2024年5月17日
【2023新书】贝叶斯优化:使用Python的理论和实践,243页pdf
【ETH博士论文】贝叶斯深度学习,241页pdf
专知
10+阅读 · 2022年1月16日
【干货书】贝叶斯推断随机过程,449页pdf
专知
30+阅读 · 2020年8月27日
一文读懂机器学习中的贝叶斯统计学
数据分析
26+阅读 · 2019年5月8日
【深度】让DL可解释?这一份66页贝叶斯深度学习教程告诉你
GAN生成式对抗网络
15+阅读 · 2018年8月11日
贝叶斯机器学习前沿进展
机器学习研究会
21+阅读 · 2018年1月21日
国家自然科学基金
16+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Arxiv
0+阅读 · 1月27日
VIP会员
相关VIP内容
【牛津大学】贝叶斯优化用于自动化机器学习,321页pdf
专知会员服务
31+阅读 · 2024年5月17日
【2023新书】贝叶斯优化:使用Python的理论和实践,243页pdf
相关资讯
【ETH博士论文】贝叶斯深度学习,241页pdf
专知
10+阅读 · 2022年1月16日
【干货书】贝叶斯推断随机过程,449页pdf
专知
30+阅读 · 2020年8月27日
一文读懂机器学习中的贝叶斯统计学
数据分析
26+阅读 · 2019年5月8日
【深度】让DL可解释?这一份66页贝叶斯深度学习教程告诉你
GAN生成式对抗网络
15+阅读 · 2018年8月11日
贝叶斯机器学习前沿进展
机器学习研究会
21+阅读 · 2018年1月21日
相关基金
国家自然科学基金
16+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员