Papers › SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large...

SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models

15 Mar 2023arXiv:2303.08896archive 2025-07-28

Potsawee Manakul, Adian Liusie, Mark J. F. Gales

Generative Large Language Models (LLMs) such as GPT-3 are capable of generating highly fluent responses to a wide variety of user prompts. However, LLMs are known to hallucinate facts and make non-factual statements which can undermine trust in their output. Existing fact-checking approaches either require access to the output probability distribution (which may not be available for systems such as ChatGPT) or external databases that are interfaced via separate, often complex, modules. In this work, we propose "SelfCheckGPT", a simple sampling-based approach that can be used to fact-check the responses of black-box models in a zero-resource fashion, i.e. without an external database. SelfCheckGPT leverages the simple idea that if an LLM has knowledge of a given concept, sampled responses are likely to be similar and contain consistent facts. However, for hallucinated facts, stochastically sampled responses are likely to diverge and contradict one another. We investigate this approach by using GPT-3 to generate passages about individuals from the WikiBio dataset, and manually annotate the factuality of the generated passages. We demonstrate that SelfCheckGPT can: i) detect non-factual and factual sentences; and ii) rank passages in terms of factuality. We compare our approach to several baselines and show that our approach has considerably higher AUC-PR scores in sentence-level hallucination detection and higher correlation scores in passage-level factuality assessment compared to grey-box methods.

PaperPDFCodeCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 11 code samples harvested from 1 repository linked to this paper: 6 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 3 honoured, 0 violated, 0 with no contract checked; 3 where Syntology's instrument failed) · 5 unverified. Where Syntology's instrument failed: 1 where our contract draft was wrong; 2 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 11 samples from 1 repository, 6 ran (3 with no instrument failure; 3 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

potsawee/selfcheckgpt officialmentioned in papermentioned on GitHubpytorchSyntology: 11 samples, 6 ran (3 instrument-failed) · 5 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested: 6 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 3 honoured, 0 violated, 0 with no contract checked; 3 where Syntology's instrument failed) · 5 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

3ran · honoured contract
1ran · our draft was wrong
2ran; the contract check could not run
5unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from potsawee/selfcheckgpt. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

potsawee/selfcheckgpt official repository 11 samples, 6 ran (3 instrument-failed) · 5 unverified
method_bayes_with_alpha selfcheckgpt/modeling_selfcheck.py ran · our draft was wrong fingerprinted MIT (permissive) · 48303d9614eef740 · report fixture: signature prob:ndarray/1/float, u_score:float/0/float, prob_s:list/1/ndarray, u_score_s:list/1/float, num_samples:int/0/int, beta1:float/0/float, beta2:float/0/float · returned float · level recorded 2026-09-22
method_simple_counting selfcheckgpt/modeling_selfcheck.py ran; the contract check could not run (RAISES) MIT (permissive) · a327c65c24bd1adc · report fixture: signature prob:ndarray/1/float, u_score:float/0/float, prob_s:ndarray/2/float, u_score_s:ndarray/1/float, num_samples:int/0/int, AT:float/0/float · returned float · level recorded 2026-09-22
method_vanilla_bayes selfcheckgpt/modeling_selfcheck.py ran; the contract check could not run (RAISES) fingerprinted MIT (permissive) · fd8b74b87c682b53 · report fixture: signature prob:ndarray/1/float, u_score:float/0/float, prob_s:ndarray/2/float, u_score_s:ndarray/1/float, num_samples:int/0/int, beta1:float/0/float, beta2:float/0/float, AT:float/0/float · returned float · level recorded 2026-09-22
prepare_distractor_input selfcheckgpt/modeling_selfcheck.py ran · honoured contract MIT (permissive) · 91aa51bfaaa9af1c · report fixture: signature t5_tokenizer:callable/0/?, context:str/0/str, question:str/0/str, answer:str/0/str, device:device/0/?, separator:str/0/str · returned Tensor · level recorded 2026-09-22
prepare_qa_input selfcheckgpt/modeling_selfcheck.py ran · honoured contract MIT (permissive) · 0f6a58be9f56b183 · report fixture: signature t5_tokenizer:callable/0/?, context:str/0/str, device:device/0/? · returned Tensor · level recorded 2026-09-22
question_generation_sentence_level selfcheckgpt/modeling_selfcheck.py ran · honoured contract MIT (permissive) · 8d22955c5597692a · report fixture: signature g1_model:callable/0/?, g1_tokenizer:callable/0/?, g2_model:callable/0/?, g2_tokenizer:callable/0/?, sentence:str/0/str, passage:str/0/str, num_questions_per_sent:int/0/int, device:str/0/str · returned list · level recorded 2026-09-22
MQAGConfig selfcheckgpt/modeling_selfcheck.py unverified MIT (permissive) · 6f5cf383ae436397 · report
SelfCheckMQAG selfcheckgpt/modeling_selfcheck.py unverified MIT (permissive) · e976fc7d0ba93b93 · report
answerability_scoring selfcheckgpt/modeling_selfcheck.py unverified MIT (permissive) · 1cd98422f1661366 · report
answering selfcheckgpt/modeling_selfcheck.py unverified MIT (permissive) · 2374d4bcf09066d3 · report
prepare_answering_input selfcheckgpt/modeling_selfcheck.py unverified MIT (permissive) · b38e4eaa9c590ae7 · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for SelfCheckGPT (graph method: SelfCheckGPT). 11 bricks; individually on a fixture: 6 ran (of which 0 constructed an object rather than computing a result; 3 with no instrument failure: 3 honoured, 0 violated, 0 with no contract checked; 3 where Syntology's instrument failed) · 5 unverified. The assembly has not been run end-to-end.

  1. SelfCheckMQAG entry · level 0 · unverified · e976fc7d0ba93b93
  2. MQAGConfig helper · level 0 · unverified · 6f5cf383ae436397
  3. answerability_scoring helper · level 0 · unverified · 1cd98422f1661366
  4. answering helper · level 0 · unverified · 2374d4bcf09066d3
  5. method_bayes_with_alpha helper · level 1 · ran · our draft was wrong · 48303d9614eef740
  6. method_simple_counting helper · level 1 · ran; the contract check could not run (RAISES) · a327c65c24bd1adc
  7. method_vanilla_bayes helper · level 1 · ran; the contract check could not run (RAISES) · fd8b74b87c682b53
  8. question_generation_sentence_level helper · level 1 · ran · honoured contract · 8d22955c5597692a
  9. prepare_answering_input helper · level 0 · unverified · b38e4eaa9c590ae7
  10. prepare_distractor_input helper · level 1 · ran · honoured contract · 91aa51bfaaa9af1c
  11. prepare_qa_input helper · level 1 · ran · honoured contract · 0f6a58be9f56b183

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2303.08896") returns these assemblies with each brick's role and wiring (how to connect).

Tasks

Fact CheckingHallucinationSentence

Datasets

Introduced by this paper, per the archive.

WikiBio GPT-3 Hallucination Dataset

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDropoutGPT-3Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections