2303.08896v3
Model: gemini-2.0-flash
## SELFCHECKGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models
Potsawee Manakul, Adian Liusie, Mark J. F. Gales
ALTA Institute, Department of Engineering, University of Cambridge pm574@cam.ac.uk, al826@cam.ac.uk, mjfg@eng.cam.ac.uk
## Abstract
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. 1
## 1 Introduction
Large Language Models (LLMs) such as GPT-3 (Brown et al., 2020) and PaLM (Chowdhery et al., 2022) are capable of generating fluent and realistic responses to a variety of user prompts. They have been used in many applications such as automatic
1 Code and dataset can be found on the project page at https://github.com/potsawee/selfcheckgpt .
Figure 1: SelfCheckGPT with Prompt. Each LLM-generated sentence is compared against stochastically generated responses with no external database. A comparison method can be, for example, through LLM prompting as shown above.
<details>
<summary>Image 1 Details</summary>

### Visual Description
## Diagram: SelfCheckGPT Score Calculation
### Overview
The image is a diagram illustrating how the SelfCheckGPT score is calculated. It shows the process of generating responses using a Large Language Model (LLM), evaluating a passage at the sentence level, and determining how often the sentence is supported by the generated samples.
### Components/Axes
* **Top-Left:** "LLM e.g. GPT-3" (orange box) - Represents the Large Language Model used to generate responses.
* **Top-Center:** "Stochastically-generated responses" (light blue box) - Represents the set of responses generated by the LLM.
* "sample1": Contains a truncated text about Giuseppe Mariani as an Italian painter, sculptor, and engraver.
* "sampleN": Contains a truncated text about Giuseppe Mariani as an Italian violinist, pedagogue, and composer.
* **Left:** "Giuseppe Mariani was an Italian professional footballer who played as a forward. He was born in Milan, Italy. He died in Rome, Italy. [truncated]" (dashed box) - Represents the passage being evaluated. The phrase "born in Milan, Italy" is highlighted in blue.
* "LLM's passage to be evaluated at sentence-level" - Label below the passage.
* **Center:** "LLM" (orange box) - Represents the LLM being used to evaluate the generated samples.
* "Does {sample1} support {sentence}?" and "Does {sampleN} support {sentence}?" - Questions posed to the LLM.
* "Answer: [Yes/No]" - Possible answers from the LLM.
* **Bottom:** "SelfCheckGPT Score (e.g. how often is the sentence supported by the samples)" - Represents the final score calculated based on the LLM's responses.
* **Arrows:** Arrows indicate the flow of information from the LLM to the stochastically generated responses, then to the LLM evaluation, and finally to the SelfCheckGPT score.
### Detailed Analysis
* The diagram starts with an LLM (e.g., GPT-3) that generates "N samples" of responses.
* These responses are represented by "sample1" to "sampleN," each containing a short, truncated text.
* A passage about Giuseppe Mariani is evaluated at the sentence level. The sentence "He was born in Milan, Italy" is highlighted.
* The LLM then evaluates whether each sample supports the sentence from the passage.
* The LLM provides a "Yes" or "No" answer for each sample.
* The SelfCheckGPT score is calculated based on how often the sentence is supported by the samples.
### Key Observations
* The diagram illustrates a process for evaluating the consistency and reliability of LLM-generated text.
* The SelfCheckGPT score provides a quantitative measure of how well the LLM's generated responses align with a given passage.
* The highlighting of "born in Milan, Italy" suggests that this specific sentence is the focus of the evaluation.
### Interpretation
The diagram depicts a method for assessing the factual accuracy and consistency of LLM-generated content. By generating multiple responses and then evaluating whether those responses support a specific sentence from a reference passage, the SelfCheckGPT score provides an indication of the LLM's reliability. This process is valuable for identifying potential biases, hallucinations, or inconsistencies in LLM outputs, ultimately contributing to the development of more trustworthy and accurate AI systems. The highlighting of a specific sentence indicates that the evaluation is performed at a granular level, allowing for a more precise assessment of the LLM's performance.
</details>
tools to draft reports, virtual assistants and summarization systems. Despite the convincing and realistic nature of LLM-generated texts, a growing concern with LLMs is their tendency to hallucinate facts. It has been widely observed that models can confidently generate fictitious information, and worryingly there are few, if any, existing approaches to suitably identify LLM hallucinations.
A possible approach of hallucination detection is to leverage existing intrinsic uncertainty metrics to determine the parts of the output sequence that the system is least certain of (Yuan et al., 2021; Fu et al., 2023). However, uncertainty metrics such as token probability or entropy require access to token-level probability distributions, information which may not be available to users for example when systems are accessed through limited external APIs. An alternate approach is to leverage fact-verification approaches, where evidence is retrieved from an external database to assess the veracity of a claim (Thorne et al., 2018; Guo et al., 2022). However, facts can only be assessed relative to the knowledge present in the database. Addition-
ally, hallucinations are observed over a wide range of tasks beyond pure fact verification (Kryscinski et al., 2020; Maynez et al., 2020).
In this paper, we propose SelfCheckGPT, a sampling-based approach that can detect whether responses generated by LLMs are hallucinated or factual. To the best of our knowledge, SelfCheckGPT is the first work to analyze model hallucination of general LLM responses, and is the first zero-resource hallucination detection solution that can be applied to black-box systems. The motivating idea of SelfCheckGPT is that when an LLM has been trained on a given concept, the sampled responses are likely to be similar and contain consistent facts. However, for hallucinated facts, stochastically sampled responses are likely to diverge and may contradict one another. By sampling multiple responses from an LLM, one can measure information consistency between the different responses and determine if statements are factual or hallucinated. Since SelfCheckGPT only leverages sampled responses, it has the added benefit that it can be used for black-box models, and it requires no external database. Five variants of SelfCheckGPT for measuring informational consistency are considered: BERTScore, question-answering, n -gram, NLI, and LLM prompting. Through analysis of annotated articles generated by GPT-3, we show that SelfCheckGPT is a highly effective hallucination detection method that can even outperform greybox methods, and serves as a strong first baseline for an increasingly important problem of LLMs.
## 2 Background and Related Work
## 2.1 Hallucination of Large Language Models
Hallucination has been studied in text generation tasks, including summarization (Huang et al., 2021) and dialogue generation (Shuster et al., 2021), as well as in a variety of other natural language generation tasks (Ji et al., 2023). Self-consistency decoding has shown to improve chain-of-thought prompting performance on complex reasoning tasks (Wang et al., 2023). Further, Liu et al. (2022) introduce a hallucination detection dataset, however, texts are obtained by perturbing factual texts and thus may not reflect true LLM hallucination.
Recently, Azaria and Mitchell (2023) trained a multi-layer perception classifier where an LLM's hidden representations are used as inputs to predict the truthfulness of a sentence. However, this approach is a white-box approach that uses the internal states of the LLM, which may not be available through API calls, and requires labelled data for supervised training. Another recent approach is self-evaluation (Kadavath et al., 2022), where an LLM is prompted to evaluate its previous prediction, e.g., to predict the probability that its generated response/answer is true.
## 2.2 Sequence Level Uncertainty Estimation
Token probabilities have been used as an indication of model certainty. For example, OpenAI's GPT-3 web interface allows users to display token probabilities (as shown in Figure 2), and further uncertainty estimation approaches based on aleatoric and epistemic uncertainty have been studied for autoregressive generation (Xiao and Wang, 2021; Malinin and Gales, 2021). Additionally, conditional language model scores have been used to evaluate properties of texts (Yuan et al., 2021; Fu et al., 2023). Recently, semantic uncertainty has been proposed to address uncertainty in free-form generation tasks where probabilities are attached to concepts instead of tokens (Kuhn et al., 2023).
Figure 2: Example of OpenAI's GPT-3 web interface with output token-level probabilities displayed.
<details>
<summary>Image 2 Details</summary>

