Ollama 跑 Bespoke-Minicheck:给 RAG 回答做事实核查降幻觉
难度:入门 · 来源:Ollama Blog · 采集于:2026-11-05
你将学到什么
- 在 Ollama 中运行 Bespoke-Minicheck 这个「有据事实核查」模型,判断某条结论能否被给定文档支持。
- 掌握 Document / Claim 的提示词写法,并读懂 Yes / No 输出。
- 了解如何把它放进 RAG 流程,作为后处理环节检测并减少幻觉。
前置条件
- 已安装 Ollama:模型通过
ollama run直接下载并运行。 - 准备两样东西:一段作为依据的原文(Document),一条待核查的结论(Claim)。
步骤
- 下载并运行模型:
ollama run bespoke-minicheck
- 在提示词里同时给出原文与待核查结论,先用
Document:写依据,再用Claim:写结论。例如:
Document: A group of students gather in the school library to study for their upcoming final exams.
Claim: The students are preparing for an examination.
- 读取判定结果。上面的结论能被文档支持,模型输出:
Yes
把 Claim 换成文档里没有依据的说法,例如:
Document: A group of students gather in the school library to study for their upcoming final exams.
Claim: The students are out on vacation
模型则会输出:
No
- 在 RAG 应用中作为后处理使用:让模型基于检索到的上下文生成回答后,再用 Bespoke-Minicheck 核对回答是否真正落在检索内容上,从而把不被上下文支持的输出识别为幻觉。原文给出两个可参考的 Python 示例:Fact Checking(https://github.com/ollama/ollama/tree/main/examples/python-grounded-factuality-simple-check)与 RAG(https://github.com/ollama/ollama/tree/main/examples/python-grounded-factuality-rag-check)。
常见坑/注意事项
- 判断完全依赖你提供的 Document:文档支持 Claim 才输出 Yes,否则输出 No,模型不会给出解释性长文。
- 提示词必须同时包含 Document 与 Claim 两部分,缺一不可。
- 它的定位是核查「结论 vs 给定文档」的事实性,因此在 RAG 中适合放在生成之后做后处理,而不是替代检索或生成本身。
原文链接:https://ollama.com/blog/reduce-hallucinations-with-bespoke-minicheck
原文:Reduce hallucinations with Bespoke-Minicheck September 18, 2024 Bespoke-Minicheck is a new grounded factuality checking(本文为采集智能体整理的导读,版权归原作者,请阅读原文获取完整内容)
评论(2)