[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"glossary-hypothetical-document-embeddings::en":3,"gloss-cluster-hypothetical-document-embeddings::en":26,"gloss-next-hypothetical-document-embeddings::en":9},{"slug":4,"category":5,"name":6,"definition":7,"meta_desc":8,"faq":9,"schema_markup":9,"related":10},"hypothetical-document-embeddings","prompt-eng","Hypothetical Document Embeddings (HyDE)","Hypothetical Document Embeddings (HyDE) is a retrieval trick that improves search by embedding a fake answer instead of the raw question. Introduced by Gao et al. (2022), the flow is: ask an LLM to write a plausible document that would answer the user's query, embed that hypothetical text, and use its vector to find real documents nearby. The intuition is that a full hypothetical answer sits closer, in embedding space, to genuine answer passages than a short, keyword-poor question does — closing the 'question vs. answer' vocabulary gap that hurts dense retrieval. It works zero-shot, without training a retriever on your data, which makes it attractive early in a RAG project. For builders, it's a drop-in step ahead of your vector search; the generated draft is thrown away, only its embedding is used. Caveats: it adds an LLM call (latency and cost) before every search, and if the model hallucinates an off-topic 'answer,' retrieval can drift — so it helps most when the model has real domain competence.","HyDE improves retrieval by embedding a plausible fake answer instead of the raw question, because answers sit closer to real documents in vector space.",null,[11,14,17,20,23],{"slug":12,"name":13},"embedding","Embedding",{"slug":15,"name":16},"reranking","Reranking",{"slug":18,"name":19},"retrieval","Retrieval",{"slug":21,"name":22},"retrieval-augmented-generation","Retrieval-Augmented Generation (RAG)",{"slug":24,"name":25},"semantic-search","Semantic Search",[27,31,34,37,41,44,47,50,53,56,59,62],{"slug":28,"category":5,"name":29,"updated_at":30},"analogical-prompting","Analogical Prompting","2026-08-24T02:46:37+00:00",{"slug":32,"category":5,"name":33,"updated_at":30},"automatic-prompt-optimization","Automatic Prompt Optimization",{"slug":35,"category":5,"name":36,"updated_at":30},"chain-of-density","Chain of Density (CoD)",{"slug":38,"category":5,"name":39,"updated_at":40},"chain-of-thought-prompting","Chain-of-Thought Prompting","2026-08-24T02:46:36+00:00",{"slug":42,"category":5,"name":43,"updated_at":30},"chain-of-verification","Chain-of-Verification",{"slug":45,"category":5,"name":46,"updated_at":40},"chunking","Chunking",{"slug":48,"category":5,"name":49,"updated_at":40},"constrained-decoding","Constrained Decoding",{"slug":51,"category":5,"name":52,"updated_at":40},"context-stuffing","Context Stuffing",{"slug":54,"category":5,"name":55,"updated_at":40},"delimiter","Delimiter",{"slug":57,"category":5,"name":58,"updated_at":30},"directional-stimulus-prompting","Directional Stimulus Prompting",{"slug":60,"category":5,"name":61,"updated_at":30},"emotion-prompting","Emotion Prompting",{"slug":63,"category":5,"name":64,"updated_at":40},"few-shot-prompting","Few-Shot Prompting"]