“it has helped me multiple times in the past to strongly reduce problems with RAG”
Precise Zero-Shot Dense Retrieval without Relevance Labels
HyDE:先让 LLM 写假想文档,再用它做向量检索
论文提出假想文档嵌入(HyDE):先让指令遵循语言模型(如 InstructGPT)针对查询零样本生成一篇假想文档,它体现相关性模式但可能含有虚假细节,再用无监督对比学习的编码器(如 Contriever)把它编码成向量,在语料向量空间中检索相似的真实文档,编码器的稠密瓶颈会过滤掉错误细节。实验显示 HyDE 明显优于 Contriever,并与微调过的检索器表现相当,覆盖网页搜索、问答、事实核查等任务及斯瓦希里语、韩语、日语等语言。
评论者把它当作改进 RAG 和稠密检索的简单技巧来引用:让模型先编一个答案再对它做 embedding,有人称它多次帮自己减少检索问题,也有人提醒不一定总是改进。
学习路径
读这篇之前,按顺序读书架上的 5 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出先掌握 BERT 式编码器、GPT-3 的少样本提示和指令微调,再了解向量检索的工程基础,就能明白 HyDE 如何用指令模型写出假想文档来替代相关性标注。
- 1
稠密检索的编码器多基于 BERT,HyDE 的对比编码器也是同类结构。
读预训练的双向编码器与句向量的概念;理解为什么它能做语义相似度。
- 2
HyDE 靠提示让大模型零样本写出文档,这种提示能力来自 GPT-3 一路的发展。
读少样本和零样本提示(in-context learning)的概念;跳过各数据集的评测。
- 3
指令微调让模型零样本遵循指令,是 HyDE 能直接下指令生成文档的背景。
读用指令格式微调后零样本泛化的主要结论。
- 4
HyDE 用的 InstructGPT 就是这篇的模型,需要知道它怎么学会遵循指令。
读监督微调、奖励模型与强化学习的三步流程;理解它为何比同规模 GPT-3 更听话。
- 5
HyDE 得到的假想文档向量要在语料向量库里做近邻搜索,这类索引就是 FAISS。
读向量近邻搜索与乘积量化的基本概念;跳过 GPU 实现细节。
- 6Precise Zero-Shot Dense Retrieval without Relevance Labels
目标论文:先用指令模型写假想文档,再用它的向量做零样本检索。
读假想文档生成加无监督对比编码器过滤幻觉细节的流程,以及与有监督稠密检索的对比结果。
HN 书评
推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及“Also there is an easy technique for getting better results with dense search - Hypothetical Document Embeddings.”
“There's a trick called Hypothetical Document Embeddings (HyDE) where you ask GPT-3 to invent an answer to the user's question, embed THAT fictional answer”
“also an approach to solve the alignment problem.”
“This approach is called HyDE (first published here: Precise Zero-Shot Dense Retrieval without Relevance Labels).”
“Some people packaged this rather intuitive idea, named it Hyde (Hypothetical Document Embeddings) and wrote a paper about it —”
看全部 11 条 →
“The original paper proposing this technique can be found here: Precise Zero-Shot Dense Retrieval without Relevance Labels”
“Hyde 2022 Precise Zero-Shot Dense Retrieval without Relevance Labels”
“hyde paper is here Precise Zero-Shot Dense Retrieval without Relevance Labels”
“which seems to be a kind of generative query expansion/pre-processing”
“You can further improve your results by running query expansion using HyDE[1], though it's not always an improvement.”
- Precise Zero-Shot Dense Retrieval Without Relevance Labels ↗pr337h4m · 2023-01-23 · 1 分
- Hypothetical Document Embeddings (HyDE) for Precise Zero-Shot Retrieval [pdf] ↗TaurenHunter · 2024-11-01 · 2 分
- Hypothetical Document Embeddings ↗kaycebasques · 2026-08-14 · 2 分