[Paper Review] Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Models
The paper evaluates PEFT techniques (LoRA, IA3, Prompt tuning, Prefix tuning) for Python code generation with LLMs, comparing against ICL and full fine-tuning under resource constraints, and explores joint training and quantization (QLoRA) to reduce memory usage.
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/.
Motivation & Objective
- Assess how PEFT-tuned LLMs perform on Python code generation versus small models fully fine-tuned and PEFT-equipped.
- Evaluate whether PEFT methods outperform In-Context Learning (ICL) for code-related tasks in LLMs.
- Explore LoRA's effectiveness when fine-tuning two datasets jointly.
- Investigate further resource reductions by combining LoRA with quantization for large models.
Proposed method
- Compare four PEFT techniques (LoRA, IA3, Prompt tuning, Prefix tuning) across multiple model families (CodeT5+, CodeGen, CodeGen2, CodeLlama) and eight large plus three small variants.
- Evaluate on two Python code generation datasets (CoNaLa, CodeAlpacaPy) to avoid HumanEval biases.
- Benchmark against In-Context Learning and full fine-tuning of smaller models under a 24 GB GPU constraint.
- Test a joint LoRA adapter trained on both datasets and compare to single-dataset adapters.
- Examine QLoRA to reduce memory footprint and enable tuning of larger models up to 34B parameters under limited resources.

Experimental results
Research questions
- RQ1RQ1: How do PEFT-tuned LLMs compare to small models with full fine-tuning and PEFT on code generation under 24 GB GPU memory?
- RQ2RQ2: Are PEFT techniques more promising than ICL for code tasks in LLMs?
- RQ3RQ3: How does LoRA perform when fine-tuning LLMs jointly on both datasets?
- RQ4RQ4: Can combining LoRA with quantization further reduce resource usage while tuning larger models?
Key findings
- LoRA-, IA3-, and Prompt-tuning-tuned LLMs (a few million trainable parameters) outperform small models fully fine-tuned with hundreds of millions of parameters.
- LoRA generally yields the highest effectiveness among PEFT methods and can surpass full fine-tuning for small models.
- LoRA significantly improves performance for all models on both CoNaLa and CodeAlpacaPy compared to ICL.
- A single LoRA adapter trained jointly on both datasets achieves similar effectiveness to dataset-specific LoRA adapters.
- QLoRA reduces memory usage substantially, enabling fine-tuning with about half the memory of LoRA, and supports tuning up to CodeLlama-34B with under 24 GB.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.