Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Models

  • 2024-06-29 15:56:11
  • Yanlin Wang, Tianyue Jiang, Mingwei Liu, Jiachi Chen, Zibin Zheng
  • 0

Abstract

Large language models (LLMs) have brought a paradigm shift to the field ofcode generation, offering the potential to enhance the software developmentprocess. However, previous research mainly focuses on the accuracy of codegeneration, while coding style differences between LLMs and human developersremain under-explored. In this paper, we empirically analyze the differences incoding style between the code generated by mainstream Code LLMs and the codewritten by human developers, and summarize coding style inconsistency taxonomy.Specifically, we first summarize the types of coding style inconsistencies bymanually analyzing a large number of generation results. We then compare thecode generated by Code LLMs with the code written by human programmers in termsof readability, conciseness, and robustness. The results reveal that LLMs anddevelopers have different coding styles. Additionally, we study the possiblecauses of these inconsistencies and provide some solutions to alleviate theproblem.

 

Quick Read (beta)

loading the full paper ...