Noisy Pair Corrector for Dense Retrieval

Hang Zhang, Yeyun Gong, Xingwei He, Dayiheng Liu, Daya Guo, Jiancheng Lv, Jian Guo

Introduction

Dense Retrieval (DR) has become a cornerstone of modern information retrieval, enabling systems to match queries and documents in a shared semantic vector space. Traditional training paradigms, such as Dense Passage Retrieval (DPR), assume that the training set consists of perfectly matched query-document pairs. However, in practice, large-scale datasets are often constructed using automated methods—such as mining user click logs or scraping community forums like StackOverflow—which introduces significant "mismatched-pair noise."

When a model is forced to train on these noisy pairs, it learns to associate unrelated content, leading to poor generalization and degraded retrieval performance. This paper introduces the Noisy Pair Corrector (NPC), a robust, plug-and-play framework designed to identify and rectify these noisy training samples, ensuring high-quality representation learning even in suboptimal data environments.

The Problem: Mismatched-Pair Noise

In DR training, the objective is typically to minimize the distance between a query and its corresponding "positive" document while maximizing the distance from "negative" documents. Mismatched-pair noise occurs when the labeled positive document is actually irrelevant to the query. Forcing the model to treat these as ground truth creates two primary issues:

  1. Incorrect Association: The model learns to pull the query toward an irrelevant document.
  2. False Negatives: The model may inadvertently push the query away from truly relevant documents that appear as negatives in the training batch.

The NPC Framework

The Noisy Pair Corrector addresses these issues through a two-stage process: Noise Detection and Noise Correction.

1. Noise Detection via Perplexity

The authors leverage the "memorization effect" observed in deep learning: models tend to learn simple, clean patterns before they begin to overfit on complex noise. NPC utilizes Perplexity (PPL) as a metric to distinguish between clean and noisy pairs.

  • Warm-up: The model undergoes a brief initial training phase to capture basic semantic patterns.
  • Distribution Modeling: After warm-up, the PPL is calculated for every pair in the dataset. Clean pairs typically exhibit lower PPL than noisy ones because the model finds them easier to explain.
  • GMM Filtering: A two-component Gaussian Mixture Model (GMM) is fitted to the PPL distribution. This provides an unsupervised, automated threshold to categorize pairs into "clean" and "noisy" clusters.

2. Noise Correction via Self-Ensemble

Rather than simply discarding noisy pairs—which could lead to a significant loss of training data—NPC "rectifies" them using a Self-Ensemble Teacher.

  • EMA Teacher: The system maintains an Exponential Moving Average (EMA) version of the model being trained. This teacher model provides more stable and reliable representations than the current iteration.
  • Consistency Loss: For pairs flagged as noisy, the model ignores the potentially incorrect "hard" label. Instead, it is trained to match the "soft" probability distribution generated by the EMA teacher. This approach allows the model to extract useful features from the data without being forced to believe a false association.

Experimental Evaluation

The researchers evaluated NPC across both synthetic and real-world noise scenarios, demonstrating its versatility.

Synthetic Noise (NQ and TriviaQA)

To test the limits of the framework, the authors corrupted high-quality datasets (Natural Questions and TriviaQA) by randomly shuffling 20% and 50% of the pairs to simulate extreme noise.

  • Results: On the NQ dataset with 50% noise, a standard DPR model's performance (Recall@1) plummeted to 23.87. In contrast, NPC maintained a Recall@1 of 48.81, nearly matching the performance of a model trained on a perfectly clean dataset (48.87).

Real-World Noise (StaQC and SO-DS)

The framework was also tested on code retrieval datasets mined from StackOverflow, which naturally contain high levels of noise due to the nature of forum discussions.

  • Results: NPC outperformed the strong UniXcoder baseline by over 3% in Mean Reciprocal Rank (MRR) on the StaQC dataset. Furthermore, NPC proved to be architecture-agnostic, providing performance boosts when integrated with other advanced retrievers like coCondenser and RocketQAv2.

Key Insights

  • PPL and Negatives: A notable finding was that calculating PPL against random negatives is more effective for noise detection than using hard negatives. Hard negatives are intentionally difficult, which can confuse the GMM's ability to isolate mismatched positives.
  • Information Preservation: The "Rectify, Don't Delete" philosophy is central to NPC's success. By using soft labels, the model retains the ability to learn from the query and document content while remaining skeptical of their paired relationship.

Conclusion

The Noisy Pair Corrector (NPC) provides a scalable and effective solution for training dense retrievers on imperfect data. By combining PPL-based noise detection with an EMA-based self-ensemble for correction, NPC bridges the gap between noisy, real-world data and high-performance retrieval. Its plug-and-play nature makes it a valuable addition to any DR training pipeline, particularly in domains where manual data cleaning is economically or logistically infeasible.

Summary updated

BibTeX
@inproceedings{zhang2023noisy,
  author = {Hang Zhang and Yeyun Gong and Xingwei He and Dayiheng Liu and Daya Guo and Jiancheng Lv and Jian Guo},
  title = {{Noisy Pair Corrector for Dense Retrieval}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.765},
}
Figure