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

ContraPrompt:通过双人推理轨迹分析进行对比提示优化

ContraPrompt: Contrastive Prompt Optimization via Dyadic Reasoning Trace Analysis

Vizops AI

Rishav Rishav, Pushpak Pujari, Pushpendre Rastogi

AI总结:

ContraPrompt通过分析模型在反馈下的推理轨迹差异,优化提示生成,优于现有方法,在多个基准测试中取得显著提升。

摘要:

提示优化方法通常孤立分析个体失败或跨示例比较提示变体,仅基于单次执行轨迹,无法获取区分成功与失败的推理过程。我们引入ContraPrompt,基于观察:当模型在反馈下重试成功时,其两个思维链轨迹的差异构成未被先前方法捕捉的优化信号。与以往对比方法不同,我们比较完整的中间推理过程:两个轨迹共享模型、输入和基础提示,因此剩余差异反映推理策略和附加错误反馈——我们称之为双人推理轨迹分析。多尝试解决阶段是一个受控的代理重试循环,自动生成对比数据而无需人工标注。提取的规则通过可观察的输入特征组织成输入感知的决策树路由指令。在四个推理和合规性基准测试中,ContraPrompt在所有四个基准上均优于GEPA(Agrawal等,2026),在HotPotQA上绝对提升+8.29 pp(+20.8% rel.),在GDPR-Bench上提升+2.21 pp(+18.2% rel.),在GPQA Diamond上提升+7.14 pp(+10.6% rel.),在BBH上提升+0.74 pp(+0.85% rel.)。消融实验确认双轨迹对比性是关键组件,其移除导致平均相对下降-16%。在53个EvalSet黑盒优化问题上,ContraPrompt在11个问题上胜出,在41个问题上打平,在1个问题上失利。在FiNER-139金融命名实体识别(Loukas等,2022)中,ContraPrompt在未优化基准上提升+7.77 pp(+11.6% rel.),在GEPA上提升+1.94 pp(+2.66% rel.),分支条件与标准US GAAP金融工具类别一致。

英文摘要:

Prompt optimization methods either analyze individual failures in isolation or compare prompt variants across examples, operating on single execution traces with no access to the reasoning process distinguishing success from failure on the same input. We introduce ContraPrompt, built on the observation that when a model fails but succeeds on a retry with feedback, the difference between its two chain-of-thought traces constitutes an optimization signal not captured by prior methods. Unlike prior contrastive methods, we compare complete intermediate reasoning processes: the two traces share model, input, and base prompt, so remaining differences reflect reasoning strategy and appended error feedback -- we call this dyadic reasoning trace analysis. The multi-attempt solving phase is an instrumented agentic retry loop that generates contrastive data automatically without human annotation. Extracted rules are organized into an input-aware decision tree routing instructions by observable input characteristics. On four reasoning and compliance benchmarks, ContraPrompt outperforms GEPA (Agrawal et al., 2026) on all four, with absolute gains of +8.29 pp on HotPotQA (+20.8% rel.), +2.21 pp on GDPR-Bench (+18.2% rel.), +7.14 pp on GPQA Diamond (+10.6% rel.), and +0.74 pp on BBH (+0.85% rel.). Ablations confirm dyadic trace contrastivity is the critical component, with a -16% relative average drop upon its removal. On 53 EvalSet black-box optimization problems, ContraPrompt beats GEPA on 11, ties on 41, and loses on 1 at equal budget. On FiNER-139 financial named entity recognition (Loukas et al., 2022), ContraPrompt achieves +7.77 pp over the unoptimized baseline (+11.6% rel.) and +1.94 pp over GEPA (+2.66% rel.), with branch conditions aligning with standard US GAAP financial-instrument categories.

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

↑