Parameter-efficient fine-tuning of small language models for code generation: a comparative study of Gemma, Qwen 2.5 and Llama 3.2
Reading guide · Based on pages from the original PDF
Why read this
Practitioners scoping cheap code-model adaptation on consumer GPUs can get a ready LoRA recipe and model shortlist here, but should not expect evidence of functional code quality.
What the authors found
- On CodeAlpaca-20k measured by ROUGE-L, the fine-tuned 3B models scored 0.54 for Llama 3.2 and 0.55 for Qwen2.5. Their untuned bases scored 0.49 and 0.51. That is a 4–5 point absolute gain. The abstract's '54% and 55% improvements' appear to restate these scores rather than relative gains. PDF page 6
- Smaller models gained little or regressed. Llama 1B rose from 0.45 to 0.46, Gemma 2B from 0.46 to 0.49, and Qwen2.5-1.5B fell from 0.48 to 0.46. The authors read the shared 0.46 as a possible capacity ceiling at 1–1.5B under this recipe. PDF page 6
- The headline claim of beating larger baselines rests on Phi-3 Mini 4K base (0.17), CodeBERT (0.36) and Code2seq (0.33). Every untuned SLM base already exceeds all three, so this comparison does not isolate the effect of fine-tuning. The provenance of the baseline scores is not described. PDF page 6
Main limitation
The authors acknowledge that evaluation is ROUGE-L only, with no compilation or execution checks such as HumanEval or MBPP. Training and testing use a single dataset, and LoRA hyperparameters were not tuned. The train/test split is not described. PDF page 7
Where to start
PDF page 6 · Compare base and tuned rows in Table 2 directly, then cross-check against Table 1 in S5. Table 1 lists 24.3M/29.9M trainable parameters and 1,950 steps for the 3B models, while Table 2 lists 15M and 4K steps.
Abstract
Large language models (LLMs) have demonstrated impressive capabilities in code generation; however, their high computational demands, privacy limitations, and challenges in edge deployment restrict their practical use in domain-specific applications. This study explores the effectiveness of parameter efficient fine-tuning for small language models (SLMs) with fewer than 3 billion parameters. We adopt a hybrid approach that combines low-rank adaptation (LoRA) and 4-bit quantization (QLoRA) to reduce fine-tuning costs while preserving semantic consistency. Experiments on the CodeAlpaca-20k dataset reveal that SLMs fine-tuned with this method outperform larger baseline models, including Phi-3 Mini 4K base, in ROUGE-L. Notably, applying our approach to the LLaMA 3 3B and Qwen2.5 3B models yielded performance improvements of 54% and 55%, respectively, over untuned counterparts. We evaluate models developed by major artificial intelligence (AI) providers Google (Gemma 2B), Meta (LLaMA 3 1B/3B), and Alibaba (Qwen2.5 1.5B/3B) and show that parameter-efficient fine-tuning enables them to serve as cost-effective, high-performing alternatives to larger LLMs. These findings highlight the potential of SLMs as scalable solutions for domain-specific software engineering tasks, supporting broader adoption and democratization of neural code synthesis.