Skip to content

Contrastive Reflection for Iterative Prompt Optimization

Jun 2026 · arXiv.org · Vol abs/2606.30840 · 1 citation · 18 references
Computer Science

Abstract

LLM agents are becoming central to information retrieval: they issue retrieval queries, synthesize answers, and increasingly serve as judges for IR evaluation. Improving the prompts that control these agents is an optimization problem, but in applied IR settings it often looks less like blind search and more like debugging. Engineers need to know which behavior failed, which nearby behavior still worked, what distinguishes the two, and whether a prompt edit improves held-out quality without introducing regressions. We present Contrastive Reflection, an iterative prompt-optimization framework for agentic IR workflows. The framework starts from a task-centric quality definition: QA agents expose retrieval or reasoning traces, and grading agents expose dimension-level scores and rationales. These structured traces are used to identify error-anchored behavioral slices, add nearby successful examples from the same region, and ask a Teacher LLM to propose a targeted prompt edit. Candidate edits are accepted only when validation performance improves, optionally subject to regression checks. We instantiate the framework with a tree-based slice selector, but the contribution is the contrastive reflection loop rather than the tree itself. On a public HotpotQA retrieval-augmented QA setup, one tree-selected contrastive repair improves held-out exact-match accuracy from 51.4% to 60.4%. Failure-only and random-evidence variants improve less and break more previously correct examples. A light instruction-only comparison places the method near modern prompt optimizers: MIPROv2 reaches 59.4% and GEPA 57.0%. The result is an interpretable optimization loop for IR agents, aimed at making prompt repair more inspectable and validation-driven.

View source

Similar papers

Preprint Aug 2026

RLMOpt: Adaptive Prompt Optimization via Recursive Language Models

RLMOpt is introduced, a prompt optimizer that makes the search policy itself language-model-driven through a recursive language model (RLM), which operates over a tool-based environment, inspecting task information, analyzing failures, generating candidates, allocating evaluation budget, and deciding when to stop.

Subhash Bangalore Satheesha, Nirvik Pande, Deepthi Duddempudi et al. · 0 citations
Conference Jul 2026

A Collaborative Version-Controlled Framework for Evolutionary Optimization of AI Prompts

Prompt engineering is now a significant aspect of large language models (LLMs) to make them as effective in applications like conversational agents, educational assistants, automated code-generating systems, and content generation systems. Nonetheless, urgent design is frequently done in informal and solitary fashion devoid of systematic processes of collective enhancement, quality evaluation, or evolutionary monitoring. This paper suggests NeuroPrompt, an open-source prompt engineering system, which combines version tracking with evolution, directed acyclic graph (DAG) based lineage modeling, and community-based quality assessment. Users can create prompts, fork better prompts, and assess the performance of prompts with a multi-rater consensus system to assess the prompts based on clarity, creativity, and usefulness. The forking is directed by a utility-based decision model that ensures that unnecessary prompt duplication is avoided, and the effectiveness of optimization is enhanced. Experimental analysis reveals that collaborative prompt evolution is more effective in prompt quality and the overall accuracy of prompt generation in providing relevant and useful responses to tasks is 96.3% in comparison against baseline prompt design methods which has a score of about 88-91. There are also the results of the improved consensus reliability and lesser variance of ratings among the community evaluators. The suggested system will change timely engineering into a transparent and organized evolutionary process allowing sharing of knowledge systematically and optimizing prompt through collaborative optimization to large-scale AI initiatives.

D. Ragunath, Vaishak C J · 0 citations
Preprint Aug 2026

MemeMind: Reference-Guided Trace Construction for Offline Context Optimization

This work introduces MemeMind, which uses an offline reference answer to recover missing experience in Anime, Comic, and Game meme interpretation and shows that constructing successful tool use for failed groups provides the largest component gain and produces more effective evidence acquisition at inference time.

Run Yang, Weihang Wang, Boheng Sheng et al. · 1 citation
Preprint Aug 2026

CAPO: Constraint-Aware Prompt Optimization for LLM Agents

This work introduces CAPO (Constraint-Aware Prompt Optimization), a primal-dual method that combines pool-based rewrites with adaptive constraint weighting to optimize system prompts under explicit operational constraints.

Victor Ye Dong, Reid Pryzant, Yi Liu et al. · 0 citations
Preprint Jul 2026

PromptPack: Scaling LLM Annotation Agents for Online Recommendation

This work introduces PromptPack, a scalable, high-throughput LLM annotation agent that cuts LLM costs by 89% and accelerates throughput by 2.5x while fully preserving AUC.

Sebastian Koralewski, Merwan Barlier, Yulia Stolin et al. · 0 citations