ContraPrompt: Contrastive Prompt Optimization via Dyadic Reasoning Trace Analysis
- URL: http://arxiv.org/abs/2604.17937v1
- Date: Mon, 20 Apr 2026 08:17:15 GMT
- Title: ContraPrompt: Contrastive Prompt Optimization via Dyadic Reasoning Trace Analysis
- Abstract summary: We introduce ContraPrompt, built on the observation that when a model fails but succeeds on a retry with feedback, the difference constitutes an optimization signal.<n>Unlike prior contrastive methods, we compare complete intermediate reasoning processes.<n>ContraPrompt beats GEPA on 11, ties on 41, and loses on 1 at equal budget.
- Score: 0.6372261626436676
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: 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.
Related papers
- ESPO: Error-Structured Prompt Optimization via Diagnose, Diversify, and Stabilize [21.715943293929296]
ESPO decomposes prompt optimization into three phases: Diagnose clusters all training errors in one round; Propose generates candidates via four complementary strategies with independent biases; Select applies bootstrap stability.<n>On seven public NLP benchmarks, ESPO improves average accuracy by $+$3.76 pp over the state-of-the-art (74.67% vs 70.91% for GEPA)
arXiv Detail & Related papers (2026-09-03T17:59:37Z) - Recursive Agentic Reasoning [4.7490116928645065]
Test-time reasoning methods such as iterative refinement, decomposition, and repeated sampling are often evaluated in isolation.<n>We introduce a unified view of these methods as recursion operators over an agent's reasoning trace.<n>We evaluate all three operators against a single-pass chain-of-thought baseline under a shared harness with identical prompts, token budgets, and grading code.
arXiv Detail & Related papers (2026-08-25T01:34:08Z) - MAGE: Understanding Stability-Performance Trade-offs in Multi-component Prompt Optimization [3.7323766833175718]
MAGE (Memory-Augmented Goal Prompt Evolution) is a controlled analysis framework for studying component interaction in prompt optimization.<n>Our experiments uncover a previously unreported phenomenon, the Prompt Optimization Coupling Effect (POCE), when multiple optimization signals operate within a closed reflective loop.
arXiv Detail & Related papers (2026-07-11T10:05:58Z) - ESPO: Early-Stopping Proximal Policy Optimization [78.79610718910628]
ESPO (Early-Stopping Proximal Policy Optimization) detects trajectory failure on-the-fly and terminates rollouts early.<n>On DeepSeek-R1-Distill-Qwen-7B trained for mathematical reasoning, ESPO surpasses PPO on AIME2024 (46.28% vs. 45.25%), AMC2023 (85.83% vs. 82.94%), and MATH-500 (87.42% vs. 85.43%)
arXiv Detail & Related papers (2026-05-28T12:40:22Z) - Relational Preference Encoding in Looped Transformer Internal States [0.0]
We investigate how looped transformers encode human preference in their internal iteration states.<n>Using Ouro-2.6B-Thinking, a 2.6B- parameter looped transformer with iterative refinement, we extract hidden states from each loop iteration.<n>We train lightweight evaluator heads to predict human preference on the Anthropic HH-RLHF dataset.<n>Our pairwise evaluator achieves 95.2% test accuracy on 8,552 unseen examples, surpassing a full-batch L-BFGS probe (84.5%) while the base model remains completely frozen.
arXiv Detail & Related papers (2026-04-10T20:00:49Z) - APEX-EM: Non-Parametric Online Learning for Autonomous Agents via Structured Procedural-Episodic Experience Replay [7.370176470430802]
LLM-based autonomous agents lack persistent procedural memory.<n>We present APEX-EM, a non-parametric online learning framework that accumulates, retrieves, and reuses structured procedural plans.
arXiv Detail & Related papers (2026-03-31T00:24:56Z) - CoT2-Meta: Budgeted Metacognitive Control for Test-Time Reasoning [17.364321308755667]
CoT2-Meta is a training-free metacognitive reasoning framework.<n>It combines object-level chain-of-thought generation with meta-level control over partial reasoning trajectories.<n>It consistently outperforms strong single-path, sampling-based, and search-based baselines.
arXiv Detail & Related papers (2026-03-30T07:59:47Z) - Reflection in the Dark: Exposing and Escaping the Black Box in Reflective Prompt Optimization [1.8420836938108678]
We propose VISTA, a multi-agent APO framework that decouples hypothesis generation from prompt rewriting.<n>A two-layer explore-exploit mechanism combines random restart and epsilon-greedy sampling further escapes local optima.
arXiv Detail & Related papers (2026-03-19T01:14:36Z) - Solver-in-the-Loop: MDP-Based Benchmarks for Self-Correction and Behavioral Rationality in Operations Research [19.31559944205485]
Operations Research practitioners routinely debug infeasible models through an iterative process.<n>We introduce two benchmarks that place the textbfsolver in the evaluation loop<n>We find that domain-specific RLVR training enables an 8B model to surpass frontier APIs.
arXiv Detail & Related papers (2026-01-28T20:02:44Z) - From Noisy Traces to Stable Gradients: Bias-Variance Optimized Preference Optimization for Aligning Large Reasoning Models [90.45197506653341]
Large reasoning models generate intermediate reasoning traces before producing final answers.<n> aligning LRMs with human preferences, a crucial prerequisite for model deployment, remains underexplored.<n>A common workaround optimized a single sampled trajectory, which introduces substantial gradient variance from trace sampling.
arXiv Detail & Related papers (2025-10-06T17:58:01Z) - From Harm to Help: Turning Reasoning In-Context Demos into Assets for Reasoning LMs [58.02809208460186]
We revisit this paradox using high-quality traces from DeepSeek-R1 as demonstrations.<n>We find that adding more exemplars consistently degrades accuracy, even when demonstrations are optimal.<n>We introduce Insight-to-solve (I2S), a sequential test-time procedure that turns demonstrations into explicit, reusable insights.
arXiv Detail & Related papers (2025-09-27T08:59:31Z) - Eigen-1: Adaptive Multi-Agent Refinement with Monitor-Based RAG for Scientific Reasoning [53.45095336430027]
We develop a unified framework that combines implicit retrieval and structured collaboration.<n>On Humanity's Last Exam (HLE) Bio/Chem Gold, our framework achieves 48.3% accuracy.<n>Results on SuperGPQA and TRQA confirm robustness across domains.
arXiv Detail & Related papers (2025-09-25T14:05:55Z) - Reverse Preference Optimization for Complex Instruction Following [61.39734201711077]
We propose a simple yet effective method called Reverse Preference Optimization (RPO)<n>It mitigates noise in preference pairs by dynamically reversing the constraints within the instruction to ensure the chosen response is perfect.<n>RPO scales effectively across model sizes, with the 70B RPO model surpassing GPT-4o.
arXiv Detail & Related papers (2025-05-28T09:44:27Z) - Preference Optimization for Reasoning with Pseudo Feedback [100.62603571434167]
We introduce a novel approach to generate pseudo feedback for reasoning tasks by framing the labeling of solutions as an evaluation against associated test cases.<n>We conduct experiments on both mathematical reasoning and coding tasks using pseudo feedback for preference optimization, and observe improvements across both tasks.
arXiv Detail & Related papers (2024-11-25T12:44:02Z) - Self-Play Preference Optimization for Language Model Alignment [75.83359213697854]
Recent advancements suggest that directly working with preference probabilities can yield a more accurate reflection of human preferences.
We propose a self-play-based method for language model alignment, which treats the problem as a constant-sum two-player game.
Our approach, dubbed Self-Play Preference Optimization (SPPO), utilizes iterative policy updates to provably approximate the Nash equilibrium.
arXiv Detail & Related papers (2024-05-01T17:59:20Z) - Iterative Reasoning Preference Optimization [84.15992372132507]
We develop an iterative approach to optimize the preference between generated Chain-of-Thought (CoT) candidates.
We show reasoning improves across repeated iterations of this scheme.
For example, we see a large improvement from 55.6% to 81.6% on GSM8K and an accuracy of 88.7% with majority voting out of 32 samples.
arXiv Detail & Related papers (2024-04-30T17:28:05Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.