📄 Research Article
BIJESS Vol. 13, No. 4 (2025)
ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS
Oleksandr Mykhailovych Petrenko
Department of Applied Mathematics, Lviv Polytechnic National University, Ukraine
British International Journal of Education and Social Sciences,
Vol. 13, No. 4 (2025),
pp. 21-30 |
DOI: https://doi.org/10.5281/zenodo.20159214
Open Access
Peer Reviewed
Research Article
Abstract
One aspect of a well-written codebase is its adherence to a particular code style, and Large Language Models (LLMs) can greatly assist in reviewing and adapting the code to follow the defined conventions. Because specific code-style rules are typically not known during the pre-training of the base model, additional fine-tuning is necessary. However, the exact number of training samples required to achieve optimal model performance is unclear. The significance of dataset size when fine-tuning LLMs to categorize Python code snippets as compliant or noncompliant with the specific PEP-8 indentation rule is investigated in this work. We used Low-Rank Adaptation (LoRA) and its quantized variant (QLoRA) to fine-tune the Llama 2 7B and Llama 3 8B models on datasets of varying sizes, ranging from 60 to 480 training samples. Our experiments demonstrated that the models fine-tuned with larger datasets (240 and 480 samples) achieved accuracies of up to 99%, whereas those trained with smaller datasets (60 and 120 samples) experienced over fitting and lower accuracy. Subsequent research will be based on these findings to explore the potential of LLMs and improve code readability, maintainability, and adherence to coding standards in software development. The methodology used to determine the sufficient number of training samples can also be valuable for fine-tuning LLMs in other domains where strict style or formatting conventions are required, such as legal document preparation, standardized medical reporting, or financial regulatory filings.
Keywords:
["code-style analysis","PEP-8","large language models","Llama 2","Llama 3","fine-tuning","dataset size","zero shot learning","low-rank adaptation","QLoRA"]
📑 How to Cite This Article
APA 7th Edition:
Oleksandr Mykhailovych Petrenko (2025). ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS. British International Journal of Education and Social Sciences, 13(4), 21-30. https://doi.org/https://doi.org/10.5281/zenodo.20159214
Oleksandr Mykhailovych Petrenko (2025). ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS. British International Journal of Education and Social Sciences, 13(4), 21-30. https://doi.org/https://doi.org/10.5281/zenodo.20159214
Vancouver Style:
Oleksandr Mykhailovych Petrenko. ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS. Br. Int. J. Educ. Soc. Sci.. 2025;13(4):21-30. DOI: https://doi.org/10.5281/zenodo.20159214
Oleksandr Mykhailovych Petrenko. ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS. Br. Int. J. Educ. Soc. Sci.. 2025;13(4):21-30. DOI: https://doi.org/10.5281/zenodo.20159214
🔗 Other Articles in This Issue