Getting More Juice Out of Your Data: Hard Pair Refinement Enhances Visual-Language Models Without Extra Data

Haonan Wang, Minbin Huang, Runhui Huang, Lanqing Hong, Hang Xu, Tianyang Hu, Xiaodan Liang, Zhenguo Li, Hong Cheng, Kenji Kawaguchi

Abstract

Contrastive Language-Image Pre-training (CLIP) has revolutionized multimodal learning but remains limited by the inherent noise and loose associations in large-scale web-crawled datasets. This paper introduces HELIP (Hard Pair Refinement), a framework designed to "squeeze" additional performance from pre-trained models using only their original training data. HELIP identifies "hard pairs"—semantically similar image-text entities—and applies a specialized margin loss to sharpen the model's discriminative capabilities. Experimental results demonstrate that HELIP provides a significant "booster shot" to existing models, improving ImageNet zero-shot accuracy by up to 10.1% with just a few additional training epochs.

Introduction

The success of models like CLIP relies on massive datasets, yet these datasets are often noisy. Standard contrastive learning treats all negative samples in a batch equally, failing to prioritize the "hard negatives" that are most informative for learning fine-grained features. Existing methods to address this often require retraining from scratch or are limited to small batch-level searches. HELIP addresses these inefficiencies by mining difficult examples from the entire dataset and refining the model's joint embedding space through a short, targeted continuous training phase.

Methodology

HELIP consists of two core innovations: Hard Pair Mining (HPM) and Hard Negative Margin Loss (HNML).

Hard Pair Mining (HPM)

HPM shifts the focus from sample-level similarity (image-to-image) to pair-level similarity (image-text pair to image-text pair). By treating each pair as a single entity in a joint space, the model identifies neighbors that are semantically confusing. To scale this to millions of samples, the authors developed FastHPM, which utilizes a candidate pool to maintain linear complexity ($O(N)$) while searching for difficult neighbors.

Hard Pair Mining (HPM) workflow.

Hard Negative Margin Loss (HNML)

Once hard pairs are identified, the HNML component introduces a margin-based objective during refinement. This loss forces the model to maintain a minimum distance (margin) between a positive match and its mined hard negatives. This process effectively cleans the embedding space by mitigating the impact of dataset noise—loner pairs with no support are identified as potential noise and removed.

Geometric interpretation of margin loss in the joint embedding space.

Experimental Results

The framework was evaluated across diverse datasets including CC3M, YFCC15M, and LAION subsets. The performance gains were remarkably consistent across different backbones (ResNet-50, ViT-B/16, ViT-B/32):

  • Zero-Shot Classification: On ImageNet, HELIP-refined models showed massive improvements, such as a 10.1% boost for YFCC15M-trained models. On the Open29M dataset, it boosted a well-trained CLIP model from 42.3% to 46.3% in just one extra epoch.
  • Fine-Grained Mastery: On specialized datasets like Oxford Flowers or aircraft, zero-shot performance increased by an average of 8.4% for CLIP and 18.6% for SLIP.
  • Linear Probing: HELIP-refined features outperformed standard CLIP features by an average of 9.5%, indicating more robust underlying representations.

Conclusion

HELIP offers a highly efficient path to improving visual-language models without the need for new data or expensive full retraining. By focusing on the most challenging relationships within existing datasets, it provides a robust mechanism for noise mitigation and feature refinement. Future work may explore combining HELIP with parameter-efficient tuning methods like LoRA to further reduce the cost of refinement.

Summary updated

BibTeX
@inproceedings{wang2025getting,
  author = {Haonan Wang and Minbin Huang and Runhui Huang and Lanqing Hong and Hang Xu and Tianyang Hu and Xiaodan Liang and Zhenguo Li and Hong Cheng and Kenji Kawaguchi},
  title = {{Getting More Juice Out of Your Data: Hard Pair Refinement Enhances Visual-Language Models Without Extra Data}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-long.399},
}
Figure