Files
nexus/wiki/concepts/Reciprocal-Rank-Fusion.md
2026-04-23 00:02:55 +08:00

1.6 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Reciprocal Rank Fusion (RRF) concept
search
ranking
fusion
algorithm
semantic-memory-search
2026-04-22

Aliases

  • RRF
  • Reciprocal Rank Fusion

Definition

Reciprocal Rank Fusion倒数排名融合是一种多检索器结果融合算法通过对各检索器返回结果的排名取倒数并进行加权求和生成统一的融合排名。无需训练简单高效是混合搜索的标准融合策略。

Formula

RRF_score(d) = Σ  1 / (k + rank_i(d))

其中:
- d = 文档
- rank_i(d) = 检索器 i 对文档 d 的排名从1开始
- k = 平滑参数(通常 k=60作用是减少高排名文档的压倒性优势

Why k=60?

k=60 是一个经验值,来源于 BM25 的默认参数 k1=1.2、b=0.75 的理论推导。选择 k=60 使得排名差异在高位次rank 1 vs rank 2时有明显影响但在低排名rank 50 vs rank 51时影响减弱兼顾早期精确和长尾包容。

Example

假设有两个检索器对同一查询的结果:

文档 向量检索排名 BM25 排名
A 1 3
B 2 1
C 3 2

k=60 时:

  • RRF(A) = 1/(60+1) + 1/(60+3) = 0.01639 + 0.01587 = 0.03226
  • RRF(B) = 1/(60+2) + 1/(60+1) = 0.01613 + 0.01639 = 0.03252
  • RRF(C) = 1/(60+3) + 1/(60+2) = 0.01587 + 0.01613 = 0.03200

最终排名B > A > C

Connections