Contrastive Reflection for Iterative Prompt Optimization
On the map: LLM agents and tool use → Web, search, and research agents
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Web, search, and research agents, one of 16 directions in LLM agents and tool use. Builds on 8 of its 18 references that are in the map. First posted on arXiv 29 Jun 2026.
Builds on
8 of 18 references.
References · 8
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
- 2020Beyond Accuracy: Behavioral Testing of NLP models with CheckListcited by 979
- 2023PromptAgent: Strategic Planning with Language Models Enables Expert-level Prompt Optimizationcited by 226
- 2022Domino: Discovering Systematic Errors with Cross-Modal Embeddingscited by 155
- 2023Large language models can accurately predict searcher preferencescited by 129
- 2024StraGo: Harnessing Strategic Guidance for Prompt Optimizationcited by 16
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Better by Comparison: Retrieval-Augmented Contrastive Reasoning for Automatic Prompt Optimization
- 2026Coding Agents are Strong Prompt Optimizers
- 2026GRADRAG: Cross-Component Prompt Adaptation for Coordinated Multi-Agent RAG
- 2024AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning
- 2026Evaluate-as-Action: Self-Evaluated Process Rewards for Retrieval-Augmented Agents
- 2026SLMs as Multi-Agent Routers: A Progressive SFT and Reinforcement Learning Approach
- 2026Quantifying the Accuracy and Cost Impact of Design Decisions in Budget-Constrained Agentic LLM Search
- 2026Agentic-R: Learning to Retrieve for Agentic Search