arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.00427cs.SE
收藏

BT-APE: 一种用于需求分类的轻量级回溯自动提示工程方法

BT-APE: A Computationally Light Backtracking Approach to Automatic Prompt Engineering for Requirements Classification

University of Padova(帕多瓦大学);Imam Mohammad Ibn Saud Islamic University (IMSIU)(伊玛目穆罕默德·本·沙特伊斯兰大学);Lero, the Research Ireland Centre for Software, University of Limerick(利默里克大学软件研究爱尔兰中心 Lero);University of Manchester(曼彻斯特大学);University College Dublin (UCD)(都柏林大学学院);Istituto di Scienza e Tecnologie dell’Informazione “A. Faedo” (ISTI), Consiglio Nazionale delle Ricerche (CNR)(意大利国家研究委员会信息科学与技术研究所 ISTI)

Mohammad Amin Zadenoori, Waad Alhoshan, Jacek Dąbrowski, Liping Zhao, Alessio Ferrari

AI总结:

提出轻量级回溯自动提示工程方法BT-APE,通过LLM生成候选、回溯搜索和动态示例选择迭代优化提示,在需求分类任务中以更低计算成本达到与资源密集型方法相当的准确率。

摘要:

大型语言模型(LLM)越来越多地应用于需求工程(RE)任务,但指导它们的提示通常通过试错手动设计,导致结果不一致且次优。自动提示构建在RE中仍未得到充分探索,其有效性尚不清楚。为解决这一问题,我们提出了一种轻量级的自动提示工程方法——回溯自动提示工程(BT-APE),并将其应用于需求分类。我们将提示设计视为一个优化问题,通过LLM生成的候选、回溯搜索和动态示例选择迭代优化提示。在三个基准数据集上使用五个指令微调的LLM评估BT-APE,我们将其与四种经典提示基线(零样本、少样本、思维链、CoT+少样本)以及一种最先进但资源密集型的APE基线(PE2)进行比较。BT-APE和PE2实现了几乎相同的准确率,均以较大的效应量显著优于经典基线;然而,BT-APE的计算负担要轻得多,在同等准确率下消耗的输入令牌数减少约72%,挂钟时间减少66%,使其更适合资源受限的部署。我们的贡献有三方面:(i)一个轻量级的APE框架,附带开放的交互工具和可复现包;(ii)首次系统比较APE与经典提示在需求分类中的表现;(iii)关于类定义和提示演化如何影响性能的见解。

英文摘要:

Large language models (LLMs) are increasingly applied to requirements engineering (RE) tasks, yet the prompts guiding them are typically designed manually through trial and error, yielding inconsistent and suboptimal results. Automated prompt construction remains largely unexplored in RE, leaving its effectiveness unclear. To address this, we propose a lightweight Automatic Prompt Engineering approach, Backtracking APE (BT-APE), and apply it to requirements classification. We frame prompt design as an optimization problem, iteratively refining prompts via LLM-generated candidates, backtracking search, and dynamic example selection. Evaluating BT-APE on three benchmark datasets with five instruction-tuned LLMs, we compare it against four classical prompting baselines (zero-shot, few-shot, chain-of-thought, CoT+few-shot) and a state-of-the-art but resource-intensive APE baseline (PE2). BT-APE and PE2 achieve nearly identical accuracy, both substantially outperforming the classical baselines with large effect sizes; however, BT-APE imposes a far lighter computational footprint, consuming roughly 72% fewer input tokens and 66% less wall-clock time at equivalent accuracy, making it better suited to resource-constrained deployment. Our contributions are threefold: (i) a lightweight APE framework with an open interactive tool and replication package; (ii) the first systematic comparison of APE against classical prompting for requirements classification; and (iii) insights into how class definitions and prompt evolution affect performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