Large language models (LLMs) are being used in many applications and prompts for these models are integrated into software applications as code-like artifacts. These prompts behave much like traditional software in that they take inputs, generate outputs, and perform some specific function. However, prompts differ from traditional code in many ways and require new approaches to ensure that they are robust. For example, unlike traditional software the output of a prompt depends on the AI model that interprets it. Also, while natural language prompts are easy to modify, the impact of updates is harder to predict. New approaches to testing, debugging, and modifying prompts with respect to the model running them are required.
To address some of these issues, we developed PromptPex, an LLM-based tool to automatically generate and evaluate unit tests for a given prompt. PromptPex extracts input and output specifications from a prompt and uses them to generate diverse, targeted, and valid unit tests. These tests are instrumental in identifying regressions when a prompt is changed and also serve as a tool to understand how prompts are interpreted by different models. We use PromptPex to generate tests for eight benchmark prompts and evaluate the quality of the generated tests by seeing if they can cause each of four diverse models to produce invalid output. PromptPex consistently creates tests that result in more invalid model outputs than a carefully constructed baseline LLM-based test generator. Furthermore, by extracting concrete specifications from the input prompt, PromptPex allows prompt writers to clearly understand and test specific aspects of their prompts. The source code of PromptPex is available at https://github.com/microsoft/promptpex.
HiFo-Prompt: Prompting with Hindsight and Foresight for LLM-based Automatic Heuristic Design
School of Mathematics and Statistics, Xi’an Jiaotong University, Xi’an, China(西安交通大学数学与统计学院);School of Electronics and Information, Northwest Polytechnical University, Xi’an, China(西北工业大学电子与信息学院)
Experience-Guided Reflective Co-Evolution of Prompts and Heuristics for Automatic Algorithm Design
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学北京校区人工智能学院);Department of Data Science, City University of Hong Kong(香港城市大学数据科学系);School of Information, Renmin University of China(中国人民大学信息学院);WeChat, Tencent(微信,腾讯)
School of Computer Science, Fudan University(复旦大学计算机科学学院);Tencent AI Lab(腾讯AI实验室);Institute of Modern Languages and Linguistics, Fudan University(复旦大学现代语言与语言学研究所)
An automatically discovered chain-of-thought prompt generalizes to novel models and datasets
Medical University of Vienna(维也纳医科大学);Johannes Kepler University Linz(林茨约翰内斯·开普勒大学);KTH Royal Institute of Technology(KTH皇家理工学院);Humboldt University Berlin(柏林洪堡大学)
MeLA: A Metacognitive LLM-Driven Architecture for Automatic Heuristic Design
School of Computer Science, University of Nottingham Ningbo China(诺丁汉大学宁波分校计算机科学学院);College of Teacher Education, Zhejiang Normal University(浙江师范大学教师教育学院)
ShadowCode: Towards (Automatic) External Prompt Injection Attack against Code LLMs
State Key Laboratory of Blockchain and Data Security, Zhejiang University(区块链与数据安全国家重点实验室,浙江大学);Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security, Hangzhou(杭州高新区(滨江)区块链与数据安全研究院,杭州);College of Computing and Data Science, Nanyang Technological University(计算与数据科学学院,南洋理工大学)
Beyond Scores: A Modular RAG-Based System for Automatic Short Answer Scoring with Feedback
Graduate School of Information Science and Electrical Engineering(信息科学与电气工程研究生院);Kyushu University(九州大学);Faculty of Information Science and Electrical Engineering(信息科学与电气工程学部)