⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’

Excalidraw Data

Text Elements

User Query

“What are the benefits of remote work?”

Step 1: Generate Hypothetical Answer

(LLM generates what an ideal answer looks like)

“Remote work offers flexible schedules, reduced commute time, and improved work-life balance. Employees can save money on transportation and clothing. Companies reduce office space costs…”

Step 2: Embed Hypothetical Answer

Embed the hypothetical answer (NOT the query)

[0.23, -0.15, 0.87, 0.42, …]

Step 3: Vector Similarity Search

Find docs similar to hypothetical answer

cos_sim(hyp_embedding, doc_embeddings)

Retrieved Documents

• Remote work benefits case studies • Employee testimonials on WFH • Research on productivity gains • Cost analysis of remote policies

Why HyDE Works

Traditional: Query → Embed query → Search for similar docs

Problem: Short queries may not match document language well

HyDE: Query → LLM generates hypothetical doc → Embed doc → Search for similar docs

The hypothetical answer uses the same vocabulary and style as real documents, leading to better semantic matches!

HyDE (Hypothetical Document Embedding)