Course contentsShow
← Machine Learning and Deep Learning
Lesson 2018 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Multi-Query Generation and Fusion

Creating multiple paraphrased queries, retrieving for each, and merging results to improve recall.

Multi-Query Generation and Fusion

You'll learn how generating multiple paraphrased versions of a user's question and retrieving documents for each can significantly improve recall in RAG systems.

The Core Problem

A single user query might not perfectly match how relevant information is phrased in your documents. If someone asks "What causes global warming?" but your documents use terms like "climate change drivers" or "greenhouse gas effects," a single vector search might miss important content.

How Multi-Query Generation Works

Instead of relying on one query formulation, you generate 3-5 paraphrased versions of the original question using an LLM. Each paraphrase approaches the information need from a slightly different angle:

Original: "What causes global warming?"

Generated variants:

  • "What are the main drivers of climate change?"
  • "Why is Earth's temperature increasing?"
  • "What factors contribute to rising global temperatures?"

The Fusion Step

You then perform retrieval (vector search, hybrid search, etc.) for each query variant independently. This produces multiple sets of retrieved documents. The fusion step combines these results, typically using:

  • Reciprocal Rank Fusion (already taught) to merge rankings
  • Deduplication to remove repeated documents
  • Score aggregation to identify documents that appear across multiple query variants (high confidence)

Why This Works

Think of it like casting a wider net: each query variant might catch different relevant documents based on vocabulary overlap, semantic similarity, or phrasing. Documents retrieved by multiple variants are likely highly relevant, while single-hit documents still expand coverage.

Key Takeaway: Multi-query generation creates diverse retrieval pathways, and fusion combines their results to achieve better recall than any single query could alone—catching relevant documents regardless of how they're phrased.