Query Expansion Using Contextual Clue Sampling with Language Models

Linqing Liu, Minghan Li, Jimmy Lin, Sebastian Riedel, Pontus StenetorparXiv 2022 · DOI

Abstract

Open-Domain Question Answering (ODQA) systems often face a trade-off between the storage efficiency of lexical retrieval and the semantic accuracy of dense retrieval. This paper introduces a novel query expansion method that leverages Large Language Models (LLMs) to generate multiple "contextual clues"—potential sentences containing the answer—to bridge the vocabulary gap. By combining an edit-distance filtering strategy with probability-weighted result fusion, the proposed method achieves retrieval accuracy comparable to state-of-the-art dense retrievers (like DPR) while reducing index storage requirements by 96%.

Introduction

In ODQA, the primary challenge is finding relevant documents within a massive corpus to answer a user's query. Traditional lexical retrieval (e.g., BM25) is efficient but suffers from "vocabulary mismatch," failing when queries and documents use different terminology. Dense Retrieval (e.g., DPR) addresses this using semantic embeddings but requires massive indices (often 60GB+) stored in RAM, creating a significant "memory tax."

While recent efforts have used LLMs for query expansion to provide context, these models are prone to hallucinations and redundancy. This paper proposes a system that harnesses the generative power of LLMs while mitigating factual errors through a robust filtering and fusion pipeline.

Methodology

The authors implement a three-stage pipeline designed to maximize diversity while maintaining relevance:

  1. Contextual Clue Sampling: A BART-large model is fine-tuned to generate sentences likely to contain the answer to a given question. The system samples 100 candidate outputs using beam search to capture a wide range of potential reasoning paths.
  2. Filtering via Clustering: To address hallucinations, clues are clustered based on edit distance. In each cluster—where sentence structures are similar but specific facts may differ—only the clue with the highest generation probability is retained. This reduces the query count by 70% and prunes noisy data.
  3. Retrieval and Weighted Fusion: Each filtered clue is appended to the original query for individual BM25 retrievals. The final document ranking is determined by a weighted fusion score, where each clue's contribution is scaled by the LLM’s generation probability.
The proposed pipeline for query expansion, showing the transition from question to filtered contextual clues and final weighted fusion.

Key Insights

  • Diversity vs. Relevance: Sampling multiple paths is superior to single-path generation, provided a filtering mechanism is in place to prevent "query drift" caused by hallucinations.
  • Denoising via Probability: The authors found that hallucinations often share sentence structures with factual clues. Clustering by edit distance allows the model's internal probability to act as an effective "truth filter."
  • Efficiency: By utilizing BM25 as the backbone, the system maintains a lightweight index of only 2.4GB, a stark contrast to the 61GB required by dense models.

Experimental Results

The approach was evaluated on the Natural Questions (NQ) and TriviaQA benchmarks. The "Ours-multi" model demonstrated that well-expanded lexical queries can be more robust than dense vector representations for broad searches.

Comparison of retrieval performance and index size. The proposed method (Ours-multi) achieves superior Top-100 accuracy compared to DPR while maintaining a significantly smaller index.
  • Retrieval Performance: On NQ, the model achieved a Top-100 accuracy of 86.7%, surpassing DPR (86.1%) and previous expansion methods like GAR (84.7%).
  • End-to-End QA: When paired with a reader model, the method achieved a state-of-the-art Exact Match (EM) score of 51.7 on NQ, outperforming RAG and FiD.
  • Storage Gains: The system achieved a 96% reduction in index size compared to DPR (2.4GB vs 61GB).

Limitations and Future Work

The primary trade-off for this efficiency is latency. Generating 100 clues and performing multiple retrieval passes takes approximately 2.7 seconds per query on a CPU, compared to 0.3 seconds for basic BM25. Future work may explore zero-shot prompting with larger models like GPT-4 to eliminate the need for task-specific fine-tuning and further optimize the sequential pipeline for real-time applications.

Summary updated

BibTeX
@misc{liu2022query,
  author = {Linqing Liu and Minghan Li and Jimmy Lin and Sebastian Riedel and Pontus Stenetorp},
  title = {{Query Expansion Using Contextual Clue Sampling with Language Models}},
  year = {2022},
  eprint = {2210.07093},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.07093},
}
Figure