Zeroth-Order Fine-Tuning of LLMs in Random Subspaces
Beijing Normal University(北京师范大学);Singapore Management University(新加坡国立大学);TAL Education Group(TAL教育集团);Engineering Research Center of Intelligent Technology and Educational Application (MOE)(智能技术与教育应用工程研究中心(教育部))
Ziming Yu, Pan Zhou, Sike Wang, Jia Li, Mi Tian, Hua Huang
微调大语言模型(LLM)已被证明对多种下游任务有效。然而,随着 LLM 规模增大,反向传播的内存需求变得越来越难以承受。零阶(ZO)优化方法通过利用前向传播估计梯度,提供了一种内存高效的替代方案,但其梯度估计的方差通常随模型参数维度线性增长——这对 LLM 来说是一个严重问题。本文提出随机子空间零阶(SubZero)优化方法,以应对 LLM 高维度带来的挑战。我们引入了一种为 LLM 定制的低秩扰动,可显著降低内存消耗并提升训练性能。此外,我们证明该梯度估计能紧密逼近反向传播梯度,方差低于传统 ZO 方法,并且与 SGD 结合时可保证收敛。实验结果表明,在多种语言建模任务中,与 MeZO 等标准 ZO 方法相比,SubZero 提升了微调性能并实现更快收敛。代码位于 https://github.com/zimingyy/SubZero。
英文摘要:
Fine-tuning Large Language Models (LLMs) has proven effective for a variety of downstream tasks. However, as LLMs grow in size, the memory demands for backpropagation become increasingly prohibitive. Zeroth-order (ZO) optimization methods offer a memory-efficient alternative by using forward passes to estimate gradients, but the variance of gradient estimates typically scales linearly with the model's parameter dimension$\unicode{x2013}$a significant issue for LLMs. In this paper, we propose the random Subspace Zeroth-order (SubZero) optimization to address the challenges posed by LLMs' high dimensionality. We introduce a low-rank perturbation tailored for LLMs that significantly reduces memory consumption while improving training performance. Additionally, we prove that our gradient estimation closely approximates the backpropagation gradient, exhibits lower variance than traditional ZO methods, and ensures convergence when combined with SGD. Experimental results show that SubZero enhances fine-tuning performance and achieves faster convergence compared to standard ZO approaches like MeZO across various language modeling tasks. Code is available at https://github.com/zimingyy/SubZero.
ZorBA: Zeroth-order Federated Fine-tuning of LLMs with Heterogeneous Block Activation
Department of Electrical and Computer Engineering, The University of British Columbia, Vancouver, Canada(电气与计算机工程系,不列颠哥伦比亚大学);Department of Computer Science and Engineering, Southern University of Science and Technology, China(计算机科学与工程系,南方科技大学)
Zeroth-Order Fine-Tuning of LLMs with Extreme Sparsity
Princeton University(普林斯顿大学);Stevens Institute of Technology(史蒂文斯理工学院);University of Pennsylvania(宾夕法尼亚大学);Rice University(莱斯大学);Carnegie Mellon University(卡内基梅隆大学);Cornell University(康奈尔大学)
TeZO: Empowering the Low-Rankness on the Temporal Dimension in the Zeroth-Order Optimization for Fine-tuning LLMs
Faculty of Engineering, The University of Sydney(悉尼大学工程学院);School of Cyber Science and Technology, Shenzhen Campus of Sun Yat-sen University(中山大学深圳校区网络与空间安全学院)
Differentially Private Zeroth-Order Methods for Scalable Large Language Model Finetuning
Zhejiang University(浙江大学);Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security(杭州高新区(滨江)区块链与数据安全研究院);University of Chicago(芝加哥大学)
CurvZO: Adaptive Curvature-Guided Sparse Zeroth-Order Optimization for Efficient LLM Fine-Tuning
Department of Computer Science and Engineering, Southern University of Science and Technology, Shenzhen, China.(计算机科学与工程系,南方科技大学,深圳,中国);Department of Mathematics, Southern University of Science and Technology, Shenzhen, China.(数学系,南方科技大学,深圳,中国)
National University of Singapore(新加坡国立大学);Institute of Data Science, National University of Singapore(新加坡国立大学数据科学研究院);Guangdong Lab of AI and Digital Economy (SZ)(广东人工智能与数字经济实验室(深圳));Laboratory for Information and Decision Systems, MIT(麻省理工学院信息与决策系统实验室)
Aligned but Fragile: Enhancing LLM Safety Robustness via Zeroth-Order Optimization
The State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security(杭州高科技园区(滨江)区块链与数据安全研究院);Sun Yat-sen University(中山大学);KAUST(卡塔尔大学)
Projecting Out the Malice: A Global Subspace Approach to LLM Detoxification
State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences(中国科学院人工智能安全国家重点实验室,计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Dalian University of Technology(大连理工大学)
GloSS over Toxicity: Understanding and Mitigating Toxicity in LLMs via Global Toxic Subspace
Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Dalian University of Technology(大连理工大学)
Revisiting Zeroth-Order Optimization for Memory-Efficient LLM Fine-Tuning: A Benchmark
Michigan State University(密歇根州立大学);The University of North Carolina at Chapel Hill(北卡罗来纳大学教堂山分校);UT Austin(德克萨斯大学奥斯汀分校);University of Minnesota Twin Cities(明尼苏达大学双城分校);IBM Research(IBM研究院);Princeton University(普林斯顿大学);DAMO Academy, Alibaba Group(阿里巴巴达摩院);MIT(麻省理工学院);Harvard University(哈佛大学)
The Multi-Query Paradox in Zeroth-Order Optimization
Department of Computer Science and Engineering, The Chinese University of Hong Kong, Hong Kong(香港中文大学计算机科学与工程系);The Chinese University of Hong Kong, Hong Kong(香港中文大学);Xiamen University, China(厦门大学)
Tsinghua University(清华大学);Zhongguancun Laboratory(中关村实验室);Institute for AI Industry Research (AIR), Tsinghua University(清华大学人工智能产业研究院(AIR));Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)