SEAINEAug 20, 2024

Automated Prompt Engineering for Cost-Effective Code Generation Using Evolutionary Algorithm

arXiv:2408.11198v24 citationsh-index: 6
Originality Incremental advance
AI Analysis

This addresses cost reduction for developers using LLMs in software development, offering a more efficient alternative to existing iterative methods.

The paper tackles the high cost of iterative prompt engineering for code generation by proposing EPiC, an evolutionary algorithm that refines prompts to improve code quality with minimal LLM interactions, achieving up to 6% higher pass@k and 2-10 times better cost-effectiveness than SOTA methods.

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.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes