Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models
Large language models (LLMs) have brought a paradigm shift to the field of code generation, offering the potential to enhance the software development process. However, previous research mainly focuses on the accuracy of code generation, while coding style differences between LLMs and human developers remain under-explored. In this paper, we empirically analyze the differences in coding style between the code generated by mainstream LLMs and the code written by human developers, and summarize coding style inconsistency taxonomy. Specifically, we first summarize the types of coding style inconsistencies by manually analyzing a large number of generation results. We then compare the code generated by LLMs with the code written by human programmers in terms of readability, conciseness, and robustness. The results reveal that LLMs and developers exhibit differences in coding style. Additionally, we study the possible causes of these inconsistencies and provide some solutions to alleviate the problem.
Authors
- Zibin Zheng (ORCID: https://orcid.org/0000-0001-7872-7718)
- Yuchi Ma (ORCID: https://orcid.org/0009-0002-3304-1389)
- Mingzhi Mao (ORCID: https://orcid.org/0000-0001-9369-7828)
- Xilin Liu (ORCID: https://orcid.org/0009-0001-4870-1012)
- Jiachi Chen (ORCID: https://orcid.org/0000-0002-0192-9992)
- Yanlin Wang (ORCID: https://orcid.org/0000-0001-7761-7269)
- Mingwei Liu (ORCID: https://orcid.org/0000-0002-3462-997X)
- Ting Jiang
Institutions
- Sun Yat-sen University (CN)
- Huawei Technologies (China) (CN)
Publication Details
- Journal
- Proceedings of the ACM on software engineering.
- Published
- 2025-06-19
- DOI
- https://doi.org/10.1145/3715749
- Citations
- 6
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 19.48