Skip to main content
InterviewHubPRO
Section Overview
Q23

Question 23 of 50

Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

46%
Vector DBs & RAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)

What is Hypothetical Document Embeddings (HyDE) and when does it improve retrieval?

senior LevelData Structures

In Simple Words: HyDE uses an LLM to generate a hypothetical, hallucinatory ideal answer to the user's question before searching:

  1. User asks: "How do I configure MTU for jumbo frames on Linux?"
  2. LLM hallucinates a synthetic response with realistic commands (ip link set mtu 9000).
  3. Embed the synthetic answer instead of the short query.
  4. Search the vector database using the answer's embedding.
  • Why it works: Answer-to-document vector similarity is significantly higher than question-to-document vector similarity in vector space!