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.
Let LLMs Speak Embedding Languages: Generative Text Embeddings via Iterative Contrastive Refinement
Department of Computer Science and Information Engineering, National Taiwan University(国家台湾大学计算机科学与信息工程系);National Taiwan University AI Center of Research Excellence(国家台湾大学人工智能研究中心)
Unsupervised Time-Series Representation Learning with Iterative Bilinear Temporal-Spectral Fusion
National Institute of Health Data Science, Peking University(北京大学健康医疗大数据国家研究院);Institute of Medical Technology, Health Science Center of Peking University(北京大学医学部医学技术研究院)
CL-MVSNet: Unsupervised Multi-view Stereo with Dual-level Contrastive Learning
School of Electronic and Computer Engineering, Peking University(北京大学电子与计算机工程学院);Peng Cheng Laboratory(鹏城实验室);Migu Culture Technology Co., Ltd(咪咕文化科技有限公司);School of Computer Science, University of Birmingham(伯明翰大学计算机学院);School of Arts, Peking University(北京大学艺术学院)
FaIRCoP: Facial Image Retrieval using Contrastive Personalization
Indraprastha Institute of Information Technology, Delhi(德里英德拉普拉斯塔信息技术学院);Indian Institute of Technology, Roorkee(鲁尔基印度理工学院);International Institute of Information Technology, Hyderabad(海得拉巴国际信息技术学院)