Update nexus: fix conflicts and sync local changes
This commit is contained in:
@@ -1,52 +1,52 @@
|
||||
---
|
||||
title: "Reciprocal Rank Fusion (RRF)"
|
||||
type: concept
|
||||
tags: [search, ranking, fusion, algorithm]
|
||||
sources: [semantic-memory-search]
|
||||
last_updated: 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
|
||||
- [[Hybrid Search]] — RRF 是混合搜索的标准融合算法
|
||||
- [[semantic-memory-search]] — memsearch 使用 RRF 融合向量和 BM25 结果
|
||||
- [[Knowledge-Base-RAG]] — RRF 用于提升知识库检索质量
|
||||
---
|
||||
title: "Reciprocal Rank Fusion (RRF)"
|
||||
type: concept
|
||||
tags: [search, ranking, fusion, algorithm]
|
||||
sources: [semantic-memory-search]
|
||||
last_updated: 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
|
||||
- [[Hybrid Search]] — RRF 是混合搜索的标准融合算法
|
||||
- [[semantic-memory-search]] — memsearch 使用 RRF 融合向量和 BM25 结果
|
||||
- [[Knowledge-Base-RAG]] — RRF 用于提升知识库检索质量
|
||||
|
||||
Reference in New Issue
Block a user