The Impact of Prompt Programming on Function-Level Code Generation
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are increasingly used by software engineers for code generation. However, limitations of LLMs such as irrelevant or incorrect code have highlighted the need for prompt programming (or prompt engineering) where engineers apply specific prompt techniques (e.g., chain-of-thought or input-output examples) to improve the generated code. While some prompt techniques have been studied, the impact of different techniques -- and their interactions -- on code generation is still not fully understood. In this study, we introduce CodePromptEval, a dataset of 7072 prompts designed to evaluate five prompt techniques (few-shot, persona, chain-of-thought, function signature, list of packages) and their effect on the correctness, similarity, and quality of complete functions generated by three LLMs (GPT-4o, Llama3, and Mistral). Our findings show that while certain prompt techniques significantly influence the generated code, combining multiple techniques does not necessarily improve the outcome. Additionally, we observed a trade-off between correctness and quality when using prompt techniques. Our dataset and replication package enable future research on improving LLM-generated code and evaluating new prompt techniques.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 40 of its 59 references that are in the map. First posted on arXiv 29 Dec 2024.
Builds on
40 of 59 references.
References · 40
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 778
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
28 more
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
- 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 428
- 2023Self-collaboration Code Generation via ChatGPTcited by 255
- 2022Grounded Copilot: How Programmers Interact with Code-Generating Modelscited by 216
- 2024Two Tales of Persona in LLMs: A Survey of Role-Playing and Personalizationcited by 203
- 2023VeriGen: A Large Language Model for Verilog Code Generationcited by 197
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2023Software Testing with Large Language Models: Survey, Landscape, and Visioncited by 163
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2023Self-planning Code Generation with Large Language Modelscited by 121
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2023The Programmer's Assistant: Conversational Interaction with a Large Language Model for Software Developmentcited by 95
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2023Why Does ChatGPT Fall Short in Providing Truthful Answers?cited by 54
- 2023Active Learning Principles for In-Context Learning with Large Language Modelscited by 53
- 2023When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Modelscited by 50
- 2023Leveraging Large Language Models to Power Chatbots for Collecting User Self-Reported Datacited by 48
- 2021Multilingual training for Software Engineeringcited by 43
- 2023Investigating ChatGPT's Potential to Assist in Requirements Elicitation Processescited by 25
- 2024Beyond Code Generation: An Observational Study of ChatGPT Usage in Software Engineering Practicecited by 25
- 2024LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitationscited by 21
- 2024Do Advanced Language Models Eliminate the Need for Prompt Engineering in Software Engineering?cited by 19
- 2022Better Together? An Evaluation of AI-Supported Code Translationcited by 15
- 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generationcited by 9
- 2024Analyzing Prompt Influence on Automated Method Generation: An Empirical Study with Copilotcited by 6
- 2024Generating Java Methods: An Empirical Assessment of Four AI-Based Code Assistantscited by 6
- 2024Software Engineering and Foundation Models: Insights from Industry Blogs Using a Jury of Foundation Modelscited by 6
- 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6
Built on by
Citing papers per year: 2025: 5; 2026: 8.
13 papers.
Sort:
By area:
- 2025Chain-of-Code Collapse: Reasoning Failures in LLMs via Adversarial Prompting in Code Generationcited by 4
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generationcited by 4
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 3
- 2025Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiencycited by 2
- 2026Scaffold, Not Vocabulary? A Controlled, Two-Tier, Pre-Registered Study of a Popperian Code-Generation Skillcited by 2
- 2025Automatic Qiskit Code Refactoring Using Large Language Modelscited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2026From Legal Text to Executable Decision Models: Evaluating Structured Representations for Legal Decision Model Generationcited by 1
- 2026FASE: Fast Adaptive Semantic Entropy for Code Qualitycited by 1
- 2025Do AI Models Dream of Faster Code? An Empirical Study on LLM-Proposed Performance Improvements in Real-World Softwarecited by 0
- 2026Evaluating LLM-Based Goal Extraction in Requirements Engineering: Prompting Strategies and Their Limitationscited by 0
- 2026Vibe Coding Ate My Homework: An evaluation of AI approaches to greenfield software engineering and programmingcited by 0
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Models30 Jun 2026
- 2026Repository-Level Solidity Code Generation with Large Language Models: From Prompting to Fine-Tuning18 Jun 2026
- 2026Vibe Coding Ate My Homework: An evaluation of AI approaches to greenfield software engineering and programming15 Jun 2026
- 2026FASE: Fast Adaptive Semantic Entropy for Code Quality8 Jun 2026
- 2026Scaffold, Not Vocabulary? A Controlled, Two-Tier, Pre-Registered Study of a Popperian Code-Generation Skill4 Jun 2026
- 2026Evaluating LLM-Based Goal Extraction in Requirements Engineering: Prompting Strategies and Their Limitations24 Apr 2026
- 2026From Legal Text to Executable Decision Models: Evaluating Structured Representations for Legal Decision Model Generation18 Apr 2026
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2025Do AI Models Dream of Faster Code? An Empirical Study on LLM-Proposed Performance Improvements in Real-World Software17 Oct 2025
- 2025Automatic Qiskit Code Refactoring Using Large Language Models17 Jun 2025
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generation11 Jun 2025
- 2025Chain-of-Code Collapse: Reasoning Failures in LLMs via Adversarial Prompting in Code Generation8 Jun 2025
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generationcited by 4
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 3
- 2026Scaffold, Not Vocabulary? A Controlled, Two-Tier, Pre-Registered Study of a Popperian Code-Generation Skillcited by 2
- 2025Automatic Qiskit Code Refactoring Using Large Language Modelscited by 1
- 2026From Legal Text to Executable Decision Models: Evaluating Structured Representations for Legal Decision Model Generationcited by 1
- 2026FASE: Fast Adaptive Semantic Entropy for Code Qualitycited by 1
- 2025Do AI Models Dream of Faster Code? An Empirical Study on LLM-Proposed Performance Improvements in Real-World Softwarecited by 0
- 2026Evaluating LLM-Based Goal Extraction in Requirements Engineering: Prompting Strategies and Their Limitationscited by 0
- 2026Vibe Coding Ate My Homework: An evaluation of AI approaches to greenfield software engineering and programmingcited by 0
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Models30 Jun 2026
- 2026Vibe Coding Ate My Homework: An evaluation of AI approaches to greenfield software engineering and programming15 Jun 2026
- 2026FASE: Fast Adaptive Semantic Entropy for Code Quality8 Jun 2026
- 2026Scaffold, Not Vocabulary? A Controlled, Two-Tier, Pre-Registered Study of a Popperian Code-Generation Skill4 Jun 2026
- 2026Evaluating LLM-Based Goal Extraction in Requirements Engineering: Prompting Strategies and Their Limitations24 Apr 2026
- 2026From Legal Text to Executable Decision Models: Evaluating Structured Representations for Legal Decision Model Generation18 Apr 2026
- 2025Do AI Models Dream of Faster Code? An Empirical Study on LLM-Proposed Performance Improvements in Real-World Software17 Oct 2025
- 2025Automatic Qiskit Code Refactoring Using Large Language Models17 Jun 2025
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generation11 Jun 2025
Similar, not cited
Close in wording, no citation either way
- 2025Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code
- 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
- 2026Failure-Aware Enhancements for Large Language Model (LLM) Code Generation: An Empirical Study on Decision Framework ↗
- 2025Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation