RePair: Turning Retrieval Failures into Counterfactual Hard Pairs

TL;DR

RePair method improves cross-modal retrieval accuracy on Flickr30K and COCO30K by repairing retrieval errors.

cs.IR 🔴 Advanced 2026-08-30 4 views
Siyi Liu Xiaorong Zhu Enjun Du Xinyu Zuo Lisheng Duan Haijin Liang Jin Ma Junfu Pu Yongqi Zhang
cross-modal retrieval contrastive learning data augmentation error repair machine learning

Key Findings

Methodology

RePair identifies retrieval errors and performs counterfactual editing to generate hard positive and negative pairs. It follows three principles: Validity, Minimality, and Locality, using LLM-guided counterfactual editing and local contrastive objectives.

Key Results

  • On Flickr30K and COCO30K, RePair achieves R@1 of 90.13% and 62.64% with 107K synthetic samples, outperforming baselines.
  • Experiments show RePair improves retrieval performance while reducing synthetic sample volume by 26% to 75%.
  • Ablation studies confirm that failure conditioning, quality control, and paired pull-push supervision drive performance gains.

Significance

RePair method enhances cross-modal retrieval precision and data efficiency by converting retrieval errors into counterfactual hard pairs, offering a novel approach to handling model errors with significant academic and practical value.

Technical Contribution

RePair introduces failure-conditioned repair, generating hard positive and negative pairs through counterfactual editing, providing a new contrastive learning framework that significantly improves data efficiency.

Novelty

RePair is the first to convert retrieval errors into counterfactual hard pairs by minimal editing, differing from traditional error-agnostic data augmentation methods.

Limitations

  • RePair may be limited by the capability of generative models in handling complex image edits, leading to imprecise corrections.
  • The method relies on high-quality annotated data, and annotation noise may affect results.

Future Work

Future research could explore more efficient editing models to improve precision in complex scenarios and extend to more modalities in retrieval tasks.

AI Executive Summary

Cross-modal retrieval is crucial for connecting vision and language, but existing methods often fail to handle subtle semantic differences. The RePair method identifies and repairs retrieval errors, generating hard positive and negative pairs to significantly improve retrieval accuracy.

The method uses counterfactual editing to convert erroneous samples into hard pairs, following principles of Validity, Minimality, and Locality. Experimental results show RePair achieves excellent performance on Flickr30K and COCO30K, with significant data efficiency improvements.

RePair offers a new approach to cross-modal retrieval by enhancing model precision and robustness through failure-conditioned repair, with broad application potential. Future research could further optimize editing models to improve performance in complex scenarios.

Deep Analysis

Background

Cross-modal retrieval has made significant advances, particularly with CLIP-style dual encoders excelling in visual and language matching. However, existing methods struggle with subtle semantic differences, failing to distinguish similar but incorrect candidates.

Core Problem

Current hard-sample mining methods can only select confusable candidates without constructing correct counterparts. Synthetic augmentation methods, while generating new samples, often do not consider actual model errors, leading to unfocused targets.

Innovation

RePair uses counterfactual editing to convert erroneous samples into hard positive and negative pairs, following principles of Validity, Minimality, and Locality. It employs LLM-guided counterfactual editing and local contrastive objectives to significantly improve retrieval performance.

Methodology

  • �� Identify retrieval errors: Recognize erroneous samples from model retrieval results.
  • �� Counterfactual editing: Perform minimal editing on erroneous samples to generate hard pairs.
  • �� Local contrastive training: Train under local contrastive objectives to enhance model accuracy.

Experiments

Experiments were conducted on Flickr30K and COCO30K datasets using CLIP ViT-B/32 as the baseline model. Baselines include NegCLIP, SugarCrepe, etc., with evaluation metrics R@1, R@5, and MRR. Ablation studies validated the effectiveness of each component.

Results

RePair achieves the highest R@1 on Flickr30K and COCO30K, with 90.13% and 62.64% respectively, significantly outperforming baselines. Ablation studies show failure-conditioned repair and paired pull-push supervision are key to performance gains.

Applications

RePair can enhance cross-modal retrieval systems' accuracy, especially in scenarios requiring subtle semantic differentiation, such as image search and video analysis.

Limitations & Outlook

RePair may be limited by generative model capabilities in handling complex image edits. Additionally, it relies on high-quality annotated data, with annotation noise potentially affecting results. Future research could explore more efficient editing models to improve precision in complex scenarios.

Plain Language Accessible to non-experts

Imagine you're in a library looking for a book, and there are many similar-looking books on the shelves. The RePair method acts like a smart assistant, helping you find the book closest to what you want. It first identifies books that look similar but aren't quite right, then makes small adjustments to turn these books into exactly what you need. This way, you can find the right book faster without searching the entire library.

ELI14 Explained like you're 14

Hey there! Imagine you're playing a spot-the-difference game. RePair is like a super helper that finds pictures that look almost the same but have tiny differences. Then, it uses magic to change those pictures into what you want! This way, you can win the game faster. Isn't that cool?

Glossary

Counterfactual Editing

The process of minimally editing erroneous samples to turn them into correct ones.

Used to generate hard positive and negative pairs to improve model accuracy.

Hard-Sample Mining

Selecting confusable samples to enhance model training.

Used to identify error regions in the model.

Local Contrastive Objective

A goal for contrastive learning within a local area.

Used to improve model precision and robustness.

Validity Principle

Ensures selected samples are genuine model errors rather than annotation noise.

Used to filter seed samples for counterfactual editing.

Minimality Principle

Editing only changes the error-causing part while preserving the shared semantic structure.

Used to generate hard positive and negative pairs.

Open Questions Unanswered questions from this research

  • 1 How to improve counterfactual editing precision in complex scenarios?
  • 2 How to reduce the impact of annotation noise on the RePair method?

Applications

Immediate Applications

Image Search Optimization

RePair can be used to improve the accuracy of image search engines, helping users find desired images faster.

Long-term Vision

Multimodal AI Systems

RePair has the potential to be applied in multimodal AI systems, enhancing performance in complex scenarios.

Abstract

Vision-language retrieval with CLIP-style dual encoders achieves strong cross-modal performance, yet practical accuracy often hinges on localized semantic distinctions where top-ranked near misses differ from the true match by a single critical detail. Hard-sample mining can select confusable candidates but cannot construct corrected counterparts; synthetic augmentation can generate novel samples but, without conditioning on actual model failures, targets irrelevant dimensions of hardness. We observe that a top-ranked false positive is a counterfactual scaffold---sharing most of the query's semantics while differing in a localized failure-causing residual. Minimally correcting this residual yields a hard positive of the ground truth in the same modality; the corrected and unedited versions form a hard negative pair that straddles the decision boundary, producing complementary pull--push supervision. We introduce RePair, guided by three principles---Validity, Minimality, and Locality---which mines false positives bidirectionally, applies LLM-guided counterfactual editing, and trains with a local hard-pair contrastive objective. On Flickr30K and COCO30K, RePair outperforms controlled augmentation baselines with only 107K synthetic samples---26\%--75\% fewer than comparable methods---confirming failure-conditioned repair is more data-efficient than error-agnostic augmentation.

cs.IR cs.CV