Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Xue, Zhipeng, Zhang, Xiaoting, Gao, Zhipeng, Hu, Xing, Gao, Shan, Xia, Xin, Li, Shanping
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866918125971177472
author Xue, Zhipeng
Zhang, Xiaoting
Gao, Zhipeng
Hu, Xing
Gao, Shan
Xia, Xin
Li, Shanping
author_facet Xue, Zhipeng
Zhang, Xiaoting
Gao, Zhipeng
Hu, Xing
Gao, Shan
Xia, Xin
Li, Shanping
contents The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet-Python}) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM's input (e.g., benchmark dataset) and output (e.g., generated code). We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named SmellCC, which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet-Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings.
format Preprint
id arxiv_https___arxiv_org_abs_2508_11958
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
Xue, Zhipeng
Zhang, Xiaoting
Gao, Zhipeng
Hu, Xing
Gao, Shan
Xia, Xin
Li, Shanping
Software Engineering
The Large Language Models (LLMs) have demonstrated great potential in code-related tasks. However, most research focuses on improving the output quality of LLMs (e.g., correctness), and less attention has been paid to the LLM input (e.g., the training code quality). Given that code smells are widely existed in practice and can negatively impact software maintainability and readability, this study takes the first systematic research to assess and improve dataset quality in terms of code smells. In this work, we first conduct a preliminary study to explore the presence of code smells in a popular benchmark dataset (i.e., CodeSearchNet-Python}) and evaluate the output of several popular LLMs (i.e., DeepSeek-Coder, CodeLlama, and MagiCoder), revealing that code smell issues extensively exist in LLM's input (e.g., benchmark dataset) and output (e.g., generated code). We then conduct our systematic research by taking three main steps: Firstly, we propose an LLM-based code smell cleaning tool, named SmellCC, which automatically refactors and removes code smells. To evaluate the correctness of the code refactoring, we construct a test set of 50 repositories sourced from the CodeSearchNet-Python benchmark for functional testing. Then we apply our curated smell-cleaned dataset to fine-tune two LLMs (i.e., DeepSeek-V2 and Qwen-Coder) to explore their potential for generating high-quality code. Thirdly, we investigate the impact of code smells on two downstream tasks: code completion and code search. Lastly, we derive several actionable implications for software engineering researchers and industry practitioners from our findings.
title Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Dataset
topic Software Engineering
url https://arxiv.org/abs/2508.11958