GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
★ Read firstACL 2023

Precise Zero-Shot Dense Retrieval without Relevance Labels

Ask a model to write a fake answer, embed it, and search for real documents near it. With no labels, HyDE lifted an unsupervised retriever 16.8 nDCG points on TREC DL19.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2022
AUTHORS
Gao, Ma, Lin, Callan
FROM
Carnegie Mellon University, University of Waterloo
PUBLISHED
Dec 2022 · ACL 2023
CITED BY
1,078Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 24% of this breakdown.

01

The paper in one minute

Dense retrieval embeds queries and documents into vectors and finds documents whose vectors are close to the query's. It works best after training on large sets of judged query-document pairs such as MS MARCO. Without them, an unsupervised encoder like Contriever, trained only to tell similar documents from dissimilar ones, often does worse than BM25.

HyDE (Hypothetical Document Embeddings) sidesteps the need to learn query-document relevance. Given a query, an instruction-following language model is asked to "write a passage to answer the question". The passage is not retrieved from anywhere; it may contain false details. An unsupervised contrastive encoder then embeds it. Because that encoder was trained on document-to-document similarity, the hypothetical document's vector lands near real documents that look like an answer. The authors argue the encoder's dense bottleneck acts as a lossy compressor that keeps the relevant pattern and drops much of the invented detail.

In practice, several hypothetical documents are sampled and their vectors averaged, optionally together with the query's own vector. The instruction is adjusted per task: a scientific passage for SciFact, a counter-argument for ArguAna, a financial article for FiQA, a news passage for TREC-NEWS, and a passage in the target language for multilingual search. No model is trained or fine-tuned.

With InstructGPT (text-davinci-003) and Contriever, HyDE outperformed Contriever and BM25 on web search (TREC DL19 and DL20), beat BM25 on five of six low-resource BEIR datasets by nDCG, and improved retrieval in Swahili, Korean, Japanese and Bengali. It came close to Contriever fine-tuned on MS MARCO in some settings and stayed behind it in others. Smaller generators (Flan-T5 11B, a 52B Cohere model) gave smaller gains.

THE IDEA, VISUALLY
HYPOTHETICAL DOCUMENT EMBEDDINGS (SECTION 3) query: how long does it take to remove a wisdom tooth instruction model 'write a passage to answer the question' hypothetical documents (illustrative; may hold wrong details) It usually takes 30 minutes to two hours... Extraction lasts about 40 minutes... The surgeon numbs the gum, then removes... unsupervised encoder (Contriever) embed each, then average nearest real documents inner-product search No relevance labels; no model is trained. The vector keeps the topic and form of an answer; invented details matter little. Cost: one or more generations per query. Fails when the model does not know the entity asked about. arXiv 2212.10496, CMU and University of Waterloo nDCG@10, NO RELEVANCE LABELS (TABLES 1-2) DL19 61.3 50.6 DL20 57.9 48.0 SciFact 69.1 67.9 ArguAna 46.6 39.7 TREC-COVID 59.3 59.5 FiQA 27.3 23.6 DBPedia 36.8 31.8 TREC-NEWS 44.0 39.5 BM25 Contriever HyDE HyDE below BM25 TREC-COVID recall@100: BM25 49.8, HyDE 41.4
Left: HyDE's two steps. An instruction-following model writes hypothetical documents for the query; an unsupervised encoder embeds them; their average (optionally with the query) is used to search real documents. Right: nDCG@10 for BM25, Contriever and HyDE on TREC DL19, DL20 and six BEIR sets (Tables 1 and 2). HyDE improves on Contriever everywhere; on TREC-COVID, BM25 stays ahead, by 0.2 nDCG points and by 8.4 points of recall@100.
Research notes: the problem, approach and results
+16.8

nDCG@10 points over unsupervised Contriever on TREC DL19 (44.5 to 61.3), next to fine-tuned Contriever's 62.1 (Table 1)

17 of 20

metric cells where HyDE beats BM25; it trails on TREC-COVID nDCG, TREC-COVID recall@100 (by 8.4) and Bengali (our count)

48.9 -> 61.3

DL19 nDCG@10 with an 11B generator vs the 175B InstructGPT generator, same encoder (Table 4)

THE PROBLEM

Dense retrieval works well when trained on many labeled query-document pairs, but new domains, languages and products rarely have them. Unsupervised dense retrievers fall behind the old keyword method, BM25, on many tasks.

THE IDEA

Do not embed the query. Ask an instruction-following model to write a document that would answer it, possibly with wrong details, embed that hypothetical document with an unsupervised encoder, and search for real documents near it. The encoder's bottleneck keeps topic and form and drops much of the invented detail.

THE RESULT

With InstructGPT and Contriever, HyDE raised nDCG@10 from 44.5 to 61.3 on TREC DL19, close to fine-tuned retrievers, and improved Contriever on all six low-resource BEIR sets and four non-English languages. Smaller generators helped less, and a weak one slightly hurt a fine-tuned encoder.

02

Why it matters to an FDE

It is a fast start for a new corpus. On day one with a customer's documents, there are no search logs and no relevance labels. HyDE gives a meaningful lift over an unsupervised encoder with only a prompt, and the authors suggest using it until enough usage data exists to train a supervised retriever.

It closes the gap between question and document language. Users ask short questions; documents are written as explanations, policies or reports. Writing a hypothetical answer moves the search into document language. In our toy, a question about "pulling a third molar" found the extraction document only after a hypothetical answer used the document's words.

It fails on what the model does not know. For internal names, codes and products, the generator writes about something else, and the search follows it. In our toy, a query about an internal flag name retrieved a document about a telescope that shares part of the name. Keep a keyword path (BM25 or hybrid search) for exact terms and identifiers.

It costs a generation per query. Each search becomes one or more LLM calls plus encoding, which adds latency and spend. Cache hypothetical documents for frequent queries, keep them short, and measure the gain against a cheaper query rewrite or a hybrid retriever before shipping.

Quality depends on the generator and the encoder. With an 11B generator the DL19 gain was 4.4 points instead of 16.8; on a fine-tuned encoder, the two smaller generators made results slightly worse. Measure on the customer's queries with the model you will actually deploy.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    Method, task instructions, results vs BM25 and fine-tuned models, generators, misreadings

    Free account
  2. 04How it works

    The formulation, generation settings, averaging, encoders, datasets and baselines

    Premium
  3. 05The numbers that matter

    Web search, BEIR, multilingual, generator and encoder ablations, and where BM25 still wins

    Premium
  4. 06Try it yourself

    Recount HyDE against BM25, read the generator ablation, run the mechanism on a toy corpus

    Premium
  5. 07Where it breaks

    Unknown entities, generator cost and size, recall on some sets, unreported N, old models

    Premium
  6. 08Using it on a deployment

    When HyDE helps, how to combine it with keyword search, and what to measure before keeping it

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →