透過 Bespoke-Minicheck 減少幻覺

2024年9月18日

Bespoke-Minicheck 是由 Bespoke Labs 開發的全新基於事實的真實性檢查模型,現已在 Ollama 上提供。它可以事實查核其他模型產生的回應,以偵測並減少幻覺。

運作方式

Bespoke-Minicheck 的運作方式是接收事實資訊片段(即文件)和產生的輸出(即主張),並根據文件驗證主張。如果文件支持該主張,模型將輸出 Yes。否則,它將輸出 No

illustration of how Bespoke-Minicheck works

RAG 使用案例

當建構檢索增強生成 (RAG) 應用程式時,Bespoke-Minicheck 特別強大,因為它可用於確保回應是基於提供給 LLM 的檢索上下文。這可以作為後處理步驟來偵測幻覺。

illustration of Bespoke-Minicheck used for Retrieval Augmented Generation (RAG) applications

關於如何在 RAG 應用程式中使用 Ollama 的 Bespoke-Minicheck 範例,請參閱 GitHub 上的 RAG 範例

開始使用

首先,下載並執行模型

ollama run bespoke-minicheck

接下來,按照以下方式撰寫提示,並提供來源文件和主張

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

Yes

然而,當文件不支持該主張時,模型將回應 No

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

關於如何使用 Bespoke-Minicheck 對照來源資訊進行事實查核的範例,請參閱 GitHub 上的事實查核範例

範例

閱讀更多