arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.01452cs.LGcs.AI
收藏

鲁棒且高效的零阶LLM微调方法:自适应贝叶斯子空间优化器

Robust and Efficient Zeroth-Order LLM Fine-Tuning via Adaptive Bayesian Subspace Optimizer

School of Mathematics, Sun Yat-sen University, Guangzhou, China(中山大学数学学院)

Jian Feng, Zhihong Huang

AI总结:

本文提出BSZO方法,通过自适应贝叶斯子空间优化提升零阶LLM微调的鲁棒性和效率,实验显示在多种任务中性能优于基线方法。

摘要:

通过函数评估近似梯度来减少内存的零阶(ZO)优化方法用于微调大型语言模型(LLMs)。然而,现有方法本质上在单维空间中进行更新,在低精度训练下会出现崩溃或显著性能下降。我们引入了BSZO,即自适应贝叶斯子空间零阶优化器,该方法利用卡尔曼滤波结合多个扰动方向的有限差分信息在子空间中。通过将每个有限差分测量视为噪声观测,BSZO在子空间投影梯度上构建后验分布,并通过贝叶斯推断更新该分布,同时利用残差为基础的自适应机制以适应噪声变化。理论分析表明,与标准ZO方法相比,BSZO的收敛速度提高了k/γ倍。在RoBERTa、Mistral和OPT模型上的实验表明,BSZO在各种任务中均优于基线方法,达到OPT-13B模型上的6.67%绝对平均改进,同时在fp16/bf16精度下保持鲁棒性,并且内存使用接近仅推理基线(1.00×-1.08×的MeZO).

英文摘要:

Fine-tuning large language models (LLMs) with zeroth-order (ZO) optimization reduces memory by approximating gradients through function evaluations. However, existing methods essentially perform updates in a one-dimensional space, and suffer from collapse or substantial performance degradation under low-precision training. We introduce BSZO, an adaptive \textbf{B}ayesian \textbf{S}ubspace \textbf{Z}eroth-Order \textbf{O}ptimizer, which applies Kalman filtering to combine finite-difference information across multiple perturbation directions within a subspace. By treating each finite-difference measurement as a noisy observation, BSZO builds a posterior distribution over the subspace-projected gradient and updates it through Bayesian inference, with a residual-based adaptive mechanism to adapt to noise variations. 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 the baselines across various tasks, achieving up to 6.67\% absolute average improvement on OPT-13B while remaining robust under fp16/bf16 precision and keeping memory usage close to inference-only baselines (1.00$\times$--1.08$\times$ of MeZO).

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

↑