A Comprehensive Evaluation of Parameter-Efficient Fine-Tuning on Method-Level Code Smell Detection
Existing code smell detection approaches—ranging from heuristic rules to machine learning (ML) and deep learning (DL)—exhibit limited performance, while full fine-tuning of large language models (LLMs) incurs prohibitive computational costs. This work presents the first systematic evaluation of parameter-efficient fine-tuning (PEFT) techniques—including Prompt Tuning, Prefix Tuning, LoRA, and (IA)³—for method-level code bad smells (e.g., Complex Conditional, Long Method) detection. We conduct experiments across four small language models and six LLMs using a high-quality GitHub dataset. Key findings: (1) Small models combined with PEFT significantly outperform both large models with PEFT and even fully fine-tuned LLMs; (2) Training data scale exerts a far greater impact on detection accuracy than the number of tunable parameters; (3) PEFT achieves comparable or superior accuracy to full fine-tuning while drastically reducing GPU memory consumption and consistently surpassing traditional detectors. Our study establishes a novel, lightweight, efficient, and deployable paradigm for code quality analysis.