arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.05247cs.AIcs.SE
收藏

程序合成的在线提示选择

Online Prompt Selection for Program Synthesis

University of Edinburgh(爱丁堡大学);University of California, Berkeley(加州大学伯克利分校)

Yixuan Li, Lewis Frampton, Federico Mora, Elizabeth Polgreen

AI总结:

本文将程序合成中的求解器与提示选择构建为在线学习问题,使用多臂老虎机算法动态选择符号求解器或LLM与提示组合,其实现的CYANEA系统比最佳单一求解器多解决37.2%的查询,性能接近虚拟最佳求解器。

摘要:

大型语言模型(LLMs)在程序合成领域展现出令人印象深刻的能力。然而,这种性能水平并非在所有任务、所有LLMs和所有提示风格中普遍适用。存在许多情况:某个LLM占主导地位,某种提示风格占主导地位,或者调用符号求解器比使用LLM是更好的选择。用户面临的一个关键挑战不仅是识别何时LLM是正确的求解器选择、针对给定合成任务调用哪个合适的LLM,还包括如何正确调用它。做出错误选择的非专家用户,在结果(解决的任务数量及解决时间)和财务成本(如果通过商业API使用闭源语言模型)方面都会产生代价。我们将此选择构建为一个在线学习问题。我们使用多臂老虎机算法来选择部署哪个符号求解器,或LLM与提示的组合,以最大化给定的奖励函数(该函数可能优先考虑求解时间、解决的合成任务数量或求解的财务成本)。我们实现了该方法的一个实例,称为CYANEA,并在来自文献的排序函数合成查询、语法引导合成竞赛的查询,以及从SMT问题生成的全新未见查询上对其进行了评估。CYANEA比最佳单一求解器多解决了37.2%的查询,并取得了与虚拟最佳求解器相差不到4%的结果。

英文摘要:

Large Language Models (LLMs) demonstrate impressive capabilities in the domain of program synthesis. This level of performance is not, however, universal across all tasks, all LLMs and all prompting styles. There are many areas where one LLM dominates, one prompting style dominates, or where calling a symbolic solver is a better choice than an LLM. A key challenge for the user then, is to identify not only when an LLM is the right choice of solver, and the appropriate LLM to call for a given synthesis task, but also the right way to call it. A non-expert user who makes the wrong choice, incurs a cost both in terms of results (number of tasks solved, and the time it takes to solve them) and financial cost, if using a closed-source language model via a commercial API. We frame this choice as an online learning problem. We use a multi-armed bandit algorithm to select which symbolic solver, or LLM and prompt combination to deploy in order to maximize a given reward function (which may prioritize solving time, number of synthesis tasks solved, or financial cost of solving). We implement an instance of this approach, called CYANEA, and evaluate it on synthesis queries from the literature in ranking function synthesis, from the syntax-guided synthesis competition, and fresh, unseen queries generated from SMT problems. CYANEA solves 37.2% more queries than the best single solver and achieves results within 4% of the virtual best solver.

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

↑