RAG 召回率

🤖 RAG Retrieval Recall Calculator

Compute retrieval recall from the number of relevant documents and the number actually retrieved, to measure the coverage of your RAG retriever.

📐 计算公式 / 原理
召回率 = 检索到的相关文档数 / 相关文档总数 × 100%;精确率 = 检索到的相关文档数 / 检索总数 × 100%;F1 = 2·P·R/(P + R);命中率 = 检索到 ≥1 篇相关 ? 100% : 0
RAG 的检索质量直接决定生成上限:召回率不足会漏掉关键证据导致幻觉,精确率不足则把噪声塞进上下文稀释注意力。命中率(Recall@k 的特例)常用于快速判断 top-k 是否够用。

📐 计算公式与说明

Recall = 检索到的相关 / 所有相关
Precision = 检索到的相关 / 检索总数

RAG 系统需权衡召回率与精确率。

📚 深度解析:RAG 召回率

💡 常见使用场景

召回评估
知识库某问题共有 10 篇相关文档,检索返回 top-20 中命中 8 篇 → 召回率=80%。若只命中 3 篇,则生成极易遗漏要点,需扩大召回或改进切分。

❓ 常见问题(FAQ)

召回率高就够了吗?
不够。召回高只保证'找得全',还需重排把最相关置顶、控制噪声,否则无关文档挤占上下文反而干扰生成。
怎么提升 RAG 召回?
优化文档切分粒度、用混合检索(向量+BM25)、加元数据过滤与重排;并定期用标准问答集测召回率指导迭代。

Formula & Standard References

Item Formula / Note Source / Standard
Recall recall is the retrieved relevant documents over all relevant documents TREC evaluation, trec_eval
Retrieval augmentation relevant passages are retrieved first then supplied to the generator as context Lewis et al. 2020, NeurIPS RAG
Ranking metrics recall measures coverage while precision and mean reciprocal rank measure ordering TREC evaluation, trec_eval