Tuning DeepSeek-Coder-V2-Lite-Base for C# Code Smell Detection: Advancing Towards Task Versatility in Software Maintenance

Arbi Elezi, Betim Çiço, Dhuratë Hyseni · 2025

Code smells, structural defects in source code, violate design principles, increasing technical debt—the cumulative cost of suboptimal design—and elevating software error risks. Their detection is critical for reliable software, yet their ambiguous nature leads to overlapping categories. Static analysis lacks contextual adaptability, unlike deep learning models that achieve high accuracy with proper training. This study enhances DeepSeek-Coder-V2-Lite-Base, a 16-billion-parameter open-source model optimized for coding, selected for its efficiency on constrained hardware and permissive licensing. Using Retrieval-Augmented Generation (RAG) and parameter-efficient fine-tuning (LoRA/QLoRA), it emulates classification of C# code smells—Complex Method, Complex Conditional, and Feature Envy—via generative processes, preserving task versatility. Unlike specialized systems like iSMELL or LLM4CodeSmell, it integrates generative and classification functionalities. Fine-tuning significantly improves precision, recall, and F1-score, though overfitting and class imbalance pose challenges.

Read the paper · More papers on PaperTik