### Visual Description
## Screenshot: OpenAI Playground with Lenny Randle Text
### Overview
The image is a screenshot of the OpenAI Playground interface, featuring a text passage about Lenny Randle, a former baseball player. The text is highlighted with different colors, and a pop-up window displays probability scores associated with different terms. The right side of the interface shows model settings and parameters.
### Components/Axes
* **Header:** Contains "Playground", "Load a preset...", "Save", "View code", and "Share".
* **Main Text Area:** Displays the text passage about Lenny Randle.
* **Pop-up Window:** Shows probability scores for different terms.
* **Right Sidebar:** Contains model selection and parameter settings.
* **Footer:** Contains "Looking for ChatGPT? Try it now", "Submit", and other UI elements.
### Detailed Analysis or Content Details
**1. Text Passage:**
> This is a passage from Wikipedia about lenny randle:
>
> Lenny Randle (born May 3, 1949) is an American former professional baseball player and manager. He played in Major League Baseball as an infielder for the Texas Rangers, Seattle Mariners, New York Mets, and Chicago Cubs from 1972 to 1982. He also played in other leagues.
>
> Randle was an All-Star in 1977 while with the Texas Rangers. He was known as a versatile fielder, but an inconsistent hitter. During his 11-year career, Randle batted .281. He scored, 594 hits, 151 doubles, 54 triples, 39 home runs and 282 runs batted in. He stole 145 bases.
**2. Highlighted Text:**
* The text passage is highlighted with different colors. The specific meaning of each color is not explicitly stated, but it is likely related to the probability scores shown in the pop-up window.
* The words "Lenny Randle (born May 3, 1949)" are highlighted in yellow.
* The words "Texas Rangers" are highlighted in green.
* The number "151" is highlighted in red.
* The number "282" is highlighted in red.
**3. Pop-up Window (Probability Scores):**
The pop-up window displays the following probability scores:
* Texas = 62.78%
* Washington = 30.45%
* Seattle = 6.48%
* California = 0.09%
* Rangers = 0.08%
* Total: -0.47 logprob on 1 tokens
(99.88% probability covered in top 5 logits)
**4. Right Sidebar (Model Settings):**
* **Model:** text-davinci-003
* **Temperature:** 0.7
* **Maximum length:** 256
* **Top P:** 1
* **Frequency penalty:** 0
* **Presence penalty:** 0
**5. Footer:**
* "Looking for ChatGPT? Try it now"
* "Submit" button
* Other UI elements (likely related to text editing or manipulation)
* Value "147"
### Key Observations
* The OpenAI Playground is being used to analyze a text passage about Lenny Randle.
* The pop-up window shows the probability scores associated with different terms, likely based on the model's understanding of the text.
* The highlighting of the text passage may be related to the probability scores, but this is not explicitly stated.
* The model being used is "text-davinci-003".
* The probability of "Texas" is significantly higher than other locations, at 62.78%.
### Interpretation
The image demonstrates the use of the OpenAI Playground for text analysis. The model is being used to assess the probability of different terms appearing in the context of the given text passage. The high probability score for "Texas" suggests that the model associates Lenny Randle strongly with the state of Texas, likely due to his time playing for the Texas Rangers. The highlighting of specific words and numbers in the text passage likely serves to draw attention to key information or to indicate the model's confidence in its predictions. The presence of the "Looking for ChatGPT?" prompt suggests the user might be exploring alternative models or functionalities within the OpenAI ecosystem.
</details>
## 2.3 Fact Verification
Existing fact-verification approaches follow a multi-stage pipeline of claim detection, evidence retrieval and verdict prediction (Guo et al., 2022; Zhong et al., 2020). Such methods, however, require access to external databases and can have considerable inference costs.
## 3 Grey-Box Factuality Assessment
This section will introduce methods that can be used to determine the factuality of LLM responses in a zero-resource setting when one has full access
to output distributions. 2 We will use 'factual' to define when statements are grounded in valid information, i.e. when hallucinations are avoided, and 'zero-resource' when no external database is used.
## 3.1 Uncertainty-based Assessment
To understand how the factuality of a generated response can be determined in a zero-resource setting, we consider LLM pre-training. During pretraining, the model is trained with next-word prediction over massive corpora of textual data. This gives the model a strong understanding of language (Jawahar et al., 2019; Raffel et al., 2020), powerful contextual reasoning (Zhang et al., 2020), as well as world knowledge (Liusie et al., 2023). Consider the input " Lionel Messi is a \_ ". Since Messi is a world-famous athlete who may have appeared multiple times in pre-training, the LLM is likely to know who Messi is. Therefore given the context, the token " footballer " may be assigned a high probability while other professions such as " carpenter " may be considered improbable. However, for a different input such as " John Smith is a \_ ", the system will be unsure of the continuation which may result in a flat probability distribution. During inference, this is likely to lead to a non-factual word being generated.
This insight allows us to understand the connection between uncertainty metrics and factuality. Factual sentences are likely to contain tokens with higher likelihood and lower entropy, while hallucinations are likely to come from positions with flat probability distributions with high uncertainty.
## Token-level Probability
Given the LLM's response R , let i denote the i -th sentence in R , j denote the j -th token in the i -th sentence, J is the number of tokens in the sentence, and p ij be the probability of the word generated by the LLM at the j -th token of the i -th sentence. Two probability metrics are used:
$$A v g ( - \log p ) = - { \frac { 1 } { J } } \sum _ { j } \log p _ { i j }$$
$$M a x ( - \log p ) = \max _ { j } \, ( - \log p _ { i j } )$$
$$)$$
Max ( -log p ) measures the sentence's likelihood by assessing the least likely token in the sentence.
2 Alternate white-box approaches such as that of Azaria and Mitchell (2023) require access to full internal states, and is less practical and so not considered in this work.
## Entropy
The entropy of the output distribution is:
$$\mathcal { H } _ { i j } = - \sum _ { \tilde { w } \in \mathcal { W } } p _ { i j } ( \tilde { w } ) \log p _ { i j } ( \tilde { w } )$$
where p ij ( ˜ w ) is the probability of the word ˜ w being generated at the j -th token of the i -th sentence, and W is the set of all possible words in the vocabulary. Similar to the probability-based metrics, two entropy-based metrics are used:
$$A v g ( \mathcal { H } ) = \frac { 1 } { J } \sum _ { j } \mathcal { H } _ { i j } ; \quad M a x ( \mathcal { H } ) = \max _ { j } \left ( \mathcal { H } _ { i j } \right )$$
## 4 Black-Box Factuality Assessment
A drawback of grey-box methods is that they require output token-level probabilities. Though this may seem a reasonable requirement, for massive LLMs only available through limited API calls, such token-level information may not be available (such as with ChatGPT). Therefore, we consider black-box approaches which remain applicable even when only text-based responses are available.
## Proxy LLMs
A simple approach to approximate the grey-box approaches is by using a proxy LLM, i.e. another LLM that we have full access to, such as LLaMA (Touvron et al., 2023). A proxy LLM can be used to approximate the output token-level probabilities of the black-box LLM generating the text. In the next section, we propose SelfCheckGPT, which is also a black-box approach.
## 5 SelfCheckGPT
SelfCheckGPT is our proposed black-box zeroresource hallucination detection scheme, which operates by comparing multiple sampled responses and measuring consistency.
Notation : Let R refer to an LLM response drawn from a given user query. SelfCheckGPT draws a further N stochastic LLM response samples { S 1 , S 2 , ..., S n , ..., S N } using the same query, and then measures the consistency between the response and the stochastic samples. We design SelfCheckGPT to predict the hallucination score of the i -th sentence, S ( i ) , such that S ( i ) ∈ [0 . 0 , 1 . 0] , where S ( i ) → 0 . 0 if the i -th sentence is grounded in valid information and S ( i ) → 1 . 0 if the i -th sen-
tence is hallucinated. 3 The following subsections will describe each of the SelfCheckGPT variants.
## 5.1 SelfCheckGPT with BERTScore
Let B ( ., . ) denote the BERTScore between two sentences. SelfCheckGPT with BERTScore finds the average BERTScore of the i -th sentence with the most similar sentence from each drawn sample:
$$\mathcal { S } _ { B E R T } ( i ) = 1 - \frac { 1 } { N } \sum _ { n = 1 } ^ { N } \max _ { k } \left ( \mathcal { B } ( r _ { i } , s _ { k } ^ { n } ) \right ) \quad ( 1 ) \quad \text {in} \ \ A$$
where r i represents the i -th sentence in R and s n k represents the k -th sentence in the n -th sample S n . This way if the information in a sentence appears in many drawn samples, one may assume that the information is factual, whereas if the statement appears in no other sample, it is likely a hallucination. In this work, RoBERTa-Large (Liu et al., 2019) is used as the backbone of BERTScore.
## 5.2 SelfCheckGPT with Question Answering
We also consider using the automatic multiplechoice question answering generation (MQAG) framework (Manakul et al., 2023) to measure consistency for SelfCheckGPT. MQAG assesses consistency by generating multiple-choice questions over the main generated response, which an independent answering system can attempt to answer while conditioned on the other sampled responses. If questions on consistent information are queried, the answering system is expected to predict similar answers. MQAG consists of two stages: question generation G and question answering A . For the sentence r i in the response R , we draw questions q and options o :
$$q , \mathbf o \sim P _ { \mathbb { G } } ( q , \mathbf o | r _ { i } , R ) \quad ( 2 ) \quad i - t$$
The answering stage A selects the answers:
$$a _ { R } = \underset { k } { \arg \max } \left [ P _ { A } ( o _ { k } | q , R , { o } ) \right ] \quad ( 3 )$$
$$\begin{array} { r l r } & { a _ { S ^ { n } } = \underset { k } { \arg \max } \left [ P _ { A } ( o _ { k } | q , S ^ { n } , { \mathbf o } ) \right ] } & { ( 4 ) } & { 5 . 4 } \end{array}$$
We compare whether a R is equal to a S n for each sample in { S 1 , ..., S N } , yielding #matches N m and #not-matches N n . A simple inconsistency score for the i -th sentence and question q based on the match/not-match counts is defined: S QA ( i, q ) =
3 With the exception of SelfCheckGPT with n -gram as the score of the n -gram language model is not bounded.
N n N m + N n . To take into account the answerability of generated questions, we show in Appendix B that we can modify the inconsistency score by applying soft-counting, resulting in:
$$\mathcal { S } _ { Q A } ( i , q ) = \frac { \gamma _ { 2 } ^ { N _ { n } ^ { \prime } } } { \gamma _ { 1 } ^ { N _ { m } ^ { \prime } } + \gamma _ { 2 } ^ { N _ { n } ^ { \prime } } } \quad ( 5 )$$
where N ′ m = the effective match count, N ′ n = the effective mismatch count, with γ 1 and γ 2 defined in Appendix B.1. Ultimately, SelfCheckGPT with QA is the average of inconsistency scores across q ,
$$\mathcal { S } _ { Q A } ( i ) = \mathbb { E } _ { q } \left [ \mathcal { S } _ { Q A } ( i , q ) \right ] \quad ( 6 )$$
## 5.3 SelfCheckGPT with n-gram
Given samples { S 1 , ..., S N } generated by an LLM, one can use the samples to create a new language model that approximates the LLM. In the limit as N gets sufficiently large, the new language model will converge to the LLM that generated the responses. We can therefore approximate the LLM's token probabilities using the new language model.
In practice, due to time and/or cost constraints, there can only be a limited number of samples N . Consequently, we train a simple n -gram model using the samples { S 1 , ..., S N } as well as the main response R (which is assessed), where we note that including R can be considered as a smoothing method where the count of each token in R is increased by 1. We then compute the average of the log-probabilities of the sentence in response R ,
$$\mathcal { S } _ { n \text {-gram} } ^ { A v g } ( i ) = - \frac { 1 } { J } \sum _ { j } \log \tilde { p } _ { i j } \quad ( 7 )$$
where ˜ p ij is the probability (of the j -th token of the i -th sentence) computed using the n -gram model. Similar to the grey-box approach, we can also use the maximum of the negative log probabilities,
$$\mathcal { S } _ { n \text {-gram} } ^ { M a x } ( i ) = \max _ { j } \left ( - \log \tilde { p } _ { i j } \right ) \quad ( 8 )$$
## 5.4 SelfCheckGPT with NLI
Natural Language Inference (NLI) determines whether a hypothesis follows a premise, classified into either entailment/neutral/contradiction. NLI measures have been used to measure faithfulness in summarization, where Maynez et al. (2020) use a textual entailment classifier trained on MNLI (Williams et al., 2018) to determine if a summary contradicts a context or not. Inspired by NLI-based
summary assessment, we consider using the NLI contradiction score as a SelfCheckGPT score.
For SelfCheck-NLI, we use DeBERTa-v3-large (He et al., 2023) fine-tuned to MNLI as the NLI model. The input for NLI classifiers is typically the premise concatenated to the hypothesis , which for our methodology is the sampled passage S n concatenated to the sentence to be assessed r i . Only the logits associated with the 'entailment' and 'contradiction' classes are considered,
<!-- formula-not-decoded -->
where z e and z c are the logits of the 'entailment' and 'contradiction' classes, respectively. This normalization ignores the neutral class and ensures that the probability is bounded between 0.0 and 1.0. The SelfCheckGPT with NLI score for each sample S n is then defined as,
$$\mathcal { S } _ { N L I } ( i ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } P ( \text {contradict} | r _ { i } , S ^ { n } ) \quad ( 1 0 )$$
## 5.5 SelfCheckGPT with Prompt
LLMs have recently been shown to be effective in assessing information consistency between a document and its summary in zero-shot settings (Luo et al., 2023). Thus, we query an LLM to assess whether the i -th sentence is supported by sample S n (as the context) using the following prompt.
------------------------------------------------
```
Context: {}
Sentence: {}
```
Is the sentence supported by the context above? Answer Yes or No:
------------------------------------------------
Initial investigation showed that GPT-3 (textdavinci-003) will output either Yes or No 98% of the time, while any remaining outputs can be set to N/A . The output from prompting when comparing the i -th sentence against sample S n is converted to score x n i through the mapping { Yes : 0.0, No : 1.0, N/A : 0.5}. The final inconsistency score is then calculated as:
$$\mathcal { S } _ { \text {Prompt} } ( i ) = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } x _ { i } ^ { n } \quad \quad ( 1 1 ) \quad f r o m b e l$$
SelfCheckGPT-Prompt is illustrated in Figure 1. Note that our initial investigations found that less capable models such as GPT-3 (text-curie-001) or LLaMA failed to effectively perform consistency assessment via such prompting.
## 6 Data and Annotation
As, currently, there are no standard hallucination detection datasets available, we evaluate our hallucination detection approaches by 1) generating synthetic Wikipedia articles using GPT-3 on the individuals/concepts from the WikiBio dataset (Lebret et al., 2016); 2) manually annotating the factuality of the passage at a sentence level; 3) evaluating the system's ability to detect hallucinations.
WikiBio is a dataset where each input contains the first paragraph (along with tabular information) of Wikipedia articles of a specific concept. We rank the WikiBio test set in terms of paragraph length and randomly sample 238 articles from the top 20% of longest articles (to ensure no very obscure concept is selected). GPT-3 (text-davinci-003) is then used to generate Wikipedia articles on a concept, using the prompt " This is a Wikipedia passage about {concept} :". Table 1 provides the statistics of GPT-3 generated passages.
Table 1: The statistics of WikiBio GPT-3 dataset where the number of tokens is based on the OpenAI GPT-2 tokenizer.
| #Passages | #Sentences | #Tokens/passage |
|-------------|--------------|-------------------|
| 238 | 1908 | 184.7 ± 36.9 |
We then annotate the sentences of the generated passages using the guidelines shown in Figure 3 such that each sentence is classified as either:
- Major Inaccurate (Non-Factual, 1 ): The sentence is entirely hallucinated, i.e. the sentence is unrelated to the topic.
- Minor Inaccurate (Non-Factual, 0.5 ): The sentence consists of some non-factual information, but the sentence is related to the topic.
- Accurate (Factual, 0 ): The information presented in the sentence is accurate.
Of the 1908 annotated sentences, 761 (39.9%) of the sentences were labelled major-inaccurate, 631 (33.1%) minor-inaccurate, and 516 (27.0%) accurate. 201 sentences in the dataset had annotations from two different annotators. To obtain a single label for this subset, if both annotators agree, then the agreed label is used. However, if there is disagreement, then the worse-case label is selected (e.g., {minor inaccurate, major inaccurate} is mapped to major inaccurate). The inter-annotator agreement, as measured by Cohen's κ (Cohen, 1960), has κ
Figure 3: Flowchart of our annotation process
<details>
<summary>Image 3 Details</summary>

