Automated Prompt Engineering for Cost-Effective Code Generation Using Evolutionary Algorithm
Not on the map. Why?
Abstract (arXiv)
Large Language Models have seen increasing use in various software development tasks, especially in code generation. The most advanced recent methods attempt to incorporate feedback from code execution into prompts to help guide LLMs in generating correct code in an iterative process. While effective, these methods could be costly due to numerous interactions with the LLM and extensive token usage. To address this issue, we propose an alternative approach named Evolutionary Prompt Engineering for Code (EPiC), which leverages a lightweight evolutionary algorithm to refine the original prompts into improved versions that generate high quality code, with minimal interactions with the LLM. Our evaluation against state-of-the-art (SOTA) LLM based code generation agents shows that EPiC not only achieves up to 6% improvement in pass@k but is also 2-10 times more cost-effective than the baselines.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 32 of its 47 references that are in the map. First posted on arXiv 20 Aug 2024.
Builds on
32 of 47 references.
References · 32
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023MetaGPT: Meta Programming for A Multi-Agent Collaborative Frameworkcited by 1,808
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
- 2023Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formattingcited by 817
- 2019EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Taskscited by 807
20 more
- 2023Automatic Prompt Optimization with "Gradient Descent" and Beam Searchcited by 653
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 574
- 2023Promptbreeder: Self-Referential Self-Improvement Via Prompt Evolutioncited by 551
- 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 546
- 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 431
- 2023Self-collaboration Code Generation via ChatGPTcited by 258
- 2021Generated Knowledge Prompting for Commonsense Reasoningcited by 214
- 2023Software Testing with Large Language Models: Survey, Landscape, and Visioncited by 166
- 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 127
- 2023Chain-of-Knowledge: Grounding Large Language Models via Dynamic Knowledge Adapting over Heterogeneous Sourcescited by 122
- 2022HyperPrompt: Prompt-based Task-Conditioning of Transformerscited by 67
- 2023Effective Test Generation Using Pre-trained Large Language Models and Mutation Testingcited by 51
- 2023Enhancing Large Language Models in Coding Through Multi-Perspective Self-Consistencycited by 46
- 2023ClarifyGPT: Empowering LLM-based Code Generation with Intention Clarificationcited by 38
- 2024On the Worst Prompt Performance of Large Language Modelscited by 38
- 2024Can LLMs Generate Architectural Design Decisions? -An Exploratory Empirical studycited by 19
- 2023InstOptima: Evolutionary Multi-objective Instruction Optimization via Large Language Model-based Instruction Operatorscited by 17
- 2023SPELL: Semantic Prompt Evolution based on a LLMcited by 15
- 2023ANPL: Towards Natural Programming with Interactive Decompositioncited by 13
- 2024Can ChatGPT Support Developers? An Empirical Evaluation of Large Language Models for Code Generationcited by 11
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 1.
5 papers.
- 2024Can We Afford The Perfect Prompt? Balancing Cost and Accuracy with the Economical Prompting Indexcited by 4
- 2025Can LLMs Replace Humans During Code Chunking?cited by 2
- 2025Prompt engineering and framework: implementation to increase code reliability based guideline for LLMscited by 1
- 2025Search-Based Software Engineering and AI Foundation Models: Current Landscape and Future Roadmapcited by 0
- 2026Do Influence Tactics Matter? Investigating Prompt Framing Effects in LLM Code Generationcited by 0
- 2026Do Influence Tactics Matter? Investigating Prompt Framing Effects in LLM Code Generation11 Aug 2026
- 2025Can LLMs Replace Humans During Code Chunking?24 Jun 2025
- 2025Search-Based Software Engineering and AI Foundation Models: Current Landscape and Future Roadmap26 May 2025
- 2025Prompt engineering and framework: implementation to increase code reliability based guideline for LLMs19 Mar 2025
- 2024Can We Afford The Perfect Prompt? Balancing Cost and Accuracy with the Economical Prompting Index2 Dec 2024