Enhancing Zeroth-order Fine-tuning for Language Models with Low-rank Structures

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Chen, Yiming, Zhang, Yuan, Cao, Liyuan, Yuan, Kun, Wen, Zaiwen
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916431858237440
author Chen, Yiming
Zhang, Yuan
Cao, Liyuan
Yuan, Kun
Wen, Zaiwen
author_facet Chen, Yiming
Zhang, Yuan
Cao, Liyuan
Yuan, Kun
Wen, Zaiwen
contents Parameter-efficient fine-tuning (PEFT) significantly reduces memory costs when adapting large language models (LLMs) for downstream applications. However, traditional first-order (FO) fine-tuning algorithms incur substantial memory overhead due to the need to store activation values for back-propagation during gradient computation, particularly in long-context fine-tuning tasks. Zeroth-order (ZO) algorithms offer a promising alternative by approximating gradients using finite differences of function values, thus eliminating the need for activation storage. Nevertheless, existing ZO methods struggle to capture the low-rank gradient structure common in LLM fine-tuning, leading to suboptimal performance. This paper proposes a low-rank ZO gradient estimator and introduces a novel low-rank ZO algorithm (LOZO) that effectively captures this structure in LLMs. We provide convergence guarantees for LOZO by framing it as a subspace optimization method. Additionally, its low-rank nature enables LOZO to integrate with momentum techniques while incurring negligible extra memory costs. Extensive experiments across various model sizes and downstream tasks demonstrate that LOZO and its momentum-based variant outperform existing ZO methods and closely approach the performance of FO algorithms.
format Preprint
id arxiv_https___arxiv_org_abs_2410_07698
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Enhancing Zeroth-order Fine-tuning for Language Models with Low-rank Structures
Chen, Yiming
Zhang, Yuan
Cao, Liyuan
Yuan, Kun
Wen, Zaiwen
Machine Learning
Parameter-efficient fine-tuning (PEFT) significantly reduces memory costs when adapting large language models (LLMs) for downstream applications. However, traditional first-order (FO) fine-tuning algorithms incur substantial memory overhead due to the need to store activation values for back-propagation during gradient computation, particularly in long-context fine-tuning tasks. Zeroth-order (ZO) algorithms offer a promising alternative by approximating gradients using finite differences of function values, thus eliminating the need for activation storage. Nevertheless, existing ZO methods struggle to capture the low-rank gradient structure common in LLM fine-tuning, leading to suboptimal performance. This paper proposes a low-rank ZO gradient estimator and introduces a novel low-rank ZO algorithm (LOZO) that effectively captures this structure in LLMs. We provide convergence guarantees for LOZO by framing it as a subspace optimization method. Additionally, its low-rank nature enables LOZO to integrate with momentum techniques while incurring negligible extra memory costs. Extensive experiments across various model sizes and downstream tasks demonstrate that LOZO and its momentum-based variant outperform existing ZO methods and closely approach the performance of FO algorithms.
title Enhancing Zeroth-order Fine-tuning for Language Models with Low-rank Structures
topic Machine Learning
url https://arxiv.org/abs/2410.07698