Abstract
Parameter-efficient fine-tuning (PEFT) methods, such as LoRA and Adapters, have become standard in Natural Language Processing for adapting large-scale models with minimal parameter updates. This paper explores whether these efficiencies translate to the domain of source code. Through an extensive evaluation using CodeT5 and PLBART on the CodeXGLUE benchmark, we identify a distinct "complexity gap." While PEFT methods effectively match or exceed full fine-tuning performance in code understanding and summarization tasks, they struggle significantly with generative tasks that require strict adherence to programming syntax. Our findings suggest that the structural complexity of code necessitates higher knowledge capacity than current low-rank or adapter-based adaptations provide.
Introduction
The proliferation of Large Language Models (LLMs) for code, such as CodeT5 and PLBART, has transformed software engineering tasks ranging from bug detection to automated code generation. However, the sheer size of these models presents a deployment challenge. In integrated development environments (IDEs), multiple specialized modules are often required simultaneously—for summarization, vulnerability detection, and cross-language translation.
Fully fine-tuning (FT) a separate 220M+ parameter model for each task is computationally prohibitive and storage-intensive. PEFT offers a potential solution by freezing the base model and training only a small fraction of additional parameters (typically <1%). While highly effective for natural language, the rigid syntax and logical density of source code raise a critical question: Does the efficiency of PEFT come at the cost of coding intelligence?
Methodology
We evaluated several PEFT strategies against the standard Full Fine-Tuning (FT) baseline:
- Adapter Training (AT): Insertion of small, trainable "bottleneck" layers between existing Transformer layers.
- LoRA (Low-Rank Adaptation): Learning two low-rank matrices to represent weight updates, keeping original weights frozen.
- FF-LoRA: A variant applying LoRA specifically to the Feed-Forward layers.
- Hybrid Approaches: Combining Adapters and LoRA to explore potential synergies.
These methods were applied to CodeT5 and PLBART architectures and tested on the CodeXGLUE benchmark, covering code summarization (Python), clone detection (Java), code generation (Java), and code translation (Java to C#).
Results and Discussion
The Understanding vs. Generation Split
Our results reveal a significant performance divergence based on task type. PEFT methods excel in "understanding" tasks, such as classification and summarization, where the model primarily needs to capture high-level intent. In these scenarios, PEFT often acts as a regularizer, preventing the overfitting commonly observed in full fine-tuning.
Conversely, "generative" tasks—where the model must produce syntactically correct code—show a marked performance drop. Generating valid code requires a level of "knowledge capacity" that low-parameter updates seem unable to provide. For instance, in Java code generation, PEFT methods lagged significantly behind the FT baseline unless a substantial percentage of parameters were tuned.
Key Performance Metrics
- Summarization Success: For Python code summarization, CodeT5 with LoRA achieved a BLEU-4 score of 20.36 using only 0.1% of parameters, outperforming the FT baseline of 20.16.
- The Generation Gap: In Java code generation, the gap was most pronounced. While full fine-tuning reached a CodeBLEU of 39.79, LoRA achieved only 34.80. Closing this gap required tuning nearly 74% of the model's parameters, undermining the efficiency benefits of PEFT.
- Clone Detection Efficiency: PEFT achieved state-of-the-art results in Java clone detection while training only ~1% of parameters, confirming its utility for discriminative tasks.
Conclusion
While PEFT is a powerful tool for code understanding and classification, it is currently insufficient for complex code generation tasks in base-sized models. Future research should focus on developing code-specific PEFT methods, perhaps incorporating structural priors like Abstract Syntax Trees (ASTs), to bridge the generation gap. Additionally, investigating whether the "complexity gap" persists in much larger models (10B+ parameters) remains a vital next step for the field.
Summary updated