AdaMeZO:一种用于LLM微调的Adam风格零阶优化器,无需维护动量
AdaMeZO: Adam-style Zeroth-Order Optimizer for LLM Fine-tuning Without Maintaining the Moments
AI总结:
本文提出AdaMeZO,一种基于Adam风格的零阶优化器,通过估计一阶和二阶动量而不存储在内存中,有效减少GPU内存需求,同时在微调LLM时表现出色,比MeZO快70%。
摘要:
微调LLM对于各种专用下游任务是必要的,但基于反向传播的传统微调方法需要大量GPU内存。为此,最近的工作MeZO仅依赖前向传递来微调LLM,显著减少了GPU需求,但收敛速度较慢,因为其对损失景观不敏感。标准解决方案如Adam通过估计一阶和二阶动量并存储在内存中来探索损失景观,以指导模型在曲率较低的维度和较高曲率的维度之间移动。然而,直接应用Adam会抵消MeZO的优势,因为它会三倍增加内存需求。为此,我们提出了AdaMeZO,一种零阶优化器,通过估计Adam风格的一阶和二阶动量而不存储在内存中。我们对AdaMeZO进行了理论分析,并通过广泛的实验验证了其性能,证明AdaMeZO在微调LLM时能够超越MeZO,同时减少多达70%的前向传递次数。轨迹可视化证实了AdaMeZO适应不同损失景观的能力。
英文摘要:
Fine-tuning LLMs is necessary for various dedicated downstream tasks, but classic backpropagation-based fine-tuning methods require substantial GPU memory. To this end, a recent work, MeZO, which relies solely on forward passes to fine-tune LLMs, significantly reduces GPU requirements at the cost of slower convergence due to its indifference to loss landscapes. Standard solutions, such as Adam, explore loss landscapes by estimating the first- and second-order moments and storing them in memory to guide the model's movement through dimensions with lower curvature and vice versa. However, directly applying Adam negates MeZO's advantage as it will triple the memory requirement. In light of this, we propose AdaMeZO, a zeroth-order optimizer that leverages Adam-style first- and second-moment estimates without maintaining them in memory. We present a theoretical analysis of AdaMeZO, corroborated by extensive experiments demonstrating AdaMeZO's performance, showing that AdaMeZO can outperform MeZO while requiring up to $70\%$ fewer forward passes. Trajectory visualizations affirm AdaMeZO's ability to adapt to diverse loss landscapes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。