### Visual Description
## Flowchart: Accuracy Assessment
### Overview
The image is a flowchart illustrating a decision process for assessing the accuracy of information. It starts with a check for relevance to the context, then checks for factual accuracy, leading to classifications of "Accurate," "Minor Inaccurate," or "Major Inaccurate."
### Components/Axes
* **Nodes:** The flowchart consists of diamond-shaped decision nodes and rectangular outcome nodes.
* **Decision Nodes:**
* "Is it related to the context?"
* "Is it Factual? e.g. using Wikipedia / Google Search"
* **Outcome Nodes:**
* "Accurate (Factual 0)"
* "Major Inaccurate (Non-factual 1)"
* "Minor Inaccurate (Non-factual 0.5)"
* **Flow Direction:** The flow is top-to-bottom, with branches based on "Yes" or "No" answers to the decision questions.
### Detailed Analysis or ### Content Details
1. **Start:** The flowchart begins with the question "Is it related to the context?"
* If the answer is "No," the outcome is "Major Inaccurate (Non-factual 1)."
* If the answer is "Yes," the flow proceeds to the next question.
2. **Second Question:** "Is it Factual? e.g. using Wikipedia / Google Search"
* If the answer is "No," the outcome is "Minor Inaccurate (Non-factual 0.5)."
* If the answer is "Yes," the outcome is "Accurate (Factual 0)."
### Key Observations
* The flowchart provides a structured method for categorizing information based on relevance and factual accuracy.
* The outcomes are assigned numerical values: 0 for accurate, 0.5 for minor inaccuracy, and 1 for major inaccuracy.
### Interpretation
The flowchart outlines a simple algorithm for assessing the quality of information. It prioritizes relevance before factual accuracy, suggesting that even factually correct information can be considered "Major Inaccurate" if it is not relevant to the context. The use of numerical values for the outcomes implies a potential for quantitative analysis or scoring of information quality. The reference to Wikipedia and Google Search suggests a practical approach to fact-checking.
</details>
values of 0.595 and 0.748, indicating moderate and substantial agreement (Viera et al., 2005) for the 3-class and 2-class scenarios, respectively. 4
Furthermore, passage-level scores are obtained by averaging the sentence-level labels in each passage. The distribution of passage-level scores is shown in Figure 4, where we observe a large peak at +1.0. We refer to the points at this peak as total hallucination , which occurs when the information of the response is unrelated to the real concept and is entirely fabricated by the LLM.
Figure 4: Document factuality scores histogram plot
<details>
<summary>Image 4 Details</summary>

### Visual Description
## Histogram: Factuality Distribution of Documents
### Overview
The image is a histogram showing the distribution of average factuality scores across a set of documents. The x-axis represents the average factuality per document, ranging from 0 (factual) to 1 (non-factual). The y-axis represents the count of documents falling into each factuality bin. The bars are all colored in a shade of orange.
### Components/Axes
* **X-axis:** Avg. Factuality per Document (0=Factual, +1=Non-Factual). The scale ranges from 0.0 to 1.0 in increments of 0.2.
* **Y-axis:** Count. The scale ranges from 0 to 30 in increments of 5.
* **Bars:** Represent the number of documents within each factuality range.
### Detailed Analysis
The histogram shows the distribution of documents across different factuality scores. Here's a breakdown of the approximate counts for each bin:
* 0.0: ~12
* 0.05: ~4
* 0.1: ~8
* 0.15: ~8
* 0.2: ~10
* 0.25: ~12
* 0.3: ~9
* 0.35: ~11
* 0.4: ~14
* 0.45: ~11
* 0.5: ~14
* 0.55: ~13
* 0.6: ~18
* 0.65: ~15
* 0.7: ~12
* 0.75: ~6
* 0.8: ~10
* 0.85: ~7
* 0.9: ~8
* 0.95: ~6
* 1.0: ~31
### Key Observations
* The distribution is somewhat uneven, with a large spike at the "non-factual" end (1.0).
* There are several smaller peaks and valleys across the factuality spectrum.
* The distribution is skewed towards the non-factual end, with a higher concentration of documents having a factuality score closer to 1.
### Interpretation
The histogram suggests that the dataset contains a significant number of documents that are classified as non-factual. The spike at 1.0 indicates that a large portion of the documents are strongly classified as non-factual. The presence of documents across the entire factuality spectrum suggests a range of content, from highly factual to highly non-factual, with varying degrees of factuality in between. The uneven distribution indicates that certain factuality levels are more prevalent than others within the dataset.
</details>
## 7 Experiments
The generative LLM used to generate passages for our dataset is GPT-3 (text-davinci-003), the stateof-the-art system at the time of creating and annotating the dataset. To obtain the main response, we set the temperature to 0.0 and use standard beam search decoding. For the stochastically generated samples, we set the temperature to 1.0 and generate
4 3-class refers to when selecting between accurate, minor inaccurate, major inaccurate. 2-class refers to when minor/major inaccuracies are combined into one label.
N =20 samples. For the proxy LLM approach, we use LLaMA (Touvron et al., 2023), one of the bestperforming open-source LLMs currently available. For SelfCheckGPT-Prompt, we consider both GPT3 (which is the same LLM that is used to generate passages) as well as the newly released ChatGPT (gpt-3.5-turbo). More details about the systems in SelfCheckGPT and results using other proxy LLMs can be found in the appendix.
## 7.1 Sentence-level Hallucination Detection
First, we investigate whether our hallucination detection methods can identify the factuality of sentences. In detecting non-factual sentences, both major-inaccurate labels and minor-inaccurate labels are grouped together into the non-factual class, while the factual class refers to accurate sentences. In addition, we consider a more challenging task of detecting major-inaccurate sentences in passages that are not total hallucination passages, which we refer to as non-factual ∗ . 5 Figure 5 and Table 2 show the performance of our approaches, where the following observations can be made:
1) LLM's probabilities p correlate well with factuality . Our results show that probability measures (from the LLM generating the texts) are strong baselines for assessing factuality. Factual sentences can be identified with an AUC-PR of 53.97, significantly better than the random baseline of 27.04, with the AUC-PR for hallucination detection also increasing from 72.96 to 83.21. This supports the hypothesis that when the LLMs are uncertain about generated information, generated tokens often have higher uncertainty, paving a promising direction for hallucination detection approaches. Also, the probability p measure performs better than the entropy H measure of top-5 tokens.
2) Proxy LLM perform noticeably worse than LLM(GPT-3) . The results of proxy LLM (based on LLaMA) show that the entropy H measures outperform the probability measures. This suggests that using richer uncertainty information can improve factuality/hallucination detection performance, and that previously the entropy of top-5 tokens is likely to be insufficient. In addition, when using other proxy LLMs such as GPT-NeoX or OPT-30B, the performance is near that of the random baseline. We believe this poor performance occurs as different LLMs have different generating patterns, and so even common tokens may have a
5 There are 206 non-factual ∗ passages (1632 sentences).
Figure 5: PR-Curve of detecting non-factual and factual sentences in the GPT-3 generated WikiBio passages.
<details>
<summary>Image 5 Details</summary>

