Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
80 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models (2407.00456v1)

Published 29 Jun 2024 in cs.SE and cs.AI

Abstract: 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 Code 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 Code LLMs with the code written by human programmers in terms of readability, conciseness, and robustness. The results reveal that LLMs and developers have different coding styles. Additionally, we study the possible causes of these inconsistencies and provide some solutions to alleviate the problem.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (5)
  1. Yanlin Wang (76 papers)
  2. Tianyue Jiang (2 papers)
  3. Mingwei Liu (21 papers)
  4. Jiachi Chen (45 papers)
  5. Zibin Zheng (194 papers)
Citations (4)