Document-to-document similarity reframes retrieval as a comparison between a generated document-like passage and corpus documents. HyDE uses an LLM to turn a short query into a hypothetical document whose embedding can match the corpus more effectively than the original query. section 7.0 section 7.2
Figure 7.1 With query–document mismatch, the query embedding lies far from the cluster of relevant documents, which is why direct embedding retrieval underperforms.

The query–document mismatch diagram shows why direct embedding retrieval can miss relevant documents when user and corpus vocabularies differ. section 7.1
A typical document-to-document retrieval pipeline separates relevance modeling from semantic search:
- Generate a semantically plausible hypothetical document from the user's sparse query. section 7.2
- Encode the generated passage and corpus documents with a document encoder. section 7.1
- Rank corpus documents by embedding similarity, without explicitly scoring the original query against each document. section 7.1
- Discard the generated passage after retrieval and ground the final answer in verified corpus documents. section 7.0
Medical vocabulary mismatch
For the query “why does my chest hurt when I climb the stairs?”, BM25 retrieves documents with little lexical overlap, while direct dense retrieval finds only one relevant document in its top two. A hypothetical passage using terms such as “substernal discomfort” and “exertion” retrieves both relevant documents, achieving Recall@2 of 1.00. section 7.1
Figure 7.2 HyDE Workflow: HyDE separates relevance modeling (LLM generation g(q)) from semantic encoding (f()) and retrieval over a corpus.

The workflow diagram clarifies the separation between LLM-based relevance modeling, document encoding, and corpus retrieval. section 7.2
