ML//RAG//HyDE
HyDE (Hypothetical Document Embeddings) is a retrieval technique that asks the LLM to generate a hypothetical answer to the query and embeds that answer instead of the raw query, and it is used to find the right documents for short or vague queries. The generated document is probably wrong, but its embedding is closer in vector space to the real answer than the query alone.
HyDE (Hypothetical Document Embeddings) is a retrieval technique that asks the LLM to generate a hypothetical answer to the query and embeds that answer instead of the raw query, and it is used to find the right documents for short or vague queries. The generated document is probably wrong, but its embedding is closer in vector space to the real answer than the query alone.
It improves recall, especially for short or vague queries, because the LLM expands the query into the semantic neighborhood of the document. It is a simple technique with a big impact, and it needs no training: it works with any embedding model and any LLM.