ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS

Fuente: Zenodo
Enregistré dans:
Détails bibliographiques
Auteur principal: Petrenko, Oleksandr Mykhailovych
Format: Recurso digital
Langue:anglais
Publié: Zenodo 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866901750271705088
author Petrenko, Oleksandr Mykhailovych
author_facet Petrenko, Oleksandr Mykhailovych
contents <p><span>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. </span></p>
format Recurso digital
id zenodo_https___doi_org_10_5281_zenodo_20159214
institution Zenodo
language eng
publishDate 2025
publisher Zenodo
record_format zenodo
spellingShingle ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS
Petrenko, Oleksandr Mykhailovych
code-style analysis; PEP-8; large language models; Llama 2; Llama 3; fine-tuning; dataset size; zero shot learning; low-rank adaptation, QLoRA.
<p><span>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. </span></p>
title ENHANCING CODE-STYLE RECOGNITION WITH LLMS: DATASET SIZE CONSIDERATIONS
topic code-style analysis; PEP-8; large language models; Llama 2; Llama 3; fine-tuning; dataset size; zero shot learning; low-rank adaptation, QLoRA.
url https://doi.org/10.5281/zenodo.20159214