用零阶优化实现多任务微调,节省显存还更高效
MaZO: Masked Zeroth-Order Optimization for Multi-Task Fine-Tuning of Large Language Models
- 通过重要性评分筛选关键参数,减少更新维度
- 多任务掩码机制降低梯度方差与任务冲突
- 适合显存有限但需多任务训练的场景
大语言模型在多任务上表现优异,但微调需大量显存,限制了资源受限环境的应用。零阶(ZO)优化无需反向传播,可节省内存,但存在梯度方差高问题,且以往研究主要集中在单任务学习,未探索其在多任务场景下的应用。多任务学习能提升泛化能力,但在ZO设置下面临梯度方差放大和参数共线性等挑战。本文提出MaZO,首个专为多任务大模型零阶微调设计的框架。通过两项创新:基于权重重要性的关键参数识别机制,以及多任务权重更新掩码,仅对关键参数进行更新,降低参数空间维度,缓解任务冲突。实验表明,MaZO性能超越现有第一阶多任务微调方法,达到当前最优水平。
原文摘要 · Abstract (English)
Large language models have demonstrated exceptional capabilities across diverse tasks, but their fine-tuning demands significant memory, posing challenges for resource-constrained environments. Zeroth-order (ZO) optimization provides a memory-efficient alternative by eliminating the need for backpropagation. However, ZO optimization suffers from high gradient variance, and prior research has largely focused on single-task learning, leaving its application to multi-task learning unexplored. Multi-task learning is crucial for leveraging shared knowledge across tasks to improve generalization, yet it introduces unique challenges under ZO settings, such as amplified gradient variance and collinearity. In this paper, we present MaZO, the first framework specifically designed for multi-task LLM fine-tuning under ZO optimization. MaZO tackles these challenges at the parameter level through two key innovations: a weight importance metric to identify critical parameters and a multi-task weight update mask to selectively update these parameters, reducing the dimensionality of the parameter space and mitigating task conflicts. Experiments demonstrate that MaZO achieves state-of-the-art performance, surpassing even multi-task learning methods designed for first-order optimization.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。