Skip to main content
QUICK REVIEW

[論文レビュー] Fine-Tuning Language Models with Just Forward Passes

Sadhika Malladi, Tianyu Gao|arXiv (Cornell University)|May 27, 2023
Topic ModelingComputer Science被引用数 35
ひとこと要約

本論文は MeZO を紹介します。前方パスのみのプロンプトを用いた微調整アプローチで、完全微調整の性能に近づけつつ、メモリ使用量を大幅に削減します。モデルサイズとタスクを跨いで。ゼロショット、線形プロービング、PEFT の比較も可能にします。

ABSTRACT

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.

研究の動機と目的

  • メモリ使用量を抑えた大規模言語モデルの効率的な微調整を動機づける。
  • プロンプトベースの前向きのみ最適化が、完全な微調整の性能を近似できることを示す。
  • MeZO を、ゼロショット、インコンテクスト学習、線形プロービング、そして全微調整と、モデルサイズやタスクを横断して比較する。

提案手法

  • 微調整の目的を事前学習と整合させるためにプロンプトを用い、zeroth-order 最適化を可能にする。
  • 中規模のマスク済み言語モデル(RoBERTa-large)と大型自己回帰言語モデル(OPT-13B、30B、66B)にわたって MeZO を評価する。
  • MeZO の下での全パラメータ微調整、LoRA、そして prefix-tuning を、従来のバックプロパゲーション微調整と比較する。
  • メモリ使用量とトレーニングステップを記録し、MeZO のメモリ節約とトレーニング効率を示す。
  • 精度やF1スコアなどの非微分可能な目的関数を含む最適化を探る。

実験結果

リサーチクエスチョン

  • RQ1プロンプトベースの前向きパス微調整目的が、モデルサイズを問わず全パラメータ微調整の性能を近似できるか?
  • RQ2精度とメモリ使用量の観点で、MeZO はゼロショット、ICL、LP、FTとどう比較されるか?
  • RQ3プロンプトの使用は、NLP の微調整において zeroth-order 最適化を効果的に機能させるか?
  • RQ4異なるスケールで MeZO を使用する際の、トレーニングステップとメモリ節約のトレードオフは何か?

主な発見

  • MeZO はモデルタイプとタスクを横断して、zero-shot および linear probing を上回る。
  • MeZO は全微調整の性能に近づき、特定の設定(例: k=512)で約5%以内でありつつ、はるかに少ないメモリを使用する。
  • MeZO は FT と比較して大幅なメモリ節約を提供し、報告された実験では OPT-13B で約12×程度。
  • MeZO は accuracy や F1 score などの非微分可能な目的の最適化をサポートします。
  • 実験には、few-shot および many-shot 設定で、プロンプトを用いた中規模のマスク付きLMと大規模自己回帰LMの両方を含む。

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。