AGZO:用于大语言模型微调的激活引导零阶优化
AGZO: Activation-Guided Zeroth-Order Optimization for LLM Fine-Tuning
AI总结:
提出激活引导零阶优化方法AGZO,利用前向传播中的激活结构限制扰动到低秩子空间,在保持低内存的同时提升更新方向与真实梯度的余弦相似度,缩小与一阶微调的性能差距。
摘要:
零阶优化已成为在严格内存约束下微调大语言模型的一种有前景的解决方案,因为它避免了为反向传播存储激活值所带来的过高内存成本。然而,现有的零阶方法通常采用各向同性扰动,忽略了前向传播过程中可用的丰富结构信息。在本文中,我们发现了梯度形成与激活结构之间的一个关键联系:线性层的梯度被限制在其输入激活所张成的子空间内。基于这一见解,我们提出了激活引导零阶优化方法(AGZO)。与先前方法不同,AGZO在前向传播过程中动态提取一个紧凑的、由激活信息引导的子空间,并将扰动限制在这个低秩子空间内。我们提供了一个理论框架,表明AGZO优化了一个子空间平滑的目标函数,并且能够证明其产生的更新方向与真实梯度的余弦相似度高于各向同性基线方法。在实验上,我们在Qwen3和Pangu模型上对AGZO进行了多种基准测试。AGZO持续优于最先进的零阶基线方法,并显著缩小了与一阶微调的性能差距,同时保持了与其他零阶方法几乎相同的峰值内存占用。
英文摘要:
Zeroth-Order (ZO) optimization has emerged as a promising solution for fine-tuning LLMs under strict memory constraints, as it avoids the prohibitive memory cost of storing activations for backpropagation. However, existing ZO methods typically employ isotropic perturbations, neglecting the rich structural information available during the forward pass. In this paper, we identify a crucial link between gradient formation and activation structure: the gradient of a linear layer is confined to the subspace spanned by its input activations. Leveraging this insight, we propose Activation-Guided Zeroth-Order optimization (AGZO). Unlike prior methods, AGZO extracts a compact, activation-informed subspace on the fly during the forward pass and restricts perturbations to this low-rank subspace. We provide a theoretical framework showing that AGZO optimizes a subspace-smoothed objective and provably yields update directions with higher cosine similarity to the true gradient than isotropic baselines. Empirically, we evaluate AGZO on Qwen3 and Pangu models across various benchmarks. AGZO consistently outperforms state-of-the-art ZO baselines and significantly narrows the performance gap with first-order fine-tuning, while maintaining almost the same peak memory footprint as other ZO methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。