Skip to main content
QUICK REVIEW

[논문 리뷰] Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models

Martin Weyssow, Xin Zhou|arXiv (Cornell University)|2023. 08. 21.
Speech Recognition and SynthesisComputer Science인용 수 12
한 줄 요약

이 연구는 PEFT 기법(LoRA, IA3, Prompt tuning, Prefix tuning)을 사용한 Python 코드 생성에서의 성능을 평가하고, 자원 제약 하에서 ICL 및 전체 미세조정과 비교하며, 공동 학습 및 양자화(QLoRA)를 통해 메모리 사용량을 줄이는 방안을 탐구합니다.

ABSTRACT

Large language models (LLMs) demonstrate impressive capabilities to generate accurate code snippets given natural language intents in a zero-shot manner, i.e., without the need for specific fine-tuning. While prior studies have highlighted the advantages of fine-tuning LLMs, this process incurs high computational costs, making it impractical in resource-scarce environments, particularly for models with billions of parameters. To address these challenges, previous research explored in-context learning (ICL) and retrieval-augmented generation (RAG) as strategies to guide the LLM generative process with task-specific prompt examples. However, ICL and RAG introduce inconveniences, such as the need for designing contextually relevant prompts and the absence of learning task-specific parameters, thereby limiting downstream task performance. In this context, we foresee parameter-efficient fine-tuning (PEFT) as a promising approach to efficiently specialize LLMs to task-specific data while maintaining reasonable resource consumption. In this paper, we deliver a comprehensive study of PEFT techniques for LLMs in the context of automated code generation. Our comprehensive investigation of PEFT techniques for LLMs reveals their superiority and potential over ICL and RAG across a diverse set of LLMs and three representative Python code generation datasets: Conala, CodeAlpacaPy, and APPS. Furthermore, our study highlights the potential for tuning larger LLMs and significant reductions in memory usage by combining PEFT with quantization. Therefore, this study opens opportunities for broader applications of PEFT in software engineering scenarios. Our code is available at https://github.com/martin-wey/peft-llm-code/.

연구 동기 및 목표

  • PEFT로 튜닝된 LLM이 작은 모델에 대해 전체 미세조정 및 PEFT를 적용한 경우와 비교하여 Python 코드 생성에서 어떤 성능을 내는지 평가한다.
  • PEFT 기법이 LLM의 코드 관련 작업에서 ICL보다 우수한지 평가한다.
  • 두 데이터 세트에서 LoRA를 공동으로 미세조정할 때의 효과를 탐구한다.
  • 대규모 모델의 메모리 사용을 줄이기 위해 LoRA와 양자화를 결합하는 방법을 조사한다.

제안 방법

  • 네 가지 PEFT 기법(LoRA, IA3, Prompt tuning, Prefix tuning)을 코드계열별 여러 모델군(CodeT5+, CodeGen, CodeGen2, CodeLlama)과 여덟 가지 대형 모델 plus 세 가지 소형 변형에서 비교한다.
  • 두 개의 Python 코드 생성 데이터 세트(CoNaLa, CodeAlpacaPy)에서 평가하여 HumanEval 편향을 피한다.
  • 24 GB GPU 제약 하에서 작은 모델의 In-Context Learning 및 전체 미세조정과 비교 benchmarking을 수행한다.
  • 두 데이터 세트에 대해 함께 학습된 단일 LoRA 어댑터와 데이터 세트별 LoRA 어댑터를 비교한다.
  • 메모리 점유를 줄이고 한정된 자원에서도 최대 CodeLlama-34B까지 튜닝이 가능하도록 QLoRA를 검토한다.
Fig. 1 . Peak GPU memory consumption during the fine-tuning of models using full fine-tuning (ft), LoRA, and QLoRA.
Fig. 1 . Peak GPU memory consumption during the fine-tuning of models using full fine-tuning (ft), LoRA, and QLoRA.

실험 결과

연구 질문

  • RQ1RQ1: PEFT로 튜닝된 LLM이 24 GB GPU 메모리 하에서 코드 생성 시 소형 모델의 전체 미세조정 및 PEFT와 how 비교되는가?
  • RQ2RQ2: 코드 작업에서 PEFT 기법이 ICL보다 더 유망한가?
  • RQ3RQ3: 두 데이터 세트에서 공동으로 미세조정할 때 LoRA의 성능은 어떤가?
  • RQ4RQ4: LoRA와 양자화를 결합하여 더 큰 모델의 자원 사용을 추가로 줄일 수 있는가?

주요 결과

  • LoRA-, IA3-, 및 Prompt-tuning으로 튜닝된 LLM(수백만 개의 학습 가능한 매개변수)은 수억 개의 매개변수를 가진 소형 모델에 비해 더 나은 성능을 보인다.
  • LoRA는 일반적으로 PEFT 방법 중 가장 높은 효과를 제공하며 소형 모델에 대해 전체 미세조정보다 나을 수 있다.
  • LoRA는 CoNaLa와 CodeAlpacaPy 모두에서 ICL에 비해 모든 모델에서 성능을 크게 향상시킨다.
  • 두 데이터 세트에서 함께 학습하도록 단일 LoRA 어댑터를 학습하면 데이터셋별 LoRA 어댑터에 비해 비슷한 효과를 얻는다.
  • QLoRA는 메모리 사용을 대폭 줄여 LoRA의 약 절반 정도의 메모리로 미세조정이 가능하게 하며, 24 GB 미만 자원에서 CodeLlama-34B까지 미세조정이 가능하도록 지원한다.

이 논문 읽기

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

누빈트에서 이 논문 읽기

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