Doc2Query--: When Less is More

Mitko Gospodinov, Sean MacAvaney, Craig MacdonaldarXiv 2023

TL;DR

Doc2Query improves search engine retrieval by appending predicted queries to documents before indexing, but it suffers from model hallucinations that bloat index sizes and degrade accuracy. This paper introduces Doc2Query--, a method that uses neural relevance models to filter out low-quality generated queries prior to indexing. The result is a triple win: up to a 16% boost in retrieval effectiveness, a 33% smaller index size, and a 23% faster query execution time.

What Problem Does This Paper Address?

Document expansion via Doc2Query is a powerful technique in information retrieval. By using a sequence-to-sequence model (like T5) to predict what questions a document might answer and appending those queries to the document text, it dramatically improves first-stage retrieval using simple lexical models like BM25.

However, generative language models are notorious for "hallucinating"—generating text that is factually incorrect or completely unrelated to the source document. In Doc2Query, these hallucinated queries introduce noise into the search index, leading to false positives during retrieval, while unnecessarily inflating storage requirements and query processing times.

Methods

The authors introduce Doc2Query-- (Doc2Query-minus-minus), which adds a filtering phase right after the query generation phase. Instead of training a brand-new model to detect hallucinations, they cleverly repurpose existing cross-encoder and bi-encoder neural relevance models (specifically ELECTRA, MonoT5, and TCT-ColBERT).

The process works as follows:

  1. Generation: Generate $n$ queries per document using a standard Doc2Query model (T5).
  2. Scoring: Score the relevance of each generated query against its source document using a pre-trained relevance model.
  3. Filtering: Retain only the top $p$ proportion of queries across the entire corpus (e.g., keeping the top 30% highest-scoring queries) and discard the rest.
  4. Indexing: Append the retained queries to the documents and build the final search index.

Datasets

The approach was evaluated using the widely recognized MS MARCO v1 passage corpus. Specifically, the authors tested on five distinct evaluation collections:

  • MS MARCO Dev (small): Used for tuning parameters like BM25 hyperparameters and filtering percentages.
  • MS MARCO Dev2
  • MS MARCO Eval: A held-out leaderboard set.
  • TREC Deep Learning 2019 (DL'19) and 2020 (DL'20)

Key Insights and Ideas

  • Less is More: Simply generating more queries doesn't inherently improve search performance indefinitely; it plateaus and introduces massive noise. Filtering out the bottom 70% of queries actually improves accuracy significantly compared to keeping all of them.
  • Repurposing Works: You don't need a specialized hallucination classifier. Standard neural relevance models, which are already optimized to judge query-document alignment, perform exceptionally well at identifying bad expansions.
  • The Efficiency Trade-off is Worth It: While filtering adds computational overhead at index time (up to a 78% increase in GPU hours), it pays off massively at query time. Moreover, if you hold the computational budget constant, spending time filtering a smaller pool of high-quality queries yields much better search accuracy than spending that same time generating a massive, unfiltered pool of queries.

Key Results

  • Retrieval Boost: Filtering with the ELECTRA model (retaining the top 30% of queries) improved retrieval effectiveness (RR@10) on the MS MARCO Dev set from 0.279 to 0.323—a 16% relative improvement.
  • Index and Speed Optimization: For $n=80$ generated queries, applying the ELECTRA filter reduced the index size by 33% (from 1.41 GB down to 0.95 GB) and cut the mean query response time by 23% (from 30ms down to 23ms).

A comprehensive breakdown of results across different filters and datasets can be seen in Table 1:

Table 1. Effectiveness and efficiency measurements for Doc2Query-- and baselines. Significant differences between Doc2Query and their corresponding filtered versions for Dev, Dev2, DL’19 and DL’20 are indicated with * (paired t-test, p < 0.05). Values marked with † are taken from the corresponding submissions to the public leaderboard.

The trade-off between the number of indexed tokens and retrieval effectiveness is clearly illustrated in Figure 2, showing how the filtering phase pushes performance higher while keeping token counts low:

Fig. 2. Effectiveness (RR@10) on the Dev set, compared with the total number of indexed tokens. The generation phase is shown in dotted black (at various values of n), and the ELECTRA filtering phase is shown in solid blue (at various values of p).

Limitations and Future Work

  • Index-Time Computational Cost: The primary drawback is the added computational overhead during the indexing phase due to scoring every generated query with a neural model.
  • Scope of Expansion Styles: This work focused strictly on sequence-to-sequence style query generation. The authors note that Masked Language Modeling (MLM) expansion techniques (like SPLADE), which generate individual bag-of-words tokens rather than full text sequences, lack the necessary context for this specific filtering approach to work effectively.
  • Future Directions: The authors suggest exploring relevance filtering for other generative IR tasks, such as alternative query formulation, synthetic training data generation, and natural language answers to queries.

Summary updated

BibTeX
@misc{gospodinov2023doc,
  author = {Mitko Gospodinov and Sean MacAvaney and Craig Macdonald},
  title = {{Doc2Query--: When Less is More}},
  year = {2023},
  eprint = {2301.03266},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.03266},
}
Figure