基于投影梯度对齐扰动的零阶优化实现大语言模型快速微调
Towards Fast LLM Fine-tuning through Zeroth-Order Optimization with Projected Gradient-Aligned Perturbations
AI总结:
针对现有零阶优化LLM微调梯度估计方差高、收敛慢的问题,提出带投影梯度对齐扰动的P-GAP方法,可减少扰动参数与方差,在分类、生成任务上准确率提升且显著降低训练成本。
摘要:
由于内存占用需求更低,采用零阶(ZO)优化对大语言模型(LLM)进行微调已成为传统基于梯度方法的一种有前景的替代方案。然而,现有零阶方法存在梯度估计方差高的问题,导致收敛速度慢,在大规模模型上表现欠佳。本研究提出P-GAP,一种基于投影梯度对齐扰动零阶优化的快速LLM微调方法。具体而言,我们首先估计一个低维梯度空间,然后在该空间内沿投影梯度方向对齐扰动。该方法能够减少受扰动的参数数量并降低方差,从而加快LLM微调的收敛速度。在多个LLM上的实验表明,P-GAP的表现始终优于基线方法:在分类任务上准确率最高提升6%,在生成任务上准确率最高提升12%,同时训练迭代次数最多减少约81%,GPU耗时最多减少70%。这些结果表明,P-GAP可实现快速、可扩展且资源高效的零阶LLM微调。
英文摘要:
Fine-tuning large language models (LLMs) using zeroth-order (ZO) optimization has emerged as a promising alternative to traditional gradient-based methods due to its reduced memory footprint requirement. However, existing ZO methods suffer from high variance in gradient estimation, leading to slow convergence and suboptimal performance on large-scale models. In this work, we propose P-GAP, a fast LLM fine-tuning approach through zeroth-order optimization with Projected Gradient-Aligned Perturbations. Specifically, we first estimate a low-dimensional gradient space and then align perturbations in projected gradients' direction within the space. This approach enables reduced the number of perturbed parameters and decreased variance, therefore accelerated convergence for LLM fine-tuning. Experiments on LLMs show that P-GAP consistently surpasses the baselines, achieving up to 6% increase in accuracy on classification tasks and up to 12% higher accuracy on generation tasks, with up to about 81% less training iterations and 70% less GPU hours. These results demonstrate that P-GAP enables fast, scalable, and resource-efficient ZO LLM fine-tuning.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。