KerZOO用核函数改进零阶优化,让大模型微调更快更省显存。
KerZOO: Kernel Function Informed Zeroth-Order Optimization for Accurate and Accelerated LLM Fine-Tuning
- 引入核函数修正零阶优化的梯度估计偏差,提升稳定性
- 在OPT-2.7B上训练耗时减少74%,准确率比MeZO高2.9%
- 适合资源受限环境下高效微调大语言模型
大语言模型在众多自然语言任务中表现卓越,但传统一阶微调方法内存开销大,限制实际应用。零阶(ZO)优化通过前向传播估算梯度,避免反向传播,具备内存效率优势,但存在梯度估计偏差,显著影响收敛速度。本文从数学物理角度分析并刻画了ZO微调中低阶偏差的来源,提出基于核函数的新型ZO框架KerZOO,有效缓解偏差问题。实验表明,KerZOO在全参数与参数高效微调场景下均达到或超越现有基准,显著降低收敛迭代次数。例如,在微调OPT-2.7B模型时,于WSC和MultiRC数据集上分别节省74%和44%的总GPU训练时间,并在准确率上超过MeZO基线2.9%和2.6%。结果验证了核函数在降低ZO估计偏差中的有效性。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated impressive capabilities across numerous NLP tasks. Nevertheless, conventional first-order fine-tuning techniques impose heavy memory demands, creating practical obstacles to real-world applications. Zeroth-order (ZO) optimization has recently emerged as a promising memory-efficient alternative, as it circumvents the need for backpropagation by estimating gradients solely through forward passes--making it particularly suitable for resource-limited environments. Despite its efficiency, ZO optimization suffers from gradient estimation bias, which significantly hinders convergence speed. To address this, we analytically identify and characterize the lower-order bias introduced during ZO-based gradient estimation in LLM fine-tuning. Motivated by tools in mathematical physics, we introduce a kernel-function-based ZO framework aimed at mitigating this bias and improving optimization stability. KerZOO achieves comparable or superior performance to existing ZO baselines in both full-parameter and parameter-efficient fine-tuning settings of LLMs, while significantly reducing the number of iterations required to reach convergence. For example, KerZOO reduces total GPU training hours by as much as 74% and 44% on WSC and MultiRC datasets in fine-tuning OPT-2.7B model and can exceed the MeZO baseline by 2.9% and 2.6% in accuracy. We show that the kernel function is an effective avenue for reducing estimation bias in ZO methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。