### Visual Description
## Chart Type: Precision-Recall Curves
### Overview
The image presents three precision-recall curves, comparing different methods for evaluating the factuality of sentences. The three plots represent different categories of sentences: (a) Non-Factual Sentences, (b) Non-Factual* Sentences, and (c) Factual Sentences. Each plot shows the precision (y-axis) versus recall (x-axis) for several methods, including a random baseline, GPT-3, and several "SelfCk" methods.
### Components/Axes
* **X-axis (Recall):** Ranges from 0.0 to 1.0 in increments of 0.2.
* **Y-axis (Precision):**
* Plot (a): Ranges from 0.70 to 1.00 in increments of 0.05.
* Plot (b): Ranges from 0.2 to 1.0 in irregular increments.
* Plot (c): Ranges from 0.2 to 1.0 in irregular increments.
* **Legend (Top-Right of each plot):**
* `Random`: Dotted black line.
* `GPT-3 Avg(-logP)`: Solid blue line.
* `SelfCk-BERTScore`: Solid orange line.
* `SelfCk-QA`: Solid red line.
* `SelfCk-Unigram`: Solid gray line.
* `SelfCk-Prompt`: Solid light green line.
* `SelfCk-NLI`: Solid purple line.
* **Titles:**
* (a) Non-Factual Sentences
* (b) Non-Factual* Sentences
* (c) Factual Sentences
### Detailed Analysis
#### (a) Non-Factual Sentences
* **Random (Dotted Black):** Flat line at approximately 0.73 precision.
* **GPT-3 Avg(-logP) (Solid Blue):** Starts at approximately 1.0 precision at 0.0 recall, decreases to approximately 0.82 precision at 1.0 recall.
* **SelfCk-BERTScore (Solid Orange):** Starts at approximately 0.82 precision at 0.0 recall, decreases to approximately 0.75 precision at 1.0 recall.
* **SelfCk-QA (Solid Red):** Starts at approximately 0.90 precision at 0.0 recall, decreases to approximately 0.78 precision at 1.0 recall.
* **SelfCk-Unigram (Solid Gray):** Starts at approximately 0.90 precision at 0.0 recall, decreases to approximately 0.78 precision at 1.0 recall.
* **SelfCk-Prompt (Solid Light Green):** Starts at approximately 1.0 precision at 0.0 recall, decreases to approximately 0.93 precision at 1.0 recall.
* **SelfCk-NLI (Solid Purple):** Starts at approximately 0.89 precision at 0.0 recall, decreases to approximately 0.80 precision at 1.0 recall.
#### (b) Non-Factual* Sentences
* **Random (Dotted Black):** Flat line at approximately 0.28 precision.
* **GPT-3 Avg(-logP) (Solid Blue):** Starts at approximately 0.5 precision at 0.0 recall, decreases to approximately 0.38 precision at 1.0 recall.
* **SelfCk-BERTScore (Solid Orange):** Starts at approximately 0.85 precision at 0.0 recall, decreases sharply, then fluctuates around 0.4 precision at 1.0 recall.
* **SelfCk-QA (Solid Red):** Starts at approximately 0.45 precision at 0.0 recall, decreases to approximately 0.38 precision at 1.0 recall.
* **SelfCk-Unigram (Solid Gray):** Starts at approximately 0.98 precision at 0.0 recall, decreases sharply to approximately 0.55 precision at 0.4 recall, then decreases slowly to approximately 0.4 precision at 1.0 recall.
* **SelfCk-Prompt (Solid Light Green):** Starts at approximately 1.0 precision at 0.0 recall, decreases sharply to approximately 0.55 precision at 0.4 recall, then decreases slowly to approximately 0.45 precision at 1.0 recall.
* **SelfCk-NLI (Solid Purple):** Starts at approximately 0.55 precision at 0.0 recall, decreases to approximately 0.38 precision at 1.0 recall.
#### (c) Factual Sentences
* **Random (Dotted Black):** Flat line at approximately 0.28 precision.
* **GPT-3 Avg(-logP) (Solid Blue):** Starts at approximately 0.95 precision at 0.0 recall, decreases to approximately 0.35 precision at 1.0 recall.
* **SelfCk-BERTScore (Solid Orange):** Starts at approximately 0.90 precision at 0.0 recall, decreases sharply, then fluctuates around 0.35 precision at 1.0 recall.
* **SelfCk-QA (Solid Red):** Starts at approximately 0.75 precision at 0.0 recall, decreases to approximately 0.35 precision at 1.0 recall.
* **SelfCk-Unigram (Solid Gray):** Starts at approximately 1.0 precision at 0.0 recall, decreases sharply to approximately 0.55 precision at 0.4 recall, then decreases slowly to approximately 0.35 precision at 1.0 recall.
* **SelfCk-Prompt (Solid Light Green):** Starts at approximately 1.0 precision at 0.0 recall, decreases sharply to approximately 0.55 precision at 0.4 recall, then decreases slowly to approximately 0.45 precision at 1.0 recall.
* **SelfCk-NLI (Solid Purple):** Starts at approximately 0.95 precision at 0.0 recall, decreases to approximately 0.35 precision at 1.0 recall.
### Key Observations
* **Non-Factual Sentences:** All methods perform significantly better than random. SelfCk-Prompt consistently maintains the highest precision across all recall values.
* **Non-Factual\* Sentences:** SelfCk-Prompt and SelfCk-Unigram start with high precision but drop sharply as recall increases. GPT-3 and SelfCk-NLI show more stable performance.
* **Factual Sentences:** Similar to Non-Factual\* Sentences, SelfCk-Prompt and SelfCk-Unigram start high but drop sharply. All methods converge to a similar precision level at high recall.
* The "Random" baseline provides a consistent lower bound for performance across all three sentence types.
### Interpretation
The precision-recall curves illustrate the trade-off between precision and recall for different methods of evaluating sentence factuality. The performance varies significantly depending on the type of sentence (Non-Factual, Non-Factual*, Factual).
* For Non-Factual sentences, the SelfCk-Prompt method appears to be the most effective, maintaining high precision even at high recall. This suggests it is good at identifying non-factual sentences without sacrificing the ability to find most of them.
* For Non-Factual\* and Factual sentences, the SelfCk-Prompt and SelfCk-Unigram methods initially perform well but suffer a significant drop in precision as recall increases. This indicates that while they are good at identifying some factual/non-factual\* sentences, they also produce many false positives as they try to identify more.
* The GPT-3 Avg(-logP) and SelfCk-NLI methods show more consistent performance across all sentence types, suggesting a more balanced approach to factuality assessment.
* The "Non-Factual\*" category seems to present a more challenging evaluation scenario, as all methods show lower precision compared to the "Non-Factual" category. This could be due to the nature of the sentences in this category, which might be more ambiguous or difficult to classify.
</details>
Table 2: AUC-PR for sentence-level detection tasks. Passage-level ranking performances are measured by Pearson correlation coefficient and Spearman's rank correlation coefficient w.r.t. human judgements. The results of other proxy LLMs, in addition to LLaMA, can be found in the appendix. †GPT-3 API returns the top-5 tokens' probabilities, which are used to compute entropy.
| Method | Sentence-level (AUC-PR) | Sentence-level (AUC-PR) | Sentence-level (AUC-PR) | Passage-level (Corr.) | Passage-level (Corr.) |
|-------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------|-------------------------------------------------------------|
| Method | NonFact | NonFact* | Factual | Pearson | Spearman |
| Random | 72.96 | 29.72 | 27.04 | - | - |
| GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) | GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) | GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) | GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) | GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) | GPT-3 (text-davinci-003) 's probabilities ( LLM, grey-box ) |
| Avg( - log p ) | 83.21 | 38.89 | 53.97 | 57.04 | 53.93 |
| Avg( H ) †| 80.73 | 37.09 | 52.07 | 55.52 | 50.87 |
| Max( - log p ) | 87.51 | 35.88 | 50.46 | 57.83 | 55.69 |
| Max( H ) †| 85.75 | 32.43 | 50.27 | 52.48 | 49.55 |
| LLaMA-30B 's probabilities ( Proxy LLM, black-box ) | LLaMA-30B 's probabilities ( Proxy LLM, black-box ) | LLaMA-30B 's probabilities ( Proxy LLM, black-box ) | LLaMA-30B 's probabilities ( Proxy LLM, black-box ) | LLaMA-30B 's probabilities ( Proxy LLM, black-box ) | LLaMA-30B 's probabilities ( Proxy LLM, black-box ) |
| Avg( - log p ) | 75.43 | 30.32 | 41.29 | 21.72 | 20.20 |
| Avg( H ) | 80.80 | 39.01 | 42.97 | 33.80 | 39.49 |
| Max( - log p ) | 74.01 | 27.14 | 31.08 | -22.83 | -22.71 |
| Max( H ) | 80.92 | 37.32 | 37.90 | 35.57 | 38.94 |
| SelfCheckGPT ( black-box) | SelfCheckGPT ( black-box) | SelfCheckGPT ( black-box) | SelfCheckGPT ( black-box) | SelfCheckGPT ( black-box) | SelfCheckGPT ( black-box) |
| w/ BERTScore | 81.96 | 45.96 | 44.23 | 58.18 | 55.90 |
| w/ QA | 84.26 | 40.06 | 48.14 | 61.07 | 59.29 |
| w/ Unigram (max) | 85.63 | 41.04 | 58.47 | 64.71 | 64.91 |
| w/ NLI | 92.50 | 45.17 | 66.08 | 74.14 | 73.78 |
| w/ Prompt | 93.42 | 53.19 | 67.09 | 78.32 | 78.30 |
low probability in situations where the response is dissimilar to the generation style of the proxy LLM. We note that a weighted conditional LM score such as BARTScore (Yuan et al., 2021) could be incorporated in future investigations.
3) SelfCheckGPT outperforms grey-box approaches . It can be seen that SelfCheckGPTPrompt considerably outperforms the grey-box approaches (including GPT-3's output probabilities) as well as other black-box approaches. Even other variants of SelfCheckGPT, including BERTScore, QA, and n -gram, outperform the grey-box approaches in most setups. Interestingly, despite being the least computationally expensive method, SelfCheckGPT with unigram (max) works well across different setups. Essentially, when assessing a sentence, this method picks up the token with the lowest occurrence given all the samples. This suggests that if a token only appears a few times (or once) within the generated samples ( N =20), it is likely non-factual.
- 4) SelfCheckGPT with n -gram . When investigating the n -gram performance from 1-gram to 5-gram, the results show that simply finding the least likely token/ n -gram is more effective than computing the average n -gram score of the sentence, details in appendix Table 7. Additionally, as n increases, the performance of SelfCheckGPT with n -gram (max) drops.
- 5) SelfCheckGPT with NLI . The NLI-based
Figure 6: Scatter plot of passage-level scores where Y-axis = Method scores, X-axis = Human scores. Correlations are reported in Table 2. The scatter plots of other SelfCheckGPT variants are provided in Figure 10 in the appendix.
<details>
<summary>Image 6 Details</summary>

