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.
When Prompt Engineering Meets Software Engineering: CNL-P as Natural and Robust "APIs'' for Human-AI Interaction
CSIRO’s Data61(CSIRO数据61实验室);Jiangxi Provincial Key Laboratory for High Performance Computing(江西省高性能计算重点实验室);State International Science & Technology Cooperation Base of Networked Supporting Software(网络化支持软件国际科技合作基地);Language Intelligence Research Center(语言智能研究中心);Jiangxi Normal University(江西师范大学);Institute of AI, Newcastle University, UK(人工智能研究院,新castle大学,英国);UGAiForge
Prompt Engineering Strategies for LLM-based Qualitative Coding of Psychological Safety in Software Engineering Communities: A Controlled Empirical Study
Federal University of Bahia(巴伊亚联邦大学);State University of Feira de Santana(费拉德桑塔纳州立大学);Federal University of Sergipe(塞格皮联邦大学);Federal Institute of Ceara(塞阿拉联邦理工学院)
Characterizing Fitness Landscape Structures in Prompt Engineering
Department of Data Analytics, Dalarna University(数据分析系,达拉那大学);BEACON Institute for the Study of Evolution in Action, Michigan State University(进化行为研究所,密歇根州立大学)
The Prompt Report: A Systematic Survey of Prompt Engineering Techniques
University of Maryland(马里兰大学);Learn Prompting;OpenAI;Stanford(斯坦福大学);Microsoft(微软公司);Vanderbilt(范德堡大学);Princeton(普林斯顿大学);Texas State University(德克萨斯州立大学);Icahn School of Medicine(伊坎医学院);ASST Brianza(布里安扎综合医院);Mount Sinai Beth Israel(西奈山 Beth Israel 医院);Instituto de Telecomunicações(电信研究所);University of Massachusetts Amherst(马萨诸塞大学阿默斯特分校)
Prompt Engineering for Healthcare: Methodologies and Applications
School of Computer Science, Northwestern Polytechnical University(西北工业大学计算机学院);School of Automation, Northwestern Polytechnical University(西北工业大学自动化学院);School of Computing, The University of Georgia(佐治亚大学计算学院);Department of Computer Science and Engineering, Lehigh University(利哈伊大学计算机科学与工程系);Department of Radiology, Massachusetts General Hospital and Harvard Medical School(麻省总医院与哈佛医学院放射科);Department of Computer Science and Engineering, The University of Texas at Arlington(德克萨斯大学阿灵顿分校计算机科学与工程系);School of Biomedical Engineering, ShanghaiTech University(上海科技大学生物医学工程学院);Shanghai United Imaging Intelligence Co., Ltd.(上海联影智能医疗科技有限公司);Shanghai Clinical Research and Trial Center(上海临床研究与试验中心);Department of Electronic Engineering, City University of Hong Kong(香港城市大学电子工程系)
Unleashing the potential of prompt engineering for large language models
Guangdong Provincial Key Laboratory of Interdisciplinary Research and Application for Data Science(interdisciplinary Research and Application for Data Science省重点实验室);BNU-HKBU United International College(北京师范大学-香港浸会大学联合国际学院);Research Center for Mathematics, Beijing Normal University(北京师范大学数学研究中心)
Beyond Prompt Engineering: A Systematic Analysis of Prompt Lexical Sensitivity and Its Impacts on Quality
Shenzhen Technology University(深圳技术大学);The Hong Kong Polytechnic University(香港理工大学);Zhejiang Lab(之江实验室);The Chinese University of Hong Kong(香港中文大学);HKUST (Guangzhou)(香港科技大学(广州))
Few-Shot Learning for Mental Disorder Detection: A Continuous Multi-Prompt Engineering Approach with Medical Knowledge Injection
Hefei University of Technology(合肥工业大学);Iowa State University(爱荷华州立大学);University of Delaware(特拉华大学);University of Rhode Island(罗德岛大学);University of Arizona(亚利桑那大学)