UDAPDR: Unsupervised Domain Adaptation via LLM Prompting and Distillation of Rerankers

Jon Saad-Falcon, Omar Khattab, Keshav Santhanam, Radu Florian, Martin Franz, Salim Roukos, Avirup Sil, Md Arafat Sultan, Christopher Potts

TL;DR

UDAPDR (Unsupervised Domain Adaptation via LLM Prompting and Distillation of Rerankers) is a novel framework that adapts neural information retrieval models to new domains without requiring any manual labels. By using a clever "expensive-to-cheap" LLM prompting strategy to generate synthetic training data and distilling an ensemble of rerankers into a single retriever, it achieves state-of-the-art zero-shot accuracy while maintaining the lightning-fast latency required for production systems.

What Problem Does This Paper Address?

Neural Information Retrieval (IR) models, like ColBERT, have revolutionized how we search through text. However, they suffer from a major "brittleness" problem: a model trained on general web search (like MS MARCO) often performs poorly when moved to a specialized "long-tail" domain, such as COVID-19 scientific papers or niche technical forums. This is known as domain shift.

The standard solution is fine-tuning on domain-specific data, but collecting manual labels (query-passage pairs) is slow and expensive. Recent attempts to use Large Language Models (LLMs) to generate synthetic labels have two main drawbacks:

  1. Cost: Generating millions of high-quality queries using top-tier models like GPT-4 is prohibitively expensive.
  2. Efficiency: Rerankers (cross-encoders) are highly accurate and robust to domain shifts, but they are far too slow for real-time applications, often taking seconds to process a single query compared to the milliseconds required by retrievers (dual-encoders).

Methods

UDAPDR introduces a multi-stage pipeline designed to maximize accuracy while minimizing both LLM API costs and inference latency.

Figure 1: Overview of UDAPDR. An expensive LLM like GPT-3 is used to create an initial set of synthetic queries. These are incorporated into a set of prompts for a less expensive LLM that can generate large numbers of synthetic queries cheaply. The queries stemming from each prompt are used to train separate rerankers, and these are distilled into a single ColBERTv2 retriever for use in the target domain.
  1. Stage 1: High-Quality Seeding. The process begins by using an expensive, high-performing LLM (GPT-3 text-davinci-002) to generate a small set of high-quality synthetic queries for a handful of target domain passages.
  2. Stage 2 & 3: Cheap Scaling. These initial queries are used to build "corpus-adapted prompts." These prompts are then fed to a much cheaper, open-source LLM (Flan-T5 XXL) to generate a massive dataset of synthetic queries (10k to 100k+) at a fraction of the cost.
  3. Stage 4: Multi-Teacher Reranking. Instead of training one model, the authors train a family of DeBERTa-v3-Large rerankers. Each reranker is trained on a different subset of synthetic data generated from different prompts. This ensemble approach mitigates the risk of a single "bad" prompt producing low-quality training data.
  4. Stage 5: Distillation. This is the "secret sauce." The knowledge from the slow but accurate ensemble of rerankers is distilled into a single ColBERTv2 retriever.
  5. Stage 6: Deployment. The final result is a domain-adapted ColBERTv2 model that retains the speed of a retriever but gains the accuracy of a reranker ensemble.

Datasets

The authors evaluated UDAPDR across several challenging benchmarks:

  • LoTTE (Long-Tail Topic Estimation): A dataset specifically designed to test out-of-domain generalization across niche topics like Lifestyle, Technology, Writing, Recreation, and Science.
  • BEIR: A standard heterogeneous benchmark for zero-shot evaluation of IR models.
  • Natural Questions (NQ) & SQuAD: Traditional general-knowledge question-answering datasets used to verify that the method doesn't hurt performance on broader domains.

Key Insights and Ideas

  • Hierarchical Prompting: You don't need the most expensive model for the whole job. Using GPT-3 as a "teacher" to create prompts for Flan-T5 allows for high-quality data generation at scale without breaking the bank.
  • Ensembles Beat Single Teachers: The paper finds that distilling from multiple rerankers (trained on different synthetic query sets) is more robust than distilling from just one. This "multi-teacher" strategy helps the student model ignore noise in the synthetic data.
  • Distillation as a Latency Bridge: The most significant insight is that we can "bake" the sophisticated reasoning of a cross-encoder into the efficient architecture of a late-interaction retriever (ColBERTv2). This provides the best of both worlds: reranker-level accuracy at retriever-level speed.

Key Results

UDAPDR demonstrates impressive gains in both accuracy and efficiency:

  • Accuracy Boost: On the LoTTE Pooled benchmark, UDAPDR improved the Success@5 score from 63.7 (Zero-shot ColBERTv2) to 72.2. It even outperformed a standard setup that uses a retriever followed by a slow reranker (which scored 71.1).
  • Latency Savings: As shown in the table below, UDAPDR maintains a query latency of 35ms, whereas adding a reranker to the pipeline increases latency to anywhere from 412ms to over 20 seconds depending on the number of passages reranked.
Latency and Success@5 comparison
  • Prompt Strategy Matters: The "corpus-adapted" approach (using domain-specific examples in the prompt) significantly outperformed generic few-shot prompting (InPars), leading to a 3.5-point increase in Success@5.

Limitations and Future Work

  • Passage Requirements: While the method is unsupervised regarding labels, it still requires a "significant number" of unlabeled passages from the target domain to generate queries. Its effectiveness on extremely small document collections remains to be seen.
  • Data Contamination: The authors acknowledge that some evaluation datasets (like NQ or SQuAD) might have been part of the LLMs' (GPT-3 or Flan-T5) original training data, which could slightly inflate results.
  • Language Scope: The current study is limited to English. Extending this to low-resource languages is a primary direction for future research.
  • Model Agnosticism: While tested on ColBERTv2, the authors suggest that this distillation framework could potentially be applied to other retriever architectures like SPLADE or standard dense retrievers.

Summary updated

Abstract

Many information retrieval tasks require large labeled datasets for fine-tuning. However, such datasets are often unavailable, and their utility for real-world applications can diminish quickly due to domain shifts. To address this challenge, we develop and motivate a method for using large language models (LLMs) to generate large numbers of synthetic queries cheaply. The method begins by generating a small number of synthetic queries using an expensive LLM. After that, a much less expensive one is used to create large numbers of synthetic queries, which are used to fine-tune a family of reranker models. These rerankers are then distilled into a single efficient retriever for use in the target domain. We show that this technique boosts zero-shot accuracy in long-tail domains and achieves substantially lower latency than standard reranking methods.
BibTeX
@inproceedings{saadfalcon2023udapdr,
  author = {Jon Saad-Falcon and Omar Khattab and Keshav Santhanam and Radu Florian and Martin Franz and Salim Roukos and Avirup Sil and Md Arafat Sultan and Christopher Potts},
  title = {{UDAPDR: Unsupervised Domain Adaptation via LLM Prompting and Distillation of Rerankers}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.693},
}
Figure