### Visual Description
## Scatter Plots: Method Score vs. Human Score for Factualness
### Overview
The image presents three scatter plots comparing the "Method Score" against the "Human Score" for factualness, where 0 represents factual and +1 represents non-factual. Each plot represents a different method: GPT-3 Avg(-log p), LLaMA-30B Avg(H), and SelfCheckGPT-Prompt. A red line is overlaid on each scatter plot, indicating a trend line.
### Components/Axes
* **X-axis (Horizontal):** "Human Score (0=Factual, +1=Non-Factual)". The scale ranges from 0.0 to 1.0 in increments of 0.2.
* **Y-axis (Vertical):** "Method Score". The scale varies for each plot:
* **(a) GPT-3 Avg(-log p):** 0.0 to 0.7 in increments of 0.1.
* **(b) LLaMA-30B Avg(H):** 0 to 25 in increments of 5.
* **(c) SelfCheckGPT-Prompt:** 0.0 to 1.0 in increments of 0.2.
* **Data Points:** Grey circles represent individual data points.
* **Trend Line:** A red line is overlaid on each scatter plot.
### Detailed Analysis
#### (a) GPT-3 Avg(-log p)
* **X-axis:** Human Score (0 to 1)
* **Y-axis:** Method Score (0 to 0.7)
* **Trend:** The red trend line slopes upward, indicating a positive correlation between the Human Score and the Method Score.
* **Data Points:**
* At Human Score = 0, Method Scores range from approximately 0 to 0.3.
* At Human Score = 1, Method Scores range from approximately 0.3 to 0.6.
#### (b) LLaMA-30B Avg(H)
* **X-axis:** Human Score (0 to 1)
* **Y-axis:** Method Score (0 to 25)
* **Trend:** The red trend line slopes slightly upward, indicating a weak positive correlation between the Human Score and the Method Score.
* **Data Points:**
* At Human Score = 0, Method Scores range from approximately 1 to 6.
* At Human Score = 1, Method Scores range from approximately 3 to 10.
#### (c) SelfCheckGPT-Prompt
* **X-axis:** Human Score (0 to 1)
* **Y-axis:** Method Score (0 to 1)
* **Trend:** The red trend line slopes upward, indicating a strong positive correlation between the Human Score and the Method Score.
* **Data Points:**
* At Human Score = 0, Method Scores range from approximately 0 to 0.2.
* At Human Score = 1, Method Scores range from approximately 0.4 to 1.0.
### Key Observations
* SelfCheckGPT-Prompt shows the strongest positive correlation between Human Score and Method Score.
* LLaMA-30B Avg(H) shows a much weaker correlation and a different scale for the Method Score.
* All three plots show a general trend of increasing Method Score as Human Score increases, suggesting that as the human assessment of non-factualness increases, the method score also tends to increase.
### Interpretation
The plots compare the performance of different methods in assessing the factualness of text generated by language models against human evaluations. The upward trend in all three plots suggests that the methods generally agree with human assessments, with higher method scores corresponding to higher human scores for non-factualness. The varying slopes of the trend lines indicate differences in the strength of this correlation among the methods. SelfCheckGPT-Prompt appears to align most closely with human evaluations, while LLaMA-30B Avg(H) shows a weaker correlation. The different scales on the Y-axis also suggest that the methods use different scoring systems or metrics.
</details>
method outperforms all black-box and grey-box baselines, and its performance is close to the performance of the Prompt method. As SelfCheckGPT with Prompt can be computationally heavy, SelfCheckGPT with NLI could be the most practical method as it provides a good trade-off between performance and computation.
## 7.2 Passage-level Factuality Ranking
Previous results demonstrate that SelfCheckGPT is an effective approach for predicting sentencelevel factuality. An additional consideration is whether SelfCheckGPT can also be used to determine the overall factuality of passages. Passagelevel factuality scores are calculated by averaging the sentence-level scores over all sentences.
$$\mathcal { S } _ { p a s s a g e } = \frac { 1 } { | R | } \sum _ { i } \mathcal { S } ( i ) \quad \quad ( 1 2 ) \quad \frac { W } { \text {Se} }$$
where S ( i ) is the sentence-level score, and | R | is the number of sentences in the passage. Since human judgement is somewhat subjective, averaging the sentence-level labels would lead to ground truths with less noise. Note that for Avg( -log p ) and Avg( H ), we compute the average over all tokens in a passage. Whereas for Max( -log p ) and Max( H ), we first take the maximum operation over tokens at the sentence level, and we then average over all sentences following Equation 12.
Our results in Table 2 and Figure 6 show that all SelfCheckGPT methods correlate far better with human judgements than the other baselines, including the grey-box probability and entropy methods. SelfCheckGPT-Prompt is the best-performing method, achieving the highest Pearson correlation of 78.32. Unsurprisingly, the proxy LLM approach again achieves considerably lower correlations.
## 7.3 Ablation Studies External Knowledge (instead of SelfCheck)
If external knowledge is available, one can measure the informational consistency between the LLM response and the information source. In this experiment, we use the first paragraph of each concept that is available in WikiBio. 6
Table 3: The performance when using SelfCheckGPT samples versus external stored knowledge.
| Method | Sent-lvl AUC-PR | Sent-lvl AUC-PR | Sent-lvl AUC-PR | Passage-lvl | Passage-lvl |
|----------------|-------------------|-------------------|-------------------|---------------|---------------|
| Method | NoFac | NoFac* | Fact | Pear. | Spear. |
| SelfCk-BERT | 81.96 | 45.96 | 44.23 | 58.18 | 55.90 |
| WikiBio+BERT | 81.32 | 40.62 | 49.15 | 58.71 | 55.80 |
| SelfCk-QA | 84.26 | 40.06 | 48.14 | 61.07 | 59.29 |
| WikiBio+QA | 84.18 | 45.40 | 52.03 | 57.26 | 53.62 |
| SelfCk-1gm | 85.63 | 41.04 | 58.47 | 64.71 | 64.91 |
| WikiBio+1gm | 80.43 | 31.47 | 40.53 | 28.67 | 26.70 |
| SelfCk-NLI | 92.50 | 45.17 | 66.08 | 74.14 | 73.78 |
| WikiBio+NLI | 91.18 | 48.14 | 71.61 | 78.84 | 80.00 |
| SelfCk-Prompt | 93.42 | 53.19 | 67.09 | 78.32 | 78.30 |
| WikiBio+Prompt | 93.59 | 65.26 | 73.11 | 85.90 | 86.11 |
Our findings in Table 3 show the following. First, SelfCheckGPT with BERTScore/QA, using selfsamples, can yield comparable or even better performance than when using the reference passage. Second, SelfCheckGPT with n -gram shows a large performance drop when using the WikiBio passages instead of self-samples. This failure is attributed to the fact that the WikiBio reference text alone is not sufficient to train an n -gram model. Third, in contrast, SelfCheckGPT with NLI/Prompt can benefit considerably when access to retrieved information is available. Nevertheless, in practice,
6 This method is no longer zero-resource as it requires retrieving relevant knowledge from external data.
it is infeasible to have an external database for every possible use case of LLM generation.
## The Impact of the Number of Samples
Although sample-based methods are expected to perform better when more samples are drawn, this has higher computational costs. Thus, we investigate performance as the number of samples is varied. Our results in Figure 7 show that the performance of SelfCheckGPT increases smoothly as more samples are used, with diminishing gains as more samples are generated. SelfCheckGPT with n -gram requires the highest number of samples before its performance reaches a plateau.
Figure 7: The performance of SelfCheckGPT methods on ranking passages (Spearman's) versus the number of samples.
<details>
<summary>Image 7 Details</summary>

### Visual Description
## Chart: Spearman's RankCC vs. Number of Samples
### Overview
The image is a line chart comparing Spearman's Rank Correlation Coefficient (RankCC) for different methods (SelfCk-BERTScore, SelfCk-QA, SelfCk-Unigram, SelfCk-NLI, and SelfCk-Prompt) against the number of samples used. The chart shows how the RankCC changes as the number of samples increases from 0 to 20.
### Components/Axes
* **Title:** Spearman's RankCC
* **X-axis:** Num. samples (Number of samples), ranging from 0 to 20 in increments of 2.
* **Y-axis:** Spearman's RankCC, ranging from 0 to 80 in increments of 10.
* **Legend:** Located on the right side of the chart.
* SelfCk-BERTScore (Orange, triangle marker)
* SelfCk-QA (Red, inverted triangle marker)
* SelfCk-Unigram (Gray, star marker)
* SelfCk-NLI (Blue, circle marker)
* SelfCk-Prompt (Green, diamond marker)
### Detailed Analysis
* **SelfCk-BERTScore (Orange, triangle marker):** The line starts at approximately 42 at sample size 1, rises sharply to approximately 53 by sample size 4, and then plateaus around 56-57 from sample size 14 onwards.
* **SelfCk-QA (Red, inverted triangle marker):** The line starts at approximately 46 at sample size 1, rises sharply to approximately 55 by sample size 4, and then plateaus around 59-60 from sample size 14 onwards.
* **SelfCk-Unigram (Gray, star marker):** The line starts at approximately 24 at sample size 1, rises sharply to approximately 58 by sample size 6, and then gradually increases to approximately 64 by sample size 20.
* **SelfCk-NLI (Blue, circle marker):** The line starts at approximately 64 at sample size 1, rises sharply to approximately 73 by sample size 4, and then plateaus around 73-74 from sample size 8 onwards.
* **SelfCk-Prompt (Green, diamond marker):** The line starts at approximately 69 at sample size 1, rises sharply to approximately 77 by sample size 4, and then plateaus around 77-78 from sample size 8 onwards.
### Key Observations
* SelfCk-Prompt consistently achieves the highest Spearman's RankCC across all sample sizes.
* SelfCk-Unigram starts with the lowest RankCC but shows a steady increase as the number of samples grows.
* SelfCk-NLI and SelfCk-Prompt reach a plateau relatively quickly, indicating diminishing returns with increasing sample size.
* SelfCk-BERTScore and SelfCk-QA show similar trends, with a sharp initial increase followed by a plateau.
### Interpretation
The chart demonstrates the performance of different methods in terms of Spearman's RankCC as the number of samples increases. SelfCk-Prompt appears to be the most effective method, achieving the highest correlation with fewer samples. SelfCk-Unigram, while initially underperforming, shows a continuous improvement with more samples, suggesting it might benefit from larger datasets. The plateauing of SelfCk-NLI and SelfCk-Prompt suggests that increasing the sample size beyond a certain point does not significantly improve their performance. The data suggests that the choice of method and the number of samples should be carefully considered to optimize the Spearman's RankCC.
</details>
## The Choice of LLM for SelfCheckGPT-Prompt
We investigate whether the LLM generating the text can self-check its own text. We conduct this ablation using a reduced set of the samples ( N =4).
Table 4: Comparison of GPT-3 (text-davinci-003) and ChatGPT (gpt-3.5.turbo) as the prompt-based text evaluator in SelfCheckGPT-Prompt. †Taken from Table 2 for comparison.
| Text-Gen | SelfCk-Prompt | N | Pear. | Spear. |
|------------------------------|------------------------------|-----|---------|----------|
| GPT-3 | ChatGPT | 20 | 78.32 | 78.3 |
| GPT-3 | ChatGPT | 4 | 76.47 | 76.41 |
| GPT-3 | GPT-3 | 4 | 73.11 | 74.69 |
| †SelfCheck w/ unigram (max) | †SelfCheck w/ unigram (max) | 20 | 64.71 | 64.91 |
| †SelfCheck w/ NLI | †SelfCheck w/ NLI | 20 | 74.14 | 73.78 |
The results in Table 4 show that GPT-3 can selfcheck its own text, and is better than the unigram method even when using only 4 samples. However, ChatGPT shows a slight improvement over GPT-3 in evaluating whether the sentence is supported by the context. More details are in Appendix C.
## 8 Conclusions
This paper is the first work to consider the task of hallucination detection for general large language model responses. We propose SelfCheckGPT, a zero-resource approach that is applicable to any black-box LLM without the need for external resources, and demonstrate the efficacy of our method. SelfCheckGPT outperforms a range of considered grey-box and black-box baseline detection methods at both the sentence and passage levels, and we further release an annotated dataset for GPT-3 hallucination detection with sentencelevel factuality labels.
## Limitations
In this study, the 238 GPT-3 generated texts were predominantly passages about individuals in the WikiBio dataset. To further investigate the nature of LLM's hallucination, this study could be extended to a wider range of concepts, e.g., to also consider generated texts about locations and objects. Further, this work considers factuality at the sentence level, but we note that a single sentence may consist of both factual and non-factual information. For example, the following work by Min et al. (2023) considers a fine-grained factuality evaluation by decomposing sentences into atomic facts. Finally, SelfCheckGPT with Prompt, which was convincingly the best selfcheck method, is quite computationally heavy. This might lead to impractical computational costs, which could be addressed in future work to be made more efficient.
## Ethics Statement
As this work addresses the issue of LLM's hallucination, we note that if hallucinated contents are not detected, they could lead to misinformation.
## Acknowledgments
This work is supported by Cambridge University Press & Assessment (CUP&A), a department of The Chancellor, Masters, and Scholars of the University of Cambridge, and the Cambridge Commonwealth, European & International Trust. We would like to thank the anonymous reviewers for their helpful comments.
## References
- Amos Azaria and Tom Mitchell. 2023. The internal state of an llm knows when its lying. arXiv preprint arXiv:2304.13734 .
- Iz Beltagy, Matthew E. Peters, and Arman Cohan. 2020. Longformer: The long-document transformer.
- Sidney Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, Usvsn Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. 2022. GPT-NeoX-20B: An opensource autoregressive language model. In Proceedings of BigScience Episode #5 - Workshop on Challenges & Perspectives in Creating Large Language Models , pages 95-136, virtual+Dublin. Association for Computational Linguistics.
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems , 33:1877-1901.
- Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311 .
- Jacob Cohen. 1960. A coefficient of agreement for nominal scales. Educational and Psychological Measurement , 20:37 - 46.
- Jinlan Fu, See-Kiong Ng, Zhengbao Jiang, and Pengfei Liu. 2023. Gptscore: Evaluate as you desire.
- Zhijiang Guo, Michael Schlichtkrull, and Andreas Vlachos. 2022. A survey on automated fact-checking. Transactions of the Association for Computational Linguistics , 10:178-206.
- Pengcheng He, Jianfeng Gao, and Weizhu Chen. 2023. DeBERTav3: Improving deBERTa using ELECTRAstyle pre-training with gradient-disentangled embedding sharing. In The Eleventh International Conference on Learning Representations .
- Yichong Huang, Xiachong Feng, Xiaocheng Feng, and Bing Qin. 2021. The factual inconsistency problem in abstractive text summarization: A survey.
- Ganesh Jawahar, Benoît Sagot, and Djamé Seddah. 2019. What does BERT learn about the structure of language? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics , pages 3651-3657, Florence, Italy. Association for Computational Linguistics.
- Ziwei Ji, Nayeon Lee, Rita Frieske, Tiezheng Yu, Dan Su, Yan Xu, Etsuko Ishii, Ye Jin Bang, Andrea
- Madotto, and Pascale Fung. 2023. Survey of hallucination in natural language generation. ACM Comput. Surv. , 55(12).
- Saurav Kadavath, Tom Conerly, Amanda Askell, Tom Henighan, Dawn Drain, Ethan Perez, Nicholas Schiefer, Zac Hatfield Dodds, Nova DasSarma, Eli Tran-Johnson, et al. 2022. Language models (mostly) know what they know. arXiv preprint arXiv:2207.05221 .
- Wojciech Kryscinski, Bryan McCann, Caiming Xiong, and Richard Socher. 2020. Evaluating the factual consistency of abstractive text summarization. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP) , pages 9332-9346, Online. Association for Computational Linguistics.
- Lorenz Kuhn, Yarin Gal, and Sebastian Farquhar. 2023. Semantic uncertainty: Linguistic invariances for uncertainty estimation in natural language generation. In The Eleventh International Conference on Learning Representations .
- Guokun Lai, Qizhe Xie, Hanxiao Liu, Yiming Yang, and Eduard Hovy. 2017. RACE: Large-scale ReAding comprehension dataset from examinations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing , pages 785794, Copenhagen, Denmark. Association for Computational Linguistics.
- Rémi Lebret, David Grangier, and Michael Auli. 2016. Generating text from structured data with application to the biography domain. CoRR , abs/1603.07771.
- Tianyu Liu, Yizhe Zhang, Chris Brockett, Yi Mao, Zhifang Sui, Weizhu Chen, and Bill Dolan. 2022. A token-level reference-free hallucination detection benchmark for free-form text generation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pages 6723-6737, Dublin, Ireland. Association for Computational Linguistics.
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692 .
- Adian Liusie, Vatsal Raina, and Mark Gales. 2023. 'world knowledge' in multiple choice reading comprehension. In Proceedings of the Sixth Fact Extraction and VERification Workshop (FEVER) , pages 49-57, Dubrovnik, Croatia. Association for Computational Linguistics.
- Zheheng Luo, Qianqian Xie, and Sophia Ananiadou. 2023. Chatgpt as a factual inconsistency evaluator for abstractive text summarization. arXiv preprint arXiv:2303.15621 .
- Andrey Malinin and Mark Gales. 2021. Uncertainty estimation in autoregressive structured prediction. In International Conference on Learning Representations .
- Potsawee Manakul, Adian Liusie, and Mark JF Gales. 2023. MQAG: Multiple-choice question answering and generation for assessing information consistency in summarization. arXiv preprint arXiv:2301.12307 .
- Joshua Maynez, Shashi Narayan, Bernd Bohnet, and Ryan McDonald. 2020. On faithfulness and factuality in abstractive summarization. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics , pages 1906-1919, Online. Association for Computational Linguistics.
- Sewon Min, Kalpesh Krishna, Xinxi Lyu, Mike Lewis, Wen-tau Yih, Pang Wei Koh, Mohit Iyyer, Luke Zettlemoyer, and Hannaneh Hajishirzi. 2023. Factscore: Fine-grained atomic evaluation of factual precision in long form text generation. arXiv preprint arXiv:2305.14251 .
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research , 21(1):5485-5551.
- Vatsal Raina and Mark Gales. 2022. Answer uncertainty and unanswerability in multiple-choice machine reading comprehension. In Findings of the Association for Computational Linguistics: ACL 2022 , pages 1020-1034, Dublin, Ireland. Association for Computational Linguistics.
- Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing , pages 2383-2392, Austin, Texas. Association for Computational Linguistics.
- Kurt Shuster, Spencer Poff, Moya Chen, Douwe Kiela, and Jason Weston. 2021. Retrieval augmentation reduces hallucination in conversation. In Findings of the Association for Computational Linguistics: EMNLP 2021 , pages 3784-3803, Punta Cana, Dominican Republic. Association for Computational Linguistics.
- James Thorne, Andreas Vlachos, Oana Cocarascu, Christos Christodoulopoulos, and Arpit Mittal. 2018. The Fact Extraction and VERification (FEVER) shared task. In Proceedings of the First Workshop on Fact Extraction and VERification (FEVER) .
- Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971 .
- Anthony J Viera, Joanne M Garrett, et al. 2005. Understanding interobserver agreement: the kappa statistic. Fam med , 37(5):360-363.
- Ben Wang and Aran Komatsuzaki. 2021. GPT-J6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/ mesh-transformer-jax .
- Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc V Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, and Denny Zhou. 2023. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations .
- Adina Williams, Nikita Nangia, and Samuel Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers) , pages 1112-1122, New Orleans, Louisiana. Association for Computational Linguistics.
- Yijun Xiao and William Yang Wang. 2021. On hallucination and predictive uncertainty in conditional language generation. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume , pages 2734-2744, Online. Association for Computational Linguistics.
- Weizhe Yuan, Graham Neubig, and Pengfei Liu. 2021. Bartscore: Evaluating generated text as text generation. Advances in Neural Information Processing Systems , 34:27263-27277.
- Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. 2022. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068 .
- Zhuosheng Zhang, Yuwei Wu, Hai Zhao, Zuchao Li, Shuailiang Zhang, Xi Zhou, and Xiang Zhou. 2020. Semantics-aware bert for language understanding. In Proceedings of the AAAI Conference on Artificial Intelligence , volume 34, pages 9628-9635.
- Wanjun Zhong, Jingjing Xu, Duyu Tang, Zenan Xu, Nan Duan, Ming Zhou, Jiahai Wang, and Jian Yin. 2020. Reasoning over semantic-level graph for fact checking. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics , pages 6170-6180, Online. Association for Computational Linguistics.
## A Models and Implementation
## A.1 Entropy
The entropy of the output distribution is implemented as follows,
$$\begin{array} { r l } { \mathcal { H } _ { i j } = 2 ^ { - \sum _ { \tilde { w } \in W } p _ { i j } ( \tilde { w } ) \log _ { 2 } p _ { i j } ( \tilde { w } ) } } & { ( 1 3 ) \quad L e t } \end{array}$$
where W is the set of all possible words in the vocabulary.
## A.2 Proxy LLMs
The proxy LLMs considered are LLaMA-{7B, 13B, 30B} (Touvron et al., 2023), OPT-{125m, 1.3B, 13B, 30B} (Zhang et al., 2022), GPT-J-6B (Wang and Komatsuzaki, 2021) and GPT-NeoX20B (Black et al., 2022).
## A.3 SelfCheckGPT's Systems
Question Answering : The generation systems G1 and G2 are T5-Large fine-tuned to SQuAD (Rajpurkar et al., 2016) and RACE (Lai et al., 2017), respectively. The answering system A is Longformer (Beltagy et al., 2020) fine-tuned to the RACE dataset. The answerability system U is also Longformer, but fine-tuned to SQuAD2.0.
LLM for Prompting : We consider two LLMs, GPT-3 (text-davinci-003) and ChatGPT (gpt-3.5turbo) We note that during the data creation and annotation, GPT-3 (text-davinci-003) was the stateof-the-art LLM available; hence, GPT-3 was used as the main LLM generating WikiBio passages.
## B SelfCheckGPT with QA
Previous work showed that implementing question generation (in Equation 2) with two generators ( G1 generates the question and associated answer, and G2 generates distractors) yields higher-quality distractors (Manakul et al., 2023). Thus, a two-stage generation is adopted in this work as follows:
$$\begin{array} { r l } & { q , a \sim P _ { \mathbb { G } 1 } ( q , a | r _ { i } ) ; \, o _ { \langle a \rangle } \sim P _ { \mathbb { G } 2 } ( o _ { \langle a \rangle } | q , a , R ) } \\ & { ( 1 4 ) } \end{array}$$
where o = { a, o \ a } = { o 1 , ..., o 4 } . In addition, to filter out bad (unanswerable) questions, we define an answerability score (Raina and Gales, 2022):
$$\alpha = P _ { U } ( a n s w e r a b l e | q , c o n t e x t ) \quad ( 1 5 ) \quad p e r$$
where the context is either the response R or sampled passages S n , and α → 0 . 0 for unanswerable and α → 1 . 0 for answerable. We use α to filter out unanswerable questions which have α lower than a threshold. Next, we derive how Bayes' theorem can be applied to take into account the number of answerable/unanswerable questions.
## B.1 SelfCheckGPT-QA with Bayes
Let P ( F ) denote the probability of the i -th sentence being non-factual, and P ( T ) denote the probability of the i -th sentence being factual. For a question q , the probability of i -th sentence being non-factual given a set of matched answers L m and a set of not-matched answers L n is:
$$& P ( \mathbf F | L _ { \mathbf m } , L _ { \mathbf n } ) \\ & = \frac { P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf F ) P ( \mathbf F ) } { P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf F ) + P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf T ) P ( \mathbf T ) } \\ & = \frac { P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf F ) } { P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf F ) + P ( L _ { \mathbf m } , L _ { \mathbf n } | \mathbf T ) }$$
where we assume the sentence is equally likely to be False or True, i.e. P ( F ) = P ( T ) . The probability of observing L m , L n when the sentence is False (non-factual):
̸
$$\begin{array} { r l } & { P ( L _ { \mathbb { m } } , L _ { n } | F ) } \\ & { = \prod _ { a \in L _ { \mathbb { m } } } P ( a = a _ { R } | F ) \prod _ { a ^ { \prime } \in L _ { \mathbb { m } } } P ( a ^ { \prime } \neq a _ { R } | F ) } \\ & { = ( 1 - \beta _ { 1 } ) ^ { N _ { \mathbb { m } } } ( \beta _ { 1 } ) ^ { N _ { \mathbb { n } } } } \end{array}$$
and probability of observing L m , L n when the sentence is True (factual):
̸
$$\begin{array} { r l } & { P ( L _ { \mathbb { m } } , L _ { \mathbf n } | T ) } \\ & { = \prod _ { a \in L _ { \mathbf n } } P ( a = a _ { r } | T ) \prod _ { a ^ { \prime } \in L _ { \mathbf n } } P ( a ^ { \prime } \neq a _ { r } | T ) } \\ & { = ( \beta _ { 2 } ) ^ { N _ { \mathbb { m } } } ( 1 - \beta _ { 2 } ) ^ { N _ { \mathbf n } } } \end{array}$$
where N m and N n are the number of matched answers and the number of not-matched answers, respectively. Hence, we can simplify Equation 16:
$$\begin{array} { r l } { P ( F | L _ { \mathfrak { m } } , L _ { \mathfrak { n } } ) = \frac { \gamma _ { 2 } ^ { N _ { \mathfrak { n } } } } { \gamma _ { 1 } ^ { N _ { \mathfrak { n } } } + \gamma _ { 2 } ^ { N _ { \mathfrak { n } } } } \quad ( 1 9 ) } \end{array}$$
where γ 1 = β 2 1 -β 1 and γ 2 = β 1 1 -β 2 . Lastly, instead of rejecting samples having an answerability score below a threshold, 7 we find empirically that softcounting (defined below) improves the detection performance. We set both β 1 and β 2 to 0.8.
7 α is between 0.0 (unanswerable) and 1.0 (answerable). Standard-counting N m and N n can be considered as a special case of soft-counting where α is set to 1.0 if α is greater than the answerability threshold and otherwise α is 0.0.
$$N _ { \mathfrak { m } } ^ { \prime } = \sum _ { n \text { s.t. a} _ { n } \in L _ { \mathfrak { m } } } \alpha _ { n } ; \ N _ { \mathfrak { n } } ^ { \prime } = \sum _ { n \text { s.t. a} _ { n } \in L _ { \mathfrak { n } } } \alpha _ { n } ( 2 0 )$$
where α n = P U ( answerable | q, S n ) . Therefore, the SelfCheckGPT with QA score, S QA, is:
$$\begin{array} { r l } { \mathcal { S } _ { Q A } = P ( F | L _ { m } , L _ { n } ) = \frac { \gamma _ { 2 } ^ { N _ { n } ^ { \prime } } } { \gamma _ { 1 } ^ { N _ { n } ^ { \prime } } + \gamma _ { 2 } ^ { N _ { n } ^ { \prime } } } \quad ( 2 1 ) } \end{array}$$
In Table 5, we show empically that applying Bayes' theorem and soft counting α (in Equation 20) improves the performance of the SelfCheckGPT with QA method.
| Varaint | Sentence-lvl | Sentence-lvl | Sentence-lvl | Passage-lvl | Passage-lvl |
|-------------|----------------|----------------|----------------|---------------|---------------|
| | NoF | NoF* | Fact | PCC | SCC |
| SimpleCount | 83.97 | 40.07 | 47.78 | 57.39 | 55.15 |
| + Bayes | 83.04 | 38.58 | 47.41 | 56.43 | 55.03 |
| + Bayes + α | 84.26 | 40.06 | 48.14 | 61.07 | 59.29 |
Table 5: Performance of SelfCheckGPT-QA's variants.
## C SelfCheckGPT with Prompt
We use the prompt template provided in the main text (in Section 5.5) for both GPT-3 (text-davinci003) and ChatGPT (gpt-3.5-turbo). For ChatGPT, a standard system message " You are a helpful assistant. " is used in setting up the system.
At the time of conducting experiments, the API costs per 1,000 tokens are $0.020 for GPT-3 and $0.002 for ChatGPT. The estimated costs for running the models to answer Yes/No on all 1908 sentences and 20 samples are around $200 for GPT-3 and $20 for ChatGPT. Given the cost, we conduct the experiments on 4 samples when performing the ablation about LLM choice for SelfCheckGPTPrompt (Section 7.3). Table 6 shows the breakdown of predictions made by GPT-3 and ChatGPT.
Table 6: Breakdown of predictions made by GPT-3/ChatGPT when prompted to answer Yes (supported)/ No (not-supported).
| GPT-3 ChatGPT | Yes | No |
|-----------------|-------|------|
| Yes | 3179 | 1038 |
| No | 367 | 3048 |
## D Additional Experimental Results
Here, we provide experimental results that are complementary to those presented in the main paper.
| n -gram | Sent-lvl AUC-PR | Sent-lvl AUC-PR | Sent-lvl AUC-PR | Passage-lvl | Passage-lvl |
|----------------|-------------------|-------------------|-------------------|----------------|----------------|
| | NoFac | NoFac* | Fact | Pear. | Spear. |
| Avg( - log p ) | Avg( - log p ) | Avg( - log p ) | Avg( - log p ) | Avg( - log p ) | Avg( - log p ) |
| 1-gram | 81.52 | 40.33 | 41.76 | 40.68 | 39.22 |
| 2-gram | 82.94 | 44.38 | 52.81 | 58.84 | 58.11 |
| 3-gram | 83.56 | 44.64 | 53.99 | 62.21 | 63.00 |
| 4-gram | 83.80 | 43.55 | 54.25 | 61.98 | 63.64 |
| 5-gram | 83.45 | 42.31 | 53.98 | 60.68 | 62.96 |
| Max( - log p ) | Max( - log p ) | Max( - log p ) | Max( - log p ) | Max( - log p ) | Max( - log p ) |
| 1-gram | 85.63 | 41.04 | 58.47 | 64.71 | 64.91 |
| 2-gram | 85.26 | 39.29 | 58.29 | 62.48 | 66.04 |
| 3-gram | 84.97 | 37.10 | 57.08 | 57.34 | 60.49 |
| 4-gram | 84.49 | 36.37 | 55.96 | 55.77 | 57.25 |
| 5-gram | 84.12 | 36.19 | 54.89 | 54.84 | 55.97 |
Table 7: The performance using different n -gram models in the SelfCheckGPT with n -gram method.
Figure 8: The performance of SelfCheckGPT methods on sentence-level non-factual detection (AUC-PR) versus the number of samples. This Figure extends the passage-level results in Figure 7.
<details>
<summary>Image 8 Details</summary>

