mlsanityData to 7 Oct 2026

The Impact of Prompt Programming on Function-Level Code Generation

arXiv 2412.20545 ↗First posted 29 Dec 2024cs.SE cs.CL cs.HCcited by 13

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  4. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  5. 2021Program Synthesis with Large Language Modelscited by 3,509
  6. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  7. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  8. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  9. 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 778
  10. 2024A Survey on Large Language Models for Code Generationcited by 646
  11. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
  12. 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
28 more
  1. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 468
  2. 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 428
  3. 2023Self-collaboration Code Generation via ChatGPTcited by 255
  4. 2022Grounded Copilot: How Programmers Interact with Code-Generating Modelscited by 216
  5. 2024Two Tales of Persona in LLMs: A Survey of Role-Playing and Personalizationcited by 203
  6. 2023VeriGen: A Large Language Model for Verilog Code Generationcited by 197
  7. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
  8. 2023Software Testing with Large Language Models: Survey, Landscape, and Visioncited by 163
  9. 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
  10. 2023Self-planning Code Generation with Large Language Modelscited by 121
  11. 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
  12. 2023The Programmer's Assistant: Conversational Interaction with a Large Language Model for Software Developmentcited by 95
  13. 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
  14. 2023Why Does ChatGPT Fall Short in Providing Truthful Answers?cited by 54
  15. 2023Active Learning Principles for In-Context Learning with Large Language Modelscited by 53
  16. 2023When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Modelscited by 50
  17. 2023Leveraging Large Language Models to Power Chatbots for Collecting User Self-Reported Datacited by 48
  18. 2021Multilingual training for Software Engineeringcited by 43
  19. 2023Investigating ChatGPT's Potential to Assist in Requirements Elicitation Processescited by 25
  20. 2024Beyond Code Generation: An Observational Study of ChatGPT Usage in Software Engineering Practicecited by 25
  21. 2024LLMs in Web Development: Evaluating LLM-Generated PHP Code Unveiling Vulnerabilities and Limitationscited by 21
  22. 2024Do Advanced Language Models Eliminate the Need for Prompt Engineering in Software Engineering?cited by 19
  23. 2022Better Together? An Evaluation of AI-Supported Code Translationcited by 15
  24. 2024Enhancing Computer Programming Education with LLMs: A Study on Effective Prompt Engineering for Python Code Generationcited by 9
  25. 2024Analyzing Prompt Influence on Automated Method Generation: An Empirical Study with Copilotcited by 6
  26. 2024Generating Java Methods: An Empirical Assessment of Four AI-Based Code Assistantscited by 6
  27. 2024Software Engineering and Foundation Models: Insights from Industry Blogs Using a Jury of Foundation Modelscited by 6
  28. 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 5; 2026: 8.

13 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2025Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code
  2. 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
  3. 2024Understanding Defects in Generated Codes by Language Models
  4. 2026Prompt-Driven Code Summarization: A Systematic Literature Review
  5. 2026Failure-Aware Enhancements for Large Language Model (LLM) Code Generation: An Empirical Study on Decision Framework ↗
  6. 2025Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs
  7. 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML
  8. 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation