mlsanityData to 7 Oct 2026

Selection of Prompt Engineering Techniques for Code Generation through Predicting Code Complexity

arXiv 2409.16416 ↗First posted 24 Sep 2024cs.SE cs.AIcited by 0

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  3. 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
  4. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  5. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
  6. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
  7. 2021Program Synthesis with Large Language Modelscited by 3,509
  8. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  9. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
  10. 2020Supervised Contrastive Learningcited by 2,803
  11. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  12. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
19 more
  1. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  2. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
  3. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
  4. 2023Teaching Large Language Models to Self-Debugcited by 963
  5. 2024A Survey on Large Language Models for Code Generationcited by 646
  6. 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
  7. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 612
  8. 2022Decomposed Prompting: A Modular Approach for Solving Complex Taskscited by 554
  9. 2014Deep metric learning using Triplet networkcited by 421
  10. 2021True Few-Shot Learning with Language Modelscited by 343
  11. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
  12. 2023Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repaircited by 55
  13. 2022How to Prompt? Opportunities and Challenges of Zero- and Few-Shot Learning for Human-AI Interaction in Creative Applications of Generative Modelscited by 43
  14. 2024A Deep Dive into Large Language Models for Automated Bug Localization and Repaircited by 39
  15. 2023Automatic Model Selection with Large Language Models for Reasoningcited by 35
  16. 2024Prompting Techniques for Secure Code Generation: A Systematic Investigationcited by 33
  17. 2023Leveraging Large Language Models to Improve REST API Testingcited by 20
  18. 2016TristouNet: Triplet Loss for Speaker Turn Embeddingcited by 18
  19. 2023Assessing Evaluation Metrics for Neural Test Oracle Generationcited by 7

Built on by

Not cited yet.