### Visual Description
## Chart: AUC-PR vs. Number of Samples for Different SelfCk Methods
### Overview
The image is a line chart comparing the AUC-PR (Area Under the Precision-Recall Curve) performance of five different "SelfCk" methods as the number of samples increases. The chart displays how the performance of each method improves with more samples.
### Components/Axes
* **Y-axis:** AUC-PR (Area Under the Precision-Recall Curve). Scale ranges from 77.5 to 92.5.
* **X-axis:** Num. samples (Number of samples). Scale ranges from 0 to 20.
* **Legend:** Located in the bottom-right corner, identifying each line by its corresponding "SelfCk" method:
* SelfCk-BERTScore (Orange triangles)
* SelfCk-QA (Red inverted triangles)
* SelfCk-Unigram (Gray stars)
* SelfCk-NLI (Blue circles)
* SelfCk-Prompt (Green diamonds)
### Detailed Analysis
* **SelfCk-Prompt (Green Diamonds):**
* Trend: Starts high and plateaus quickly.
* Data Points: Starts at approximately 90.0 at sample 1, reaches approximately 92.5 by sample 4, and remains relatively stable around 93.0 from sample 10 onwards.
* **SelfCk-NLI (Blue Circles):**
* Trend: Starts lower than SelfCk-Prompt but also plateaus quickly.
* Data Points: Starts at approximately 88.0 at sample 1, reaches approximately 91.5 by sample 4, and stabilizes around 92.0 from sample 10 onwards.
* **SelfCk-Unigram (Gray Stars):**
* Trend: Gradual increase with some fluctuations.
* Data Points: Starts at approximately 77.0 at sample 1, reaches approximately 84.0 by sample 8, and fluctuates around 86.0 from sample 15 onwards.
* **SelfCk-QA (Red Inverted Triangles):**
* Trend: Gradual increase, similar to SelfCk-Unigram.
* Data Points: Starts at approximately 80.0 at sample 1, reaches approximately 83.5 by sample 6, and stabilizes around 84.0 from sample 12 onwards.
* **SelfCk-BERTScore (Orange Triangles):**
* Trend: Starts low, increases, then plateaus.
* Data Points: Starts at approximately 79.0 at sample 1, reaches approximately 81.0 by sample 4, and stabilizes around 81.5 from sample 8 onwards.
### Key Observations
* SelfCk-Prompt and SelfCk-NLI consistently outperform the other methods.
* SelfCk-Unigram and SelfCk-QA show similar performance trends.
* SelfCk-BERTScore has the lowest performance among the five methods.
* All methods show diminishing returns as the number of samples increases, with most plateauing after approximately 10 samples.
### Interpretation
The chart demonstrates the performance of different "SelfCk" methods in relation to the number of samples used. SelfCk-Prompt and SelfCk-NLI appear to be the most effective, achieving higher AUC-PR scores with fewer samples. The diminishing returns suggest that increasing the number of samples beyond a certain point (around 10) does not significantly improve the performance of any of the methods. The relative performance of each method provides insights into their effectiveness in the given task, with SelfCk-BERTScore being the least effective among those tested.
</details>
Figure 9: Passage-level ranking performance of the Avg( H ) method using proxy LLM where the sizes are: LLaMA={7B, 13B, 30B}, OPT={125m, 1.3B, 13B, 30B}, GPT-J=6B, NeoX=20B. The full results are provided in Table 8.
<details>
<summary>Image 9 Details</summary>

