Lune

FSE2025Top-tier venue

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

Yanlin Wang, Tianyue Jiang, Mingwei Liu, Jiachi Chen, Mingzhi Mao, Xilin Liu, Yuchi Ma, Zibin Zheng

Abstract

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

11 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • CODERL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • CODERL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment cites Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation
  • CODERL+: Improving Code Generation via Reinforcement with Execution Semantics Alignment cites RLCoder: Reinforcement Learning for Repository-Level Code Completion
  • Is Self-Repair a Silver Bullet for Code Generation? cites CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • Is Self-Repair a Silver Bullet for Code Generation? cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation
  • DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning cites RLCoder: Reinforcement Learning for Repository-Level Code Completion
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and Mitigation cites RLCoder: Reinforcement Learning for Repository-Level Code Completion
  • Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • RLCoder: Reinforcement Learning for Repository-Level Code Completion cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers11

  1. LLM Hallucinations in Practical Code Generation: Phenomena, Mechanism, and MitigationZiyao Zhang, Chong Wang, Yanlin Wang, Ensheng Shi et al.ISSTA 2025 · 53 citations
  2. CODERL+: Improving Code Generation via Reinforcement with Execution Semantics AlignmentXue Jiang, Yihong Dong, Mengyang Liu, Hongyi Deng et al.ACL 2026 · 18 citations
  3. Benchmarking Reward Hack Detection in Code Environments via Contrastive AnalysisDarshan Deshpande, Anand Kannappan, Rebecca QianICML 2026 · 13 citations
  4. RLCoder: Reinforcement Learning for Repository-Level Code CompletionYanlin Wang, Yanli Wang, Daya Guo, Jiachi Chen et al.ICSE 2025 · 13 citations
  5. DrainCode: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context PoisoningYanli Wang, Jiadong Wu, Tianyue Jiang, Mingwei Liu et al.ASE 2025 · 3 citations

Builds on24

  1. Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 citations
  2. CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese et al.NeurIPS 2022 · 571 citations
  3. LEVER: Learning to Verify Language-to-Code Generation with ExecutionAnsong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov et al.ICML 2023 · 318 citations
  4. CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
  5. Is Self-Repair a Silver Bullet for Code Generation?Theo X. Olausson, Jeevana Priya Inala, Chenglong Wang, Jianfeng Gao et al.ICLR 2024 · 195 citations

Related papers

  1. Do Large Language Models Pay Similar Attention Like Human Programmers When Generating Code?Bonan Kou, Shengmai Chen, Zhijie Wang, Lei Ma et al.FSE 2024 · 8 citations
  2. CoDet-M4: Detecting Machine-Generated Code in Multi-Lingual, Multi-Generator and Multi-Domain SettingsDaniil Orel, Dilshod Azizov, Preslav NakovACL Findings 2025 · 5 citations
  3. MPCoder: Multi-user Personalized Code Generator with Explicit and Implicit Style Representation LearningZhenlong Dai, Chang Yao, WenKang Han, Yuanying Yuanying et al.ACL 2024 · 6 citations
  4. Towards Understanding the Characteristics of Code Generation Errors Made by Large Language ModelsZhijie Wang, Zijie Zhou, Da Song, Yuheng Huang et al.ICSE 2025 · 12 citations
  5. Code-SPA: Style Preference Alignment to Large Language Models for Effective and Robust Code DebuggingTengfei Wen, Xuanang Chen, Ben He, Le SunACL Findings 2025
Dusk over the sea between two cliffs drawn in fine vertical lines