Selection of Prompt Engineering Techniques for Code Generation through Predicting Code Complexity
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have demonstrated impressive performance in software engineering tasks. However, improving their accuracy in generating correct and reliable code remains challenging. Numerous prompt engineering techniques (PETs) have been developed to address this, but no single approach is universally optimal. Selecting the right PET for each query is difficult for two primary reasons: (1) interactive prompting techniques may not consistently deliver the expected benefits, especially for simpler queries, and (2) current automated prompt engineering methods lack adaptability and fail to fully utilize multi-stage responses. To overcome these challenges, we propose PET-Select, a PET-agnostic selection model that uses code complexity as a proxy to classify queries and select the most appropriate PET. By incorporating contrastive learning, PET-Select effectively distinguishes between simple and complex problems, allowing it to choose PETs that are best suited for each query's complexity level. Our evaluations on the MBPP and HumanEval benchmarks using GPT-3.5 Turbo and GPT-4o show up to a 1.9% improvement in pass@1 accuracy, along with a 74.8% reduction in token usage. Additionally, we provide both quantitative and qualitative results to demonstrate how PET-Select effectively selects the most appropriate techniques for each code generation query, further showcasing its efficiency in optimizing PET selection.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 31 of its 53 references that are in the map. First posted on arXiv 24 Sep 2024.
Builds on
31 of 53 references.
References · 31
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
- 2020Supervised Contrastive Learningcited by 2,803
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
19 more
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
- 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
- 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 554
- 2014Deep metric learning using Triplet networkcited by 421
- 2021True Few-Shot Learning with Language Modelscited by 343
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
- 2022How to Prompt? Opportunities and Challenges of Zero- and Few-Shot Learning for Human-AI Interaction in Creative Applications of Generative Modelscited by 43
- 2024A Deep Dive into Large Language Models for Automated Bug Localization and Repaircited by 39
- 2023Automatic Model Selection with Large Language Models for Reasoningcited by 35
- 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
- 2023Leveraging Large Language Models to Improve REST API Testingcited by 20
- 2016TristouNet: Triplet Loss for Speaker Turn Embeddingcited by 18
- 2023Assessing Evaluation Metrics for Neural Test Oracle Generationcited by 7
Built on by
Not cited yet.