### Visual Description
## Chart: Spearman Correlation vs. Model Size
### Overview
The image is a line chart comparing the Spearman correlation of two model families (LLaMA and OPT/GPT-J/NeoX) against their model size, which ranges from 1.25/1.3B to 30B parameters. The chart shows how the Spearman correlation changes as the model size increases for each family.
### Components/Axes
* **X-axis:** Model Size (in billions of parameters). The markers are at 1.25/1.3B, 6B, 13B, 20B, and 30B.
* **Y-axis:** Spearman correlation. The scale ranges from -10 to 40.
* **Legend:** Located in the bottom-right corner.
* Green line with circle markers: LLaMA
* Purple line with square markers: OPT, GPT-J, NeoX
### Detailed Analysis
* **LLaMA (Green Line):**
* Trend: Initially increases sharply, then plateaus and slightly decreases.
* Data Points:
* 1.25/1.3B: Approximately -13
* 6B: Approximately -1
* 13B: Approximately 1
* 20B: Approximately 8
* 30B: Approximately 4
* **OPT, GPT-J, NeoX (Purple Line):**
* Trend: Increases sharply, then plateaus.
* Data Points:
* 6B: Approximately 22
* 13B: Approximately 33
* 30B: Approximately 40
### Key Observations
* The OPT/GPT-J/NeoX models consistently outperform LLaMA models in terms of Spearman correlation across all model sizes shown.
* The Spearman correlation for OPT/GPT-J/NeoX increases significantly between 6B and 13B parameters, then plateaus.
* The Spearman correlation for LLaMA increases sharply between 1.25/1.3B and 20B parameters, but then decreases slightly at 30B.
### Interpretation
The chart suggests that increasing model size generally improves the Spearman correlation for both model families, but the effect is more pronounced for OPT/GPT-J/NeoX. The plateauing effect observed for both families indicates that there may be diminishing returns to increasing model size beyond a certain point, at least in terms of Spearman correlation. The slight decrease in Spearman correlation for LLaMA at 30B could indicate overfitting or other issues related to model training. The OPT/GPT-J/NeoX family appears to be more effective at leveraging increased model size to improve Spearman correlation compared to the LLaMA family.
</details>
Figure 10: Scatter plot of passage-level scores where Y-axis = Method scores, X-axis = Human scores. Correlations are reported in Table 2. This figure provides results in addition to Figure 6.
<details>
<summary>Image 10 Details</summary>

