RAG & Retrieval·Question 78 of 100Quick-fire

What is query rewriting or HyDE, and when does it help retrieval?

Quick-fire answer from the Awesome Generative AI Guide (MIT)

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Real user queries are often short, underspecified, or phrased differently from the source documents, which hurts dense retrieval. Query rewriting reformulates or expands the query (fixing typos, adding synonyms, splitting a multi-part question) before retrieval, and HyDE (hypothetical document embeddings) has the model draft a hypothetical answer and embeds that, because a full pseudo-answer often sits closer to the real passages than the terse question does. These help most on conversational or vague queries and on corpora with a vocabulary mismatch. The cost is an extra model call and the risk of drifting off-topic, so measure whether it actually raises retrieval recall on your data.

Full worked answer

Real user queries are often short, underspecified, or phrased differently from the source documents, which hurts dense retrieval. Query rewriting reformulates or expands the query (fixing typos, adding synonyms, splitting a multi-part question) before retrieval, and HyDE (hypothetical document embeddings) has the model draft a hypothetical answer and embeds that, because a full pseudo-answer often sits closer to the real passages than the terse question does. These help most on conversational or vague queries and on corpora with a vocabulary mismatch. The cost is an extra model call and the risk of drifting off-topic, so measure whether it actually raises retrieval recall on your data.

Learn more: HyDE (Gao et al.)

What a good answer covers

  • Real user queries are often short, underspecified, or phrased differently from the source documents,…
  • Query rewriting reformulates or expands the query (fixing typos, adding synonyms, splitting a multi-part…
  • These help most on conversational or vague queries and on corpora with a vocabulary mismatch
  • The cost is an extra model call and the risk of drifting off-topic, so measure whether it actually…

Key terms: Learn more

Quick-fire answer from the Awesome Generative AI Guide (MIT) · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep