HyDE
In plain wordsA search trick: ask an AI to write a made-up answer to the question first, then search for real documents that resemble that imagined answer.
Hypothetical Document Embeddings, a retrieval technique that searches with an imagined answer instead of the question: a language modellarge language model, n.: A computer program trained on enormous amounts of text to predict the words that come next. At vast scale, that simple skill lets it chat, answer questions, translate, summarize and write code. first drafts a passage that would answer the query, an embedding modelembedding model, n.: An AI model whose only job is to turn text (or images, or code) into lists of numbers that capture meaning, so a computer can measure how similar two things are. encodes the draft, and vector searchvector search, n.: Searching by closeness instead of exact match: the query and all stored items are lists of numbers, and the search returns the items whose numbers are most similar to the query's. returns the real documents nearest to it. Answer-shaped text tends to sit closer to relevant passages in embedding space than a terse question does. The draft may contain invented facts, but its authors argued that the encoder retains mostly its topical gist, and only genuine documents from the collection are ever returned. HyDE needs no relevance labels and improved zero-shot dense retrievaldense retrieval, n.: Finding relevant documents by turning the question and every document into lists of numbers that capture meaning, then picking the documents whose numbers are closest to the question's. in its introducing paper; its costs are an extra generation per query and drift when the model's guess is off-topic.
With HyDE, the query about why a sourdough loaf collapsed retrieved a troubleshooting guide on overproofing.
Origin
Introduced by Luyu Gao, Xueguang Ma, Jimmy Lin and Jamie Callan in 'Precise Zero-Shot Dense Retrieval without Relevance Labels' (arXiv, December 2022; ACL 2023), which used InstructGPT to write the hypothetical documents and the unsupervised Contriever encoder to embed them.
Related
- query rewritingquery rewriting, n.: Rephrasing a user's question before searching — fixing typos, adding missing details, splitting it into simpler questions — so the search engine finds better results.
- dense retrievaldense retrieval, n.: Finding relevant documents by turning the question and every document into lists of numbers that capture meaning, then picking the documents whose numbers are closest to the question's.
- retrieval-augmented generationretrieval-augmented generation, n.: Giving an AI an open-book exam: before answering, it looks up relevant passages in a set of documents and bases its reply on them, often citing where each point came from.
- embedding modelembedding model, n.: An AI model whose only job is to turn text (or images, or code) into lists of numbers that capture meaning, so a computer can measure how similar two things are.
- vector searchvector search, n.: Searching by closeness instead of exact match: the query and all stored items are lists of numbers, and the search returns the items whose numbers are most similar to the query's.
- semantic searchsemantic search, n.: Search that understands what you mean, not just the words you typed, so a search for 'cheap places to stay' also finds 'budget hotels'.
Sources
- Gao, L., Ma, X., Lin, J. & Callan, J. (2023). Precise Zero-Shot Dense Retrieval without Relevance Labels. ACL 2023. arXiv:2212.10496. arxiv.org/abs/2212.10496v1
Mentioned in
query rewritingquery rewriting, n.: Rephrasing a user's question before searching — fixing typos, adding missing details, splitting it into simpler questions — so the search engine finds better results.