### Visual Description
## Scatter Plot Matrix: SelfCheckGPT Performance vs. Human Score
### Overview
The image presents a matrix of four scatter plots, each evaluating the performance of a different variant of the SelfCheckGPT method against human scores. The x-axis represents the human score, where 0 indicates "Factual" and +1 indicates "Non-Factual". The y-axis represents the method score. Each plot includes a red line of best fit, visually indicating the correlation between the method's score and the human score.
### Components/Axes
* **X-axis (Horizontal):** "Human Score (0=Factual, +1=Non-Factual)". Scale ranges from 0.0 to 1.0.
* **Y-axis (Vertical):** "Method Score". The scale varies between plots.
* Plot (a): 0.04 to 0.12
* Plot (b): 0.1 to 0.8
* Plot (c): 5.5 to 8.0
* Plot (d): 0.0 to 1.0
* **Data Points:** Grey circles representing individual data points.
* **Line of Best Fit:** Red line indicating the general trend of the data.
* **Plot Titles:**
* (a) SelfCheckGPT-BERTScore
* (b) SelfCheckGPT-QA
* (c) SelfCheckGPT-1gram(max)
* (d) SelfCheckGPT-NLI
### Detailed Analysis
**Plot (a): SelfCheckGPT-BERTScore**
* **Y-axis:** Method Score ranges from approximately 0.04 to 0.12.
* **Trend:** The red line of best fit shows a slight positive correlation.
* **Data Points:**
* At Human Score 0.0, Method Scores range from approximately 0.03 to 0.11.
* At Human Score 1.0, Method Scores range from approximately 0.08 to 0.12.
**Plot (b): SelfCheckGPT-QA**
* **Y-axis:** Method Score ranges from approximately 0.1 to 0.8.
* **Trend:** The red line of best fit shows a positive correlation.
* **Data Points:**
* At Human Score 0.0, Method Scores range from approximately 0.1 to 0.6.
* At Human Score 1.0, Method Scores range from approximately 0.5 to 0.8.
**Plot (c): SelfCheckGPT-1gram(max)**
* **Y-axis:** Method Score ranges from approximately 5.5 to 8.0.
* **Trend:** The red line of best fit shows a positive correlation.
* **Data Points:**
* At Human Score 0.0, Method Scores range from approximately 5.5 to 7.5.
* At Human Score 1.0, Method Scores range from approximately 7.0 to 8.0.
**Plot (d): SelfCheckGPT-NLI**
* **Y-axis:** Method Score ranges from approximately 0.0 to 1.0.
* **Trend:** The red line of best fit shows a positive correlation.
* **Data Points:**
* At Human Score 0.0, Method Scores range from approximately 0.1 to 0.8.
* At Human Score 1.0, Method Scores range from approximately 0.7 to 1.0.
### Key Observations
* All four SelfCheckGPT variants show a positive correlation between the human score (factual vs. non-factual) and the method score. This suggests that as the human score indicates non-factuality, the method score tends to increase.
* The range of method scores varies significantly between the different SelfCheckGPT variants.
* The spread of data points around the line of best fit varies between the plots, indicating differences in the consistency of the methods.
### Interpretation
The scatter plot matrix provides a comparative analysis of different SelfCheckGPT methods in relation to human assessment of factuality. The positive correlations observed in all plots suggest that these methods are generally capable of distinguishing between factual and non-factual content, aligning with human judgment to some extent. However, the varying ranges and spreads of data points indicate that the methods differ in their sensitivity, consistency, and overall performance. The SelfCheckGPT-NLI variant appears to have the widest range of scores, potentially indicating a greater ability to discriminate between factual and non-factual content, while the SelfCheckGPT-BERTScore variant has a much narrower range. The lines of best fit are useful for visualizing the general trend, but the scatter of points around these lines indicates that the relationship between human and method scores is not perfectly linear and that other factors may be influencing the results.
</details>
Table 8: AUC-PR for Detecting Non-Factual and Factual Sentences in the GPT-3 generated WikiBio passages. Passage-level PCC and SCC with LLMs used to assess GPT-3 responses. This table is an extension to Table 2.
| LLM | Size | Sentence-level (AUC-PR) | Sentence-level (AUC-PR) | Sentence-level (AUC-PR) | Passage-level (Corr.) | Passage-level (Corr.) |
|-----------------------|-----------------------|---------------------------|---------------------------|---------------------------|-------------------------|-------------------------|
| | | NonFact | NonFact* | Factual | Pearson | Spearman |
| Random | - | 72.96 | 29.72 | 27.04 | - | - |
| Avg( - log p ) Method | Avg( - log p ) Method | Avg( - log p ) Method | Avg( - log p ) Method | Avg( - log p ) Method | Avg( - log p ) Method | Avg( - log p ) Method |
| LLaMA | 30B | 75.43 | 30.32 | 41.29 | 21.72 | 20.20 |
| LLaMA | 13B | 74.16 | 30.01 | 37.36 | 13.33 | 12.89 |
| LLaMA | 7B | 71.69 | 27.87 | 31.30 | -2.71 | -2.59 |
| OPT | 30B | 67.70 | 24.43 | 25.04 | -32.07 | -31.45 |
| NeoX | 20B | 69.00 | 24.38 | 26.18 | -31.79 | -34.15 |
| OPT | 13B | 67.46 | 24.39 | 25.20 | -33.05 | -32.79 |
| GPT-J | 6B | 67.51 | 24.28 | 24.26 | -38.80 | -40.05 |
| OPT | 1.3B | 66.19 | 24.47 | 23.47 | -35.20 | -38.95 |
| OPT | 125m | 66.63 | 25.31 | 23.07 | -30.38 | -37.54 |
| Avg( H ) Method | Avg( H ) Method | Avg( H ) Method | Avg( H ) Method | Avg( H ) Method | Avg( H ) Method | Avg( H ) Method |
| LLaMA | 30B | 80.80 | 39.01 | 42.97 | 33.80 | 39.49 |
| LLaMA | 13B | 80.63 | 38.98 | 40.59 | 29.43 | 33.12 |
| LLaMA | 7B | 78.67 | 37.22 | 33.81 | 19.44 | 21.79 |
| OPT | 30B | 77.13 | 33.67 | 29.55 | -0.43 | 3.43 |
| NeoX | 20B | 77.40 | 32.78 | 30.13 | 5.41 | 7.43 |
| OPT | 13B | 76.93 | 33.71 | 29.68 | 0.25 | 1.39 |
| GPT-J | 6B | 76.15 | 33.29 | 28.30 | -2.50 | -1.37 |
| OPT | 1.3B | 74.05 | 31.91 | 26.33 | -10.59 | -10.00 |
| OPT | 125m | 71.51 | 30.88 | 25.36 | -14.16 | -13.76 |
| Max( - log p ) Method | Max( - log p ) Method | Max( - log p ) Method | Max( - log p ) Method | Max( - log p ) Method | Max( - log p ) Method | Max( - log p ) Method |
| LLaMA | 30B | 74.01 | 27.14 | 31.08 | -22.83 | -22.71 |
| LLaMA | 13B | 71.12 | 26.78 | 28.82 | -34.93 | -31.70 |
| LLaMA | 7B | 69.57 | 25.91 | 26.54 | -42.57 | -38.24 |
| OPT | 30B | 67.32 | 24.40 | 24.32 | -49.51 | -45.50 |
| NeoX | 20B | 67.51 | 23.88 | 24.82 | -47.96 | -44.54 |
| OPT | 13B | 67.36 | 24.67 | 24.46 | -50.15 | -44.42 |
| GPT-J | 6B | 67.58 | 23.94 | 23.93 | -51.23 | -47.68 |
| OPT | 1.3B | 68.16 | 25.85 | 24.66 | -45.60 | -42.39 |
| OPT | 125m | 69.23 | 27.66 | 24.14 | -39.22 | -37.18 |
| Max( H ) Method | Max( H ) Method | Max( H ) Method | Max( H ) Method | Max( H ) Method | Max( H ) Method | Max( H ) Method |
| LLaMA | 30B | 80.92 | 37.32 | 37.90 | 35.57 | 38.94 |
| LLaMA | 13B | 80.98 | 37.94 | 36.01 | 32.07 | 34.01 |
| LLaMA | 7B | 79.65 | 35.57 | 31.32 | 22.10 | 22.53 |
| OPT | 30B | 76.58 | 33.44 | 29.31 | 1.63 | 6.41 |
| NeoX | 20B | 76.98 | 31.96 | 29.13 | 5.97 | 9.31 |
| OPT | 13B | 76.26 | 32.81 | 29.25 | 1.42 | 2.82 |
| GPT-J | 6B | 75.30 | 32.51 | 28.13 | -2.14 | 1.41 |
| OPT | 1.3B | 73.79 | 31.42 | 26.38 | -9.84 | -9.80 |
| OPT | 125m | 71.32 | 31.65 | 25.36 | -18.05 | -17.37 |