paper-with-me

홈 › Papers

The Impact of Prompt Programming on Function-Level Code Generation

2024-12-29 · Ranim Khojah, Francisco Gomes de Oliveira Neto, Mazen Mohamad, Philipp Leitner

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. Despite this, the impact of different prompt techniques -- and their combinations -- on code generation remains underexplored. 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.

📄 PDF Abstract BibTeX arXiv:2412.20545

Code (1)

icetlab/codeprompteval 공식 구현

Tasks

Code GenerationPrompt Engineering

Similar Papers 제목 키워드 기반

Large Language Models for Code Generation from Multilingual Prompts: A Curated Benchmark and a Study on Code Quality

2026-07-16 · Saima Afrin, Alessandro Midolo, Camilo Escobar-Velásquez, Mario Linares-Vásquez 외 arxiv

Large Language Models (LLMs) perform differently on identical programming tasks when prompted in different natural languages, a phenomenon known as language bias. While this behavior has been widely studied for general t…

Code GenerationText Generation

Code Generation and Algorithmic Problem Solving Using Llama 3.1 405B

2024-09-26 · Aniket Deroy, Subhankar Maity

Code generation by Llama 3.1 models, such as Meta's Llama 3.1 405B, represents a significant advancement in the field of artificial intelligence, particularly in natural language processing and programming automation. Th…

Code Generation

CSEPrompts: A Benchmark of Introductory Computer Science Prompts

2024-04-03 · Nishat Raihan, Dhiman Goswami, Sadiya Sayara Chowdhury Puspo, Christian Newman 외

Recent advances in AI, machine learning, and NLP have led to the development of a new generation of Large Language Models (LLMs) that are trained on massive amounts of data and often have trillions of parameters. Commerc…

Multiple-choice

An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods

2026-05-22 · Mohammed Kharma, Ahmed Sabbah, Mohammad Alkhanafseh, Mohammad Hammoudeh 외 arxiv

The growing use of Large Language Models (LLMs) for automated code generation has enhanced software development efficiency, but often at the cost of security. Generated code frequently overlooks critical concerns, leavin…

Prompt EngineeringCode Generation

Prompts Are Programs Too! Understanding How Developers Build Software Containing Prompts

2024-09-19 · Jenny T. Liang, Melissa Lin, Nikitha Rao, Brad A. Myers

Generative pre-trained models power intelligent software features used by millions of users controlled by developer-written natural language prompts. Despite the impact of prompt-powered software, little is known about i…

Prompt Engineering