Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have rapidly transformed software development, especially in code generation. However, their inconsistent performance, prone to hallucinations and quality issues, complicates program comprehension and hinders maintainability. Research indicates that prompt engineering-the practice of designing inputs to direct LLMs toward generating relevant outputs-may help address these challenges. In this regard, researchers have introduced prompt patterns, structured templates intended to guide users in formulating their requests. However, the influence of prompt patterns on code quality has yet to be thoroughly investigated. An improved understanding of this relationship would be essential to advancing our collective knowledge on how to effectively use LLMs for code generation, thereby enhancing their understandability in contemporary software development. This paper empirically investigates the impact of prompt patterns on code quality, specifically maintainability, security, and reliability, using the Dev-GPT dataset. Results show that Zero-Shot prompting is most common, followed by Zero-Shot with Chain-of-Thought and Few-Shot. Analysis of 7583 code files across quality metrics revealed minimal issues, with Kruskal-Wallis tests indicating no significant differences among patterns, suggesting that prompt structure may not substantially impact these quality metrics in ChatGPT-assisted code generation.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 20 of its 51 references that are in the map. First posted on arXiv 18 Apr 2025.
Builds on
20 of 51 references.
References · 20
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Training language models to follow instructions with human feedbackcited by 15,712
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2023A Survey on Evaluation of Large Language Modelscited by 1,227
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
- 2023Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspectivecited by 293
- 2023Better Zero-Shot Reasoning with Role-Play Promptingcited by 220
- 2024Using AI-Based Coding Assistants in Practice: State of Affairs, Perceptions, and Ways Forwardcited by 44
- 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
- 2023Navigating the Complexity of Generative AI Adoption in Software Engineeringcited by 32
- 2024Beyond Code Generation: An Observational Study of ChatGPT Usage in Software Engineering Practicecited by 25
8 more
- 2023Prompts Matter: Insights and Strategies for Prompt Engineering in Automated Software Traceabilitycited by 15
- 2024Copilot Evaluation Harness: Evaluating LLM-Guided Software Programmingcited by 13
- 2023DevGPT: Studying Developer-ChatGPT Conversationscited by 11
- 2021A Critical Comparison on Six Static Analysis Tools: Detection, Agreement, and Precisioncited by 9
- 2023Gender, Age, and Technology Education Influence the Adoption and Appropriation of LLMscited by 9
- 2023On Codex Prompt Engineering for OCL Generation: An Empirical Studycited by 8
- 2023LLM-based Interaction for Content Generation: A Case Study on the Perception of Employees in an IT departmentcited by 6
- 2024Analyzing Prompt Influence on Automated Method Generation: An Empirical Study with Copilotcited by 6
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-benchcited by 5
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Frameworkcited by 1
- 2026How Generation Architecture Shapes Code Complexity in Multi-Agent LLM Systems: A Paired Study on HumanEvalcited by 0
- 2026TARS: A Theory-of-Mind Agent for Personalized In-IDE Code Comprehensioncited by 0
- 2026TARS: A Theory-of-Mind Agent for Personalized In-IDE Code Comprehension17 Jul 2026
- 2026How Generation Architecture Shapes Code Complexity in Multi-Agent LLM Systems: A Paired Study on HumanEval29 May 2026
- 2025Refining Critical Thinking in LLM Code Generation: A Faulty Premise-based Evaluation Framework5 Aug 2025
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench30 Jun 2025
Similar, not cited
Close in wording, no citation either way
- 2024The Impact of Prompt Programming on Function-Level Code Generation
- 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
- 2024Understanding Defects in Generated Codes by Language Models
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review
- 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategies
- 2026Failure-Aware Enhancements for Large Language Model (LLM) Code Generation: An Empirical Study on Decision Framework ↗
- 2025Are They All Good? Evaluating the Quality of CoTs in LLM-based Code Generation
- 2024Does Prompt Formatting Have Any Impact on LLM Performance?