Fine-Tuning Language Models with Just Forward Passes

Fine-tuning language models (LMs) has yielded success on diverse downstream tasks, but as LMs grow in size, backpropagation requires a prohibitively large amount of memory. Zeroth-order (ZO) methods can in principle estimate gradients using only two forward passes but are theorized to be catastrophically slow for optimizing large models. In this work, we propose a memory-efficient zerothorder optimizer (MeZO), adapting the classical ZO-SGD method to operate in-place, thereby fine-tuning LMs with the same memory footprint as inference. For example, with a single A100 80GB GPU, MeZO can train a 30-billion parameter model, whereas fine-tuning with backpropagation can train only a 2.7B LM with the same budget. We conduct comprehensive experiments across model types (masked and autoregressive LMs), model scales (up to 66B), and downstream tasks (classification, multiple-choice, and generation). Our results demonstrate that (1) MeZO significantly outperforms in-context learning and linear probing; (2) MeZO achieves comparable performance to fine-tuning with backpropagation across multiple tasks, with up to 12x memory reduction and up to 2x GPU-hour reduction in our implementation; (3) MeZO is compatible with both full-parameter and parameter-efficient tuning techniques such as LoRA and prefix tuning; (4) MeZO can effectively optimize non-differentiable objectives (e.g., maximizing accuracy or F1). We support our empirical findings with theoretical insights, highlighting how adequate pre-training and task prompts enable MeZO to fine-tune huge models, despite classical ZO analyses suggesting otherwise.

Accurate, LargeMinibatch SGD: Training…Accurate, Large Minibatch SGD: Training ImageNet in 1 HourScaling SGD Batch Sizeto 32K for ImageNet…Scaling SGD Batch Size to 32K for ImageNet TrainingHessian-AwareZeroth-Order…Hessian-Aware Zeroth-Order Optimization for Black-Box Adversarial AttackRoBERTa: A RobustlyOptimized BERT…RoBERTa: A Robustly Optimized BERT Pretraining ApproachLarge Batch Optimizationfor Deep Learning…Large Batch Optimization for Deep Learning: Training BERT in 76 minutesRandomized AutomaticDifferentiationRandomized Automatic DifferentiationOPT: Open Pre-trainedTransformer Language…OPT: Open Pre-trained Transformer Language ModelsThe Forward-ForwardAlgorithm: Some…The Forward-Forward Algorithm: Some Preliminary InvestigationsBlack-Box PromptLearning for Pre-traine…Black-Box Prompt Learning for Pre-trained Language ModelsGPT-4 Technical ReportGPT-4 Technical ReportPromptBoosting:Black-Box Text…PromptBoosting: Black-Box Text Classification with Ten Forward PassesGrIPS: Gradient-free,Edit-based Instruction…GrIPS: Gradient-free, Edit-based Instruction Search for Prompting Large Language ModelsJust One Byte (pergradient): A Note on…Just One Byte (per gradient): A Note on Low-Bandwidth Decentralized Language Model Finetuning Using Shared RandomnessFederated Fine-tuning ofBillion-Sized Language…Federated Fine-tuning of Billion-Sized Language Models across Mobile DevicesUnmasking Transformers:A Theoretical Approach…Unmasking Transformers: A Theoretical Approach to Data Recovery via Attention WeightsZero-th Order Algorithmfor Softmax Attention…Zero-th Order Algorithm for Softmax Attention OptimizationRevisiting Zeroth-OrderOptimization for…Revisiting Zeroth-Order Optimization for Memory-Efficient LLM Fine-Tuning: A BenchmarkDeepZero: Scaling UpZeroth-Order…DeepZero: Scaling Up Zeroth-Order Optimization for Deep Model TrainingAttention is NaturallySparse with Gaussian…Attention is Naturally Sparse with Gaussian Distributed InputThe Fine-GrainedComplexity of Gradient…The Fine-Grained Complexity of Gradient Computation for Training Large Language ModelsZO-AdaMU Optimizer:Adapting Perturbation b…ZO-AdaMU Optimizer: Adapting Perturbation by the Momentum and Uncertainty in Zeroth-Order OptimizationSuperiority of Softmax:Unveiling the…Superiority of Softmax: Unveiling the Performance Edge Over Linear AttentionSparse MeZO: LessParameters for Better…Sparse MeZO: Less Parameters for Better Performance in Zeroth-Order LLM Fine-TuningPoor Man's Training onMCUs: A Memory-Efficien…Poor Man's Training on MCUs: A Memory-Efficient Quantized Back-Propagation-Free ApproachFine-Tuning LanguageModels with Just Forwar…Fine-Tuning Language Models with Just Forward Passes過去の参考文献中心の論文この論文を引用する論文古い新しい

ノードをクリックするとフォーカスを固定、空白をクリックすると本論文に戻ります。ホバーで一時的にプレビューできます。各ノードのページはタイトルから開けます。