Hybrid retrieval — 混合检索
Hybrid Retrieval(混合检索) — 是一类信息检索方法,它结合了词法(稀疏)和语义(密集/后期交互)信号,以提高检索结果的召回率和准确性。混合方案结合了精确术语匹配(BM25/TF-IDF)和向量相似度(双编码器、后期交互多向量模型)的优点,并采用对不同尺度得分具有鲁棒性的排序融合方法(例如,倒数排序融合 Reciprocal Rank Fusion, CombSUM/CombMNZ)以及交叉编码器重排。[1][2][3]
定义与动机
混合检索是一种通过两个(或更多)独立信号通道进行并行或级联搜索,然后进行结果融合和/或重排的方法。典型动机包括:(i) 克服“术语鸿沟”(如同义词、改写);(ii) 应对拼写错误/形态变化;(iii) 提取特定代码/标识符(稀疏模型的强项);(iv) 迁移到新领域/语言(密集模型提供语义泛化能力)。[4][5][6]
混合检索的组成部分
词法(稀疏)检索
- 经典模型。 TF-IDF 和 BM25/BM25F 是基于倒排索引的标准基线方法;BM25 在概率相关性框架(PRF)中得到理论支持,并广泛用于第一阶段排序。[7]
- 可学习的稀疏模型。
语义(密集/后期交互)检索
- 双编码器(Bi-encoder / single-vector)。 查询和文档被编码为向量,相似度通过点积(dot-product)或最大内积搜索(MIPS)计算。例如:DPR,[12] ANCE,[13] Contriever,[14] GTR,[15] E5。[16]
- 后期交互(Late-interaction / multi-vector)。 在“后期”交互阶段对词元级别的匹配进行建模,如 ColBERT/ColBERTv2;其权衡在于以更大的索引和延迟换取更高的准确性,可通过 PLAID、WARP 等工程驱动优化。[17][18][19]
混合与排序融合方案
- 并行搜索与候选集合并。 独立地从稀疏和密集通道获取候选列表及其内部得分,然后进行排序融合。[20]
- RRF (Reciprocal Rank Fusion)。 一种对不可比较的排序分数具有鲁棒性的技术,通过对排名的倒数求和进行融合:
,其中 `k` 通常取 60 左右。[21] 该方法作为内置检索器/处理器在 Elasticsearch/OpenSearch 等工业级搜索引擎中得到支持。[22][23]
, 。`α` 的选择可以是固定的,也可以是可学习的(基于数据集/查询)。[27]
- 分数归一化。 对于 CombSUM/CombMNZ,通常采用 min-max、z-score 等方法来统一尺度;[28] 而 RRF 则仅依赖于排名。
- 动态/自适应加权。 查询路由(query routing)、查询特征以及 LTR 模型可用于选择或加权不同通道;最新研究表明,一个简单的经过学习的线性组合通常优于 RRF,并且对分数归一化不敏感。[29]
重排与多阶段流水线
混合系统通常构建为 retrieval → fusion → rerank(检索 → 融合 → 重排)的流水线。重排阶段采用:
- 交叉编码器(Cross-encoders,如 BERT/T5)。 准确性最高,但计算成本高:MonoBERT/MonoT5 用于对前 N 个候选结果进行重排序。[30][31]
- 后期交互模型作为重排器。 ColBERT 系列模型也可以用作重排器;现代加速器(如 PLAID、WARP)能在不损失质量的情况下降低延迟。[32][33]
在 RAG 和严格的服务等级协议(SLA)场景下,质量 ↔ 延迟/成本的权衡尤为重要(参见 p95/p99 尾部延迟)。[34]
基准评测
- BEIR。 一个统一的数据集集合,包含来自不同领域和任务的数据,用于对检索器进行零样本/域外(zero-/out-of-domain)评估(例如,TREC-COVID, NFCorpus, NQ, HotpotQA, FiQA-2018, DBPedia-entity, ArguAna, Webis-Touché-2020, FEVER/Climate-FEVER, Scidocs, SciFact, CQADupStack 等)。[35]
- TREC Deep Learning / MS MARCO。 用于在大数据模式下训练和评估检索器与重排器的经典资源。[36][37][38]
- 质量指标。 nDCG@k, Recall@k, MRR;性能指标——延迟 p50/p95/p99, QPS;运营指标——内存/成本(CPU/GPU,索引)。[39][40]
- 消融研究。 建议明确每个通道/权重的贡献,以及对 RRF 中的 `k` 和混合权重 `α` 的敏感性;评估模型对查询改写和 OOD(域外)数据偏移的鲁棒性。[41][42]
工程实现与生产实践
- 索引与 ANN。 FAISS (Flat/HNSW/IVF-PQ), HNSW, ScaNN 用于 MIPS/余弦相似度搜索。[43][44][45]
- IR 技术栈。 Lucene/Anserini/Pyserini 用于稀疏/密集和混合检索流水线;在 BEIR 上具有“一键式”可复现性。[46][47]
- 向量数据库与搜索引擎。 Qdrant, Weaviate, pgvector/PostgreSQL, Vespa, Elasticsearch/OpenSearch 均提供原生混合搜索模式(BM25F+向量)和/或 RRF/线性组合功能。[48][49][50][51][52]
- RAG 模式。 架构:检索 → 融合 → 重排 → LLM 上下文,并需考虑词元限制和来源追溯。[53]
- 索引更新、去重、分词。 协调 BM25 和向量化模型的分词器至关重要;在混合前对得分进行校准(归一化/缩放)。[54]
局限性与开放问题
- 可移植性与多语言支持。 密集模型(如 GTR/E5)提升了迁移能力,但对领域/语言敏感;稀疏模型(如 SPLADE)在 OOD 场景下通常更鲁棒。[55][56]
- 与 LLM 的集成及幻觉问题。 混合检索减少了 RAG 上下文中的信息遗漏和噪声,但不能完全消除幻觉;需要严格的重排器和来源过滤。[57]
- 成本与隐私。 多向量索引的存储、压缩、加密和本地化(on-prem)部署;总拥有成本(TCO)评估。
- 发展趋势。 HyDE/doc2query/PRF 作为文档/查询扩展技术;[58][59] 混合权重学习(per-query `α`)、更高效的后期交互模型(PLAID/WARP)、长文档处理和多向量索引。[60][61]
方法对比表
截至 2025-09-10(基于 BEIR trec-covid 数据集的示例;nDCG@10 / Recall@100):[62]
| 方法 | 类型 (稀疏/密集/混合) | 思路/模型 | 融合方案 | 重排器 | nDCG@10 / R@100 | 延迟 (相对) | 来源 |
|---|---|---|---|---|---|---|---|
| BM25 | 稀疏 | 精确词项匹配 (PRF/BM25) | — | — | 0.595 / 0.109 | 非常低 | [63][64] |
| SPLADE++ (ED) | 稀疏 (可学习) | 稀疏词项扩展/加权 | — | — | 0.727 / 0.128 | 低–中 | [65][66] |
| Contriever (MS MARCO FT) | 密集 | 对比学习双编码器 | — | — | 0.596 / 0.091 | 中等 | [67][68] |
| BGE-base-en-v1.5 | 密集 | 强大的通用嵌入器 | — | — | 0.781 / 0.141 | 中等 | [69] |
| Cohere embed-english-v3.0 | 密集 | 工业级文本嵌入模型 | — | — | 0.818 / 0.159 | 中等 | [70] |
| BM25 + 密集 (示例: BM25+BGE) | 混合 | 并行检索 + 列表融合 | RRF (k≈60) 或加权组合 | 可选: MonoT5/ColBERT | (因实现而异;通常优于单一最佳通道) | 中等 | [71][72][73] |
注:最后一行仅为方案示意;具体数值取决于嵌入模型的选择、归一化方法和融合参数(详见参考文献及 Pyserini 的可复现脚本)。
参考文献
- Manning, C.D., Raghavan, P., Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press. ISBN 978‑0521865715.
- Robertson, S., Zaragoza, H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond. Foundations and Trends in Information Retrieval 3(4):333–389. DOI:10.1561/1500000019.
- Lin, J. et al. (2021). Pyserini: A Python Toolkit for Reproducible IR. SIGIR.
- Järvelin, K., Kekäläinen, J. (2002). Cumulated Gain‑Based Evaluation of IR Techniques. Information Retrieval 6:241–256. DOI:10.1023/A:1016043826386.
- Dean, J., Barroso, L.A. (2013). The Tail at Scale. CACM 56(2):74–80. DOI:10.1145/2408776.2408794.
外部链接
- Pyserini / Anserini: github.com/castorini/pyserini • github.com/castorini/anserini
- FAISS: arXiv:1702.08734
- Weaviate (Hybrid search): docs.weaviate.io/weaviate/search/hybrid
- pgvector: github.com/pgvector/pgvector
- Vespa (Hybrid search tutorial): docs.vespa.ai/en/tutorials/hybrid-search.html
注释
- ↑ Robertson, S., Zaragoza, H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond. Foundations and Trends in Information Retrieval, 3(4), 333–389. DOI:10.1561/1500000019.
- ↑ Cormack, G.V., Clarke, C.L.A., Büttcher, S. (2009). Reciprocal Rank Fusion Outperforms Condorcet and Individual Rank Learning Methods. SIGIR 2009, 758–759. PDF.
- ↑ Bruch, S., Gai, S., Ingber, A. (2023). An Analysis of Fusion Functions for Hybrid Retrieval. ACM TOIS 42(1):1–35. DOI:10.1145/3596512 • arXiv:2210.11934.
- ↑ Manning, C.D., Raghavan, P., Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press. ISBN 978‑0521865715 (см. главы о TF‑IDF, оценке и проблеме vocabulary mismatch).
- ↑ Izacard, G. et al. (2022). Unsupervised Dense Information Retrieval with Contrastive Learning (Contriever). TACL 10:1089–1108. arXiv:2112.09118.
- ↑ Wang, L. et al. (2022/2024). Text Embeddings by Weakly‑Supervised Contrastive Pre‑training (E5). arXiv:2212.03533.
- ↑ Robertson, S., Zaragoza, H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond. DOI:10.1561/1500000019.
- ↑ Formal, T., Piwowarski, B., Clinchant, S. (2021). SPLADE: Sparse Lexical and Expansion Model for First Stage Ranking. arXiv:2107.05720.
- ↑ Formal, T. et al. (2022). Making Sparse Neural IR Models More Effective. Findings of EMNLP. arXiv:2205.04733.
- ↑ Formal, T. et al. (2024). SPLADE‑v3: New baselines for SPLADE. arXiv:2403.06789.
- ↑ Lin, J., Ma, X. (2021). A Few Brief Notes on DeepImpact, COIL, and uniCOIL. arXiv:2106.14807.
- ↑ Karpukhin, V. et al. (2020). Dense Passage Retrieval for Open‑Domain QA. EMNLP. arXiv:2004.04906.
- ↑ Xiong, L. et al. (2021). Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrieval (ANCE). ICLR. arXiv:2007.00808.
- ↑ Izacard, G. et al. (2022). TACL. arXiv:2112.09118.
- ↑ Ni, J. et al. (2021/2022). Large Dual Encoders Are Generalizable Retrievers (GTR). EMNLP. arXiv:2112.07899.
- ↑ Wang, L. et al. (2022/2024). arXiv:2212.03533.
- ↑ Khattab, O., Zaharia, M. (2020). ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT. SIGIR. arXiv:2004.12832.
- ↑ Santhanam, K. et al. (2022). ColBERTv2 & PLAID. NAACL/ArXiv. arXiv:2112.01488; arXiv:2205.09707.
- ↑ Scheerer, J.L. et al. (2025). WARP: An Efficient Engine for Multi‑Vector Retrieval. arXiv:2501.17788.
- ↑ Lin, J. et al. (2021). Pyserini: A Python Toolkit for Reproducible IR with Sparse and Dense Representations. SIGIR. PDF.
- ↑ Cormack, G.V., Clarke, C.L.A., Büttcher, S. (2009). SIGIR. PDF.
- ↑ Elastic Docs. Reciprocal Rank Fusion. (доступ 2025‑09‑10). elastic.co/docs/.../reciprocal-rank-fusion.
- ↑ OpenSearch Docs. Score ranker processor (RRF). (доступ 2025‑09‑10). docs.opensearch.org/.../score-ranker-processor/.
- ↑ Fox, E.A., Shaw, J.A. (1994). Combination of Multiple Searches. TREC‑2, NIST SP 500‑215, 243–252. PDF.
- ↑ Lee, J.H. (1997). Analyses of Multiple Evidence Combination. SIGIR, 267–276. DOI:10.1145/258525.258587.
- ↑ Hsu, D.F., Taksa, I. (2005). Comparing Rank and Score Combination Methods for Data Fusion in IR. (Tech. report). PDF.
- ↑ Bruch, S., Gai, S., Ingber, A. (2023). TOIS. DOI:10.1145/3596512.
- ↑ Hsu, D.F., Taksa, I. (2005). см. выше.
- ↑ Bruch, S., Gai, S., Ingber, A. (2023). TOIS. DOI:10.1145/3596512.
- ↑ Nogueira, R., Cho, K. (2019). Passage Re‑ranking with BERT. arXiv:1901.04085.
- ↑ Nogueira, R., Jiang, Z., Lin, J. (2020). Document Ranking with a Pretrained Sequence‑to‑Sequence Model (MonoT5). Findings of EMNLP. arXiv:2003.06713.
- ↑ Santhanam, K. et al. (2022). arXiv:2205.09707.
- ↑ Scheerer, J.L. et al. (2025). arXiv:2501.17788.
- ↑ Dean, J., Barroso, L.A. (2013). The Tail at Scale. CACM 56(2):74–80. DOI:10.1145/2408776.2408794.
- ↑ Thakur, N. et al. (2021). BEIR: A Heterogeneous Benchmark for Zero‑shot Evaluation of IR Models. NeurIPS Datasets & Benchmarks. arXiv:2104.08663.
- ↑ Craswell, N. et al. (2020). Overview of the TREC 2019 Deep Learning Track. arXiv:2003.07820.
- ↑ Craswell, N. et al. (2021). Overview of the TREC 2020 Deep Learning Track. arXiv:2102.07662.
- ↑ Bajaj, P. et al. (2016). MS MARCO: A Human Generated MAchine Reading COmprehension Dataset. arXiv:1611.09268.
- ↑ Järvelin, K., Kekäläinen, J. (2002). Cumulated Gain‑Based Evaluation of IR Techniques. Information Retrieval 6:241–256. DOI:10.1023/A:1016043826386.
- ↑ Dean, J., Barroso, L.A. (2013). CACM. DOI:10.1145/2408776.2408794.
- ↑ Bruch, S. et al. (2023). DOI:10.1145/3596512.
- ↑ Ni, J. et al. (2021/2022). arXiv:2112.07899.
- ↑ Johnson, J., Douze, M., Jégou, H. (2017). Billion‑scale Similarity Search with GPUs (FAISS). arXiv:1702.08734.
- ↑ Malkov, Y., Yashunin, D. (2020). HNSW. IEEE TPAMI 42(4):824–836. DOI:10.1109/TPAMI.2018.2889473.
- ↑ Guo, R. et al. (2020). ScaNN: Efficient Vector Similarity Search at Scale. arXiv:1908.10396.
- ↑ Yang, P., Fang, H., Lin, J. (2018). Anserini: Reproducible IR Research with Lucene. JDIQ 10(4):1–20. DOI:10.1145/3239571.
- ↑ Lin, J. et al. (2021). SIGIR. PDF.
- ↑ Qdrant Docs. Hybrid queries (RRF, DBSF). (доступ 2025‑09‑10). qdrant.tech/.../hybrid-queries/.
- ↑ Weaviate Docs. Hybrid search. (доступ 2025‑09‑10). docs.weaviate.io/weaviate/search/hybrid.
- ↑ pgvector GitHub. (доступ 2025‑09‑10). github.com/pgvector/pgvector.
- ↑ Vespa Docs. Hybrid Text Search Tutorial. (доступ 2025‑09‑10). docs.vespa.ai/.../hybrid-search.html.
- ↑ Elastic Docs. Reciprocal Rank Fusion. (доступ 2025‑09‑10). elastic.co/docs/.../rrf.
- ↑ Lewis, P. et al. (2020). Retrieval‑Augmented Generation for Knowledge‑Intensive NLP Tasks. NeurIPS. arXiv:2005.11401.
- ↑ Hsu, D.F., Taksa, I. (2005). см. выше.
- ↑ Ni, J. et al. (2021/2022). arXiv:2112.07899.
- ↑ Formal, T. et al. (2021, 2022, 2024). arXiv:2107.05720; 2205.04733; 2403.06789.
- ↑ Lewis, P. et al. (2020). arXiv:2005.11401.
- ↑ Gao, L. et al. (2023). Precise Zero‑Shot Dense Retrieval without Relevance Labels (HyDE). ACL. arXiv:2212.10496.
- ↑ Nogueira, R. et al. (2019). Document Expansion by Query Prediction. arXiv:1904.08375; docTTTTTquery. PDF.
- ↑ Santhanam, K. et al. (2022). arXiv:2205.09707.
- ↑ Scheerer, J.L. et al. (2025). arXiv:2501.17788.
- ↑ Pyserini BEIR Regressions (доступ 2025‑09‑10): результаты по trec‑covid для BM25/SPLADE/Contriever/BGE/Cohere. castorini.github.io/pyserini/2cr/beir.html.
- ↑ Robertson, S., Zaragoza, H. (2009). DOI:10.1561/1500000019.
- ↑ Pyserini BEIR. См. ссылку выше.
- ↑ Formal, T. et al. (2021, 2022). arXiv:2107.05720; 2205.04733.
- ↑ Pyserini BEIR.
- ↑ Izacard, G. et al. (2022). arXiv:2112.09118.
- ↑ Pyserini BEIR.
- ↑ Pyserini BEIR.
- ↑ Pyserini BEIR.
- ↑ Cormack et al. (2009). SIGIR. RRF.
- ↑ Bruch et al. (2023). TOIS.
- ↑ Elastic/OpenSearch RRF Docs.