Skip to main content
QUICK REVIEW

[Paper Review] Query2doc: Query Expansion with Large Language Models

Liang Wang, Nan Yang|arXiv (Cornell University)|Mar 14, 2023
Topic ModelingComputer Science6 citations
TL;DR

This paper proposes Query2doc, a query expansion method that uses few-shot prompting of large language models (LLMs) to generate pseudo-documents, which are then concatenated with original queries to improve both sparse (e.g., BM25) and dense retrieval systems. The approach boosts BM25 performance by 3% to 15% on MS-MARCO and TREC DL datasets without model fine-tuning, and also improves state-of-the-art dense retrievers like DPR, SimLM, and E5.

ABSTRACT

This paper introduces a simple yet effective query expansion approach, denoted as query2doc, to improve both sparse and dense retrieval systems. The proposed method first generates pseudo-documents by few-shot prompting large language models (LLMs), and then expands the query with generated pseudo-documents. LLMs are trained on web-scale text corpora and are adept at knowledge memorization. The pseudo-documents from LLMs often contain highly relevant information that can aid in query disambiguation and guide the retrievers. Experimental results demonstrate that query2doc boosts the performance of BM25 by 3% to 15% on ad-hoc IR datasets, such as MS-MARCO and TREC DL, without any model fine-tuning. Furthermore, our method also benefits state-of-the-art dense retrievers in terms of both in-domain and out-of-domain results.

Motivation & Objective

  • To address lexical gaps and ambiguity in short, sparse queries that hinder retrieval performance.
  • To explore whether large language models can serve as effective query expansion engines without fine-tuning.
  • To improve both sparse and dense retrieval systems using LLM-generated pseudo-documents as contextual augmentation.
  • To evaluate the method’s effectiveness across in-domain and out-of-domain settings, including zero-shot generalization.
  • To analyze the impact of LLM scale and prompt design on retrieval performance and factual consistency.

Proposed method

  • The method uses few-shot prompting with k=4 in-context examples to generate a pseudo-document d′ from a given query q.
  • For sparse retrieval, the original query q is repeated n=5 times before concatenation with d′ to balance term weights, forming the expanded query q+ = concat({q}×5, d′).
  • For dense retrieval, the expanded query q+ is formed by concatenating q, [SEP], and d′, i.e., q+ = concat(q, [SEP], d′).
  • The approach is orthogonal to model training and requires no architecture or loss function changes, enabling plug-and-play integration with existing retrieval pipelines.
  • Pseudo-documents are generated using an improved GPT-3 text-davinci-003 model, and the method is evaluated on MS-MARCO, TREC DL 2019/2020, and zero-shot OOD datasets.
  • The method is evaluated under two dense retrieval settings: training from BERT-base with BM25 hard negatives, and knowledge distillation from a cross-encoder re-ranker.

Experimental results

Research questions

  • RQ1Can few-shot prompting of large language models generate high-quality pseudo-documents that improve retrieval performance?
  • RQ2Does query expansion via LLM-generated content significantly boost both sparse and dense retrieval systems without model fine-tuning?
  • RQ3How does the performance of query2doc vary across in-domain and out-of-domain retrieval settings?
  • RQ4What is the impact of LLM scale on the effectiveness of query2doc, particularly in terms of factual accuracy and retrieval gains?
  • RQ5How does the method compare to existing query and document expansion techniques in terms of efficiency and effectiveness?

Key findings

  • Query2doc improves off-the-shelf BM25 by 3% to 15% on MS-MARCO and TREC DL datasets, with larger gains on hard queries from the TREC DL track.
  • The method improves state-of-the-art dense retrievers, including DPR, SimLM, and E5, though gains diminish when distilling from strong cross-encoder re-rankers.
  • Query2doc outperforms strong baselines in zero-shot out-of-domain settings across most datasets, demonstrating strong generalization.
  • The method is most effective when using the most capable LLMs; smaller models provide only marginal improvements over baselines.
  • Despite high performance, LLM-generated pseudo-documents occasionally contain factual errors, such as incorrect dates or details, which can undermine system trustworthiness.
  • Latency increases significantly with query2doc: LLM inference adds over 2000ms per query, and index search slows due to expanded query length, indicating a trade-off between accuracy and efficiency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.