Skip to main content
QUICK REVIEW

[논문 리뷰] Fine-Tuning Language Models with Just Forward Passes

Sadhika Malladi, Tianyu Gao|arXiv (Cornell University)|2023. 05. 27.
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를 제로샷, in-context learning, 선형 탐색, 및 전체 파인튜닝과 비교한다 across model sizes and tasks.

제안 방법

  • 프롬프트를 사용해 파인튜닝 목표를 pre-training과 정렬시키고 zeroth-order 최적화를 가능하게 한다.
  • 중형 크기의 마스킹 언어 모델(RoBERTa-large)과 대형 autoregressive 언어 모델(OPT-13B, 30B, 66B) 전반에 걸쳐 MeZO를 평가한다.
  • MeZO 하에서의 전체 파라미터 파인튜닝, LoRA, 프리픽스-튜닝과 전통적인 역전파 파인튜닝과의 비교.
  • 메모리 사용량과 학습 스텝을 기록하여 MeZO의 메모리 절감과 학습 효율성을 보인다.
  • 정확도 및 F1 점수와 같은 비미분가능한 목표를 사용하는 최적화를 탐구한다.

실험 결과

연구 질문

  • RQ1프롬프트 기반 순전파 파인튜닝 목표가 모델 크기에 걸쳐 전체 파라미터 파인튜닝 성능을 근사할 수 있는가?
  • RQ2정확도와 메모리 사용 측면에서 MeZO가 제로샷, ICL, LP, FT와 어떻게 비교되는가?
  • RQ3프롬프트를 사용하는 것이 NLP 파인튜닝에서 zeroth-order 최적화를 효과적으로 가능하게 하는가?
  • RQ4다양한 규모에서 MeZO를 사용할 때 학습 스텝과 메모리 절감 사이의 트레이드오프는 무엇인가?

주요 결과

  • MeZO는 모델 유형과 태스크 전반에서 제로샷 및 선형 탐색보다 우수하다.
  • MeZO는 전체 파인튜닝 성능에 근접하며, 특정 구성(예: k=512)에서는 약 5% 이내 차이로 달성하면서도 훨씬 적은 메모리를 사용한다.
  • MeZO는 FT에 비해 상당한 메모리 절감을 제공하며, 예를 들어 보고된 실험에서 OPT-13B에서 약 12× 수준이다.
  • MeZO는 정확도 및 F1 점수와 같은 비미분가능한 목표의 최적화를 지원한다.
  • 실험은 프롬프트를 사용한 few-shot 및 many-shot 설정에서 중형 마스크형 LMs와 대형 autoregressive LMs를 모두 포함한다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.