PAPER.md
---
type: agent_native_research_artifact
date: 2026-05-12
source_title: "Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy"
source_note: "wiki/sources/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.md"
source_path: "raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf"
rawmarkdown_path: ""
grounding_status: "pdf_first_pages"
branch: ai-data-extraction
status: automated-level-3
quality_label: automated-level-3
readthrough_status: automated-readthrough-complete
readthrough_date: 2026-05-12
---
Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy
Retrieval Contract
Use this ARA as the first branch-local agent-facing layer for the source. Verify important claims against `evidence/README.md`, the branch source note, the raw Markdown sidecar when available, and the PDF.
Source Grounding
- Source note: `wiki/sources/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.md`
- Source path: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`
- Raw Markdown sidecar: `missing`
- Grounding status: `pdf_first_pages`
Abstracted Contribution
Article
Detecting hallucinations in large language
models using semantic entropy
https://doi.org/10.1038/s41586-024-07421-0
Sebastian Farquhar1,2 ✉, Jannik Kossen1,2, Lorenz Kuhn1,2 & Yarin Gal1
Received: 17 July 2023
Accepted: 12 April 2024
Published online: 19 June 2024
Open access
Check for updates
Large language model (LLM) systems, such as ChatGPT1 or Gemini2, can show
impressive reasoning and question-answering capabilities but often ‘hallucinate’
false outputs and unsubstantiated answers3,4. Answering unreliably or without the
necessary information prevents adoption in diverse fields, with problems including
fabrication of legal precedents5 or untrue facts in news articles6 and even posing a
risk to human life in medical domains such as radiology7. Encouraging truthfulness
through supervision or reinforcement has been only partially successful8. Researchers
need a general method for detecting hallucinations in LLMs that works even with new
and unseen questions to which humans might not know the answer. Here we develop
new methods grounded in statistics, proposing entropy-based uncertainty estimators
for LLMs to detect a subset of hallucinations—confabulations—which are arbitrary and
incorrect generations. Our method addresses the fact that one idea can be expressed
in many ways by computing uncertainty at the level of meaning rather than specific
sequences of words. Our method works across datasets and tasks without a priori
knowledge of the task, requires no task-specific data and robustly generalizes to new
tasks not seen before. By detecting when a prompt is likely to produce a confabulation,
our method helps users understand when they must take extra care with LLMs and
opens up new possibilities for using LLMs that are otherwise prevented by their
unrelia
Branch Use
This artifact was generated to make every PDF in the AI Data Extraction branch retrievable through a consistent ARA framework. It is a Level 1 scaffold unless later files in this folder document deeper curation.
Main Concept Links
- [[AI Data Extraction]]
- [[Evidence Synthesis Automation]]
- [[LLM Accuracy]]
- [[Context Engineering]]
Layer Index
- `logic/claims.md`
- `logic/problem.md`
- `logic/concepts.md`
- `logic/related_work.md`
- `logic/experiments.md`
- `evidence/README.md`
- `trace/exploration_tree.yaml`
- `src/environment.md`
- `index.html`
logic/claims.md
Claims
- C01: `Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy` is part of the AI Data Extraction branch source base and should be retrieved with the anchor documents before use in rejoinder synthesis.
- C02: The source is provisionally connected to [[AI Data Extraction]], [[Evidence Synthesis Automation]], [[LLM Accuracy]], [[Context Engineering]].
- C03: The current ARA is a scaffold; exact empirical, methodological, and numerical claims require source checking against `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`.
logic/problem.md
Problem
This ARA preserves a branch-local retrieval entry point for `Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy`.
Provisional Role
- Document category: `branch-source`
- Branch anchor: connect explicitly to [[Main Paper]], [[Commentary]], [[Commentary 2]], or [[Rejoinder Map]] before using in final prose.
logic/concepts.md
Concepts
- [[AI Data Extraction]]
- [[Evidence Synthesis Automation]]
- [[LLM Accuracy]]
- [[Context Engineering]]
logic/method_and_design.md
Method And Design
Source Identity
- Title: Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy
- ARA: `farquhar-et-al-2024-detecting-hallucinations-in-large-language-models-using-semantic-entropy-ara`
- Source PDF: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`
- Raw Markdown: `missing`
- Automated read-through grounding: `pdftotext-full`
Design Classification
- Provisional design: `needs-further-coding`
- Branch role: `branch-adjacent context`
Data, Sample, Or Source Material
aim to ‘learn’ how to detect confabulations from a set of example demonstrations. Our method is unsupervised, meaning that we do not need labelled examples of confabulations. By contrast, supervised methods detect confabulations by learning patterns behind examples of confabulations, assuming that future questions preserve these patterns. But this assumption is often untrue in new situations or with confabulations that human overseers are unable to identify (compare Fig. 17 of ref. 24). As a strong supervised baseline, we compare to an embedding regression method inspired by ref. 24 which trains a logistic regression classifier to predict whether the model correctly answered a question on the basis of the final ‘embedding’ (hidden state) of the LLM. We also use the P(True) method24 which looks at the probability with which an LLM predicts that the next token is ‘True’ when few-shot prompted to compare a main answer with ‘brainstormed’ alternatives. Confabulations contribute substantially to incorrect answers given by language models. We show that semantic entropy can be used to predict many incorrect model answers and to improve question-answering accuracy by refusing to answer those questions the model is uncertain about. Corresponding to these two uses, we evaluate two main metrics. First, the widely used area under the receiver operating characteristic (AUROC) curve for the binary event that a given answer is incorrect. This measure captures both precision and recall and ranges from 0 to 1, with 1 representing a perfect classifier and 0.5 representing an un-informative classifier. We also show a new measure, the area under the ‘rejection accuracy’ curve (AURAC). This studies the case in which the confabulation detection score is used to refuse to answer the questions judged most likely to cause confabulations. Rejection accuracy is the accuracy of the answers of the model on the remaining questions and the area under this curve is a summary statistic over many thresholds (representative threshold accuracies are provided in Supplementary Material). The AURAC captures the accuracy improvement which users would experience if semantic entropy was used to filter out questions causing the highest entropy.
Method Workflow
This source was read from the branch-local PDF or Markdown sidecar and mapped for AI data extraction relevance. Treat this as an automated read-through card: useful for routing, but not a replacement for close reading when citing exact methods.
Outcomes Or Analytic Targets
Baselines. In addition to reporting results for semantic entropy, discrete semantic entropy and naive entropy, we consider two strong baselines. Embedding regression is a supervised baseline inspired by the P(IK) method24. In that paper, the authors fine-tune their proprietary LLM on a dataset of questions to predict whether the model would have been correct. This requires access to a dataset of ground-truth answers to the questions. Rather than fine-tuning the entire LLM in this way, we simply
What To Verify Before Citation-Grade Use
- Exact sample/study counts.
- Exact model/tool versions.
- Evaluation metrics and denominators.
- Whether reported accuracy concerns screening, extraction, annotation, risk-of-bias, or downstream synthesis.
- Whether humans are used as gold standard, adjudicators, reviewers, validators, or final decision makers.
logic/methods_variables_outcomes.md
Methods Variables Outcomes
Extraction-Relevant Constructs
- Branch role: `branch-adjacent context`.
- Provisional design: `needs-further-coding`.
- Top automated-data-extraction terms in source text: llm (63), gpt-4 (18), large language model (5), chatgpt (4).
Variables And Measures To Source-Check
- AI system or tool used.
- Human comparison or adjudication workflow.
- Data extraction target fields.
- Screening/extraction/annotation/risk-of-bias task definition.
- Accuracy, agreement, sensitivity, specificity, error rate, time, cost, or workload outcomes.
Extracted Evidence Sentences
- Answering unreliably or without the
necessary information prevents adoption in diverse fields, with problems including
fabrication of legal precedents5 or untrue facts in news articles6 and even posing a
risk to human life in medical domains such as radiology7.
- Researchers
need a general method for detecting hallucinations in LLMs that works even with new
and unseen questions to which humans might not know the answer.
- Here we develop
new methods grounded in statistics, proposing entropy-based uncertainty estimators
for LLMs to detect a subset of hallucinations—confabulations—which are arbitrary and
incorrect generations.
- By detecting when a prompt is likely to produce a confabulation,
our method helps users understand when they must take extra care with LLMs and
opens up new possibilities for using LLMs that are otherwise prevented by their
unreliability.
‘Hallucinations’ are a critical problem9 for natural language generation systems using large language models (LLMs), such as ChatGPT1 or
Gemini2, because users cannot trust that any given output is correct.
- Hallucinations are often defined as LLMs generating “content
that is nonsensical or unfaithful to the provided source content”9–11
but they have come to include a vast array of failures of faithfulness
and factuality.
- We focus on a subset of hallucinations which we call
‘confabulations’12 for which LLMs fluently make claims that are both
wrong and arbitrary—by which we mean that the answer is sensitive
to irrelevant details such as random seed.
- For example, when asked a
medical question “What is the target of Sotorasib?” an LLM confabulates by sometimes answering KRASG12 ‘C’ (correct) and other times
KRASG12 ‘D’ (incorrect) despite identical instructions.
- We distinguish
this from cases in which a similar ‘symptom’ is caused by the following
different mechanisms: when LLMs are consistently wrong as a result of
being trained on erroneous data such as common misconceptions13;
when the LLM ‘lies’ in pursuit of a reward14; or systematic failures of
reasoning or generalization.
- However, it does not guarantee factuality
because it does not help when LLM outputs are systematically bad.
- Nevertheless, we significantly improve question-answering accuracy for
state-of-the-art LLMs, revealing that confabulations are a great source of
error at present.
- We show how to detect confabulations by developing a quantitative measure of when an input is likely to cause an LLM to generate
arbitrary and ungrounded answers.
- Detecting confabulations allows
systems built on LLMs to avoid answering questions likely to cause
confabulations, to make users aware of the unreliability of answers
to a question or to supplement the LLM with more grounded search
or retrieval.
logic/source_scope.md
Source Scope
Strong Uses
- Use as `branch-adjacent context` in the AI Data Extraction branch.
- Use for retrieval around llm, gpt-4, large language model, chatgpt.
Weak Uses
- Do not treat this automated ARA as citation-grade for exact numbers without checking the PDF.
- Do not infer model superiority from abstract-level claims alone.
- Do not treat human-AI agreement or model confidence as validation unless the source itself defines and tests that standard.
Transfer Boundaries
- Domain, document type, extraction target, model/tool version, and human adjudication design may limit transfer to the main AI data extraction paper.
Citation-Grade Verification Needs
- Re-open `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`.
- Confirm the exact extraction task and evaluation metric.
- Confirm whether the source evaluates data extraction specifically or an adjacent task such as screening, annotation, risk-of-bias, or literature search.
logic/experiments.md
Methods And Evidence Role
- Current status: automated scaffold.
- Grounding status: `pdf_first_pages`.
- Source checking path: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`.
- Raw Markdown path: `not available`.
evidence/README.md
Evidence README
Source Pointer
- PDF: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`
- Raw Markdown: `not available`
Current Evidence State
This ARA has a scaffold-level evidence layer. Use the PDF or raw Markdown for quotation, numeric extraction, inclusion/exclusion decisions, and final manuscript claims.
Initial Excerpt
Article
Detecting hallucinations in large language
models using semantic entropy
https://doi.org/10.1038/s41586-024-07421-0
Sebastian Farquhar1,2 ✉, Jannik Kossen1,2, Lorenz Kuhn1,2 & Yarin Gal1
Received: 17 July 2023
Accepted: 12 April 2024
Published online: 19 June 2024
Open access
Check for updates
Large language model (LLM) systems, such as ChatGPT1 or Gemini2, can show
impressive reasoning and question-answering capabilities but often ‘hallucinate’
false outputs and unsubstantiated answers3,4. Answering unreliably or without the
necessary information prevents adoption in diverse fields, with problems including
fabrication of legal precedents5 or untrue facts in news articles6 and even posing a
risk to human life in medical domains such as radiology7. Encouraging truthfulness
through supervision or reinforcement has been only partially successful8. Researchers
need a general method for detecting hallucinations in LLMs that works even with new
and unseen questions to which humans might not know the answer. Here we develop
new methods grounded in statistics, proposing entropy-based uncertainty estimators
for LLMs to detect a subset of hallucinations—confabulations—which are arbitrary and
incorrect generations. Our method addresses the fact that one idea can be expressed
in many ways by computing uncertainty at the level of meaning rather than specific
sequences of words. Our method works across datasets and tasks without a priori
knowledge of the task, requires no task-specific data and robustly generalizes to new
tasks not seen before. By detecting when a prompt is likely to produce a confabulation,
our method helps users understand when they must take extra care with LLMs and
opens up new possibilities for using LLMs that are otherwise prevented by their
unrelia
evidence/passages/readthrough_key_passages.md
Read-Through Key Passages
Abstract Or Opening
Detecting hallucinations in large language models using semantic entropy https://doi.org/10.1038/s41586-024-07421-0
Methods
aim to ‘learn’ how to detect confabulations from a set of example demonstrations. Our method is unsupervised, meaning that we do not need labelled examples of confabulations. By contrast, supervised methods detect confabulations by learning patterns behind examples of confabulations, assuming that future questions preserve these patterns. But this assumption is often untrue in new situations or with confabulations that human overseers are unable to identify (compare Fig. 17 of ref. 24). As a strong supervised baseline, we compare to an embedding regression method inspired by ref. 24 which trains a logistic regression classifier to predict whether the model correctly answered a question on the basis of the final ‘embedding’ (hidden state) of the LLM. We also use the P(True) method24 which looks at the probability with which an LLM predicts that the next token is ‘True’ when few-shot prompted to compare a main answer with ‘brainstormed’ alternatives. Confabulations contribute substantially to incorrect answers given by language models. We show that semantic entropy can be used to predict many incorrect model answers and to improve question-answering accuracy by refusing to answer those questions the model is uncertain about. Corresponding to these two uses, we evaluate two main metrics. First, the widely used area under the receiver operating characteristic (AUROC) curve for the binary event that a given answer is incorrect. This measure captures both precision and recall and ranges from 0 to 1, with 1 representing a perfect classifier and 0.5 representing an un-informative classifier. We also show a new measure, the area under the ‘rejection accuracy’ curve (AURAC). This studies the case in which the confabulation detection score is used to refuse to answer the questions judged most likely to cause confabulations. Rejection accuracy is the accuracy of the answers of the model on the remaining questions and the area under this curve is a summary statistic over many thresholds (representative threshold accuracies are provided in Supplementary Material). The AURAC captures the accuracy improvement which users would experience if semantic entropy was used to filter out questions causing the highest entropy.
Results Or Findings
Baselines. In addition to reporting results for semantic entropy, discrete semantic entropy and naive entropy, we consider two strong baselines. Embedding regression is a supervised baseline inspired by the P(IK) method24. In that paper, the authors fine-tune their proprietary LLM on a dataset of questions to predict whether the model would have been correct. This requires access to a dataset of ground-truth answers to the questions. Rather than fine-tuning the entire LLM in this way, we simply
Discussion Or Conclusion
Acknowledgements We thank G. Irving, K. Perlin, J. Richens, L. Rimell and M. Turpin for their comments or discussion related to this work. We thank K. Handa for his help with the human evaluation of our automated accuracy assessment. We thank F. Bickford Smith and L. Melo for their code review. Y.G. is supported by a Turing AI Fellowship funded by the UK government’s Office for AI, through UK Research and Innovation (grant reference EP/V030302/1), and delivered by the Alan Turing Institute. Author contributions S.F. led the work from conception to completion and proposed using bidirectional entailment to cluster generations as a way of computing entropy in LLMs. He wrote the main text, most of the Methods and Supplementary Information and prepared most of the figures. J.K. improved the mathematical formalization of semantic entropy; led the extension of semantic entropy to sentence- and paragraph-length generations; wrote the code for, and carried out, all the experiments and evaluations; wrote much of the Methods and Supplementary Information and prepared drafts of many figures; and gave critical feedback on the main text. L.K. developed the initial mathematical formalization of semantic entropy; wrote code for, and carried out, the initial experiments around semantic entropy and its variants which demonstrated the promise of the idea and helped narrow down possible research avenues to explore; and gave critical feedback on the main text. Y.G. ideated the project, proposing the idea to differentiate semantic and syntactic diversity as a tool for detecting hallucinations, provided high-level guidance on the research and gave critical feedback on the main text; he runs the research laboratory in which the work was carried out. Competing interests S.F. is currently employed by Google DeepMind and L.K. by OpenAI. For both, this paper was written under their University of Oxford affiliation. The remaining authors declare no competing interests. Additional information Supplementary information The online version contains supplementary material available at https://doi.org/10.1038/s41586-024-07421-0. Correspondence and requests for materials should be addressed to Sebastian Farquhar. Peer review information Nature thanks Mirella Lapata and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Reprints and permissions information
Limitations
Metrics and accuracy measurements. We use three main metrics to evaluate our method: AUROC, rejection accuracy and AURAC. Each of these is grounded in an automated factuality estimation measurement relative to the reference answers provided by the datasets that we use. AUROC, rejection accuracy and AURAC. First, we use the AUROC curve, which measures the reliability of a classifier accounting for both precision and recall. The AUROC can be interpreted as the probability that a randomly chosen correct answer has been assigned a higher confidence score than a randomly chosen incorrect answer. For a perfect classifier, this is 1. Second, we compute the ‘rejection accuracy at X%’, which is the question-answering accuracy of the model on the most-confident X% of the inputs as identified by the respective uncertainty method. If an uncertainty method works well, predictions on the confident subset should be more accurate than predictions on the excluded subset and the rejection accuracy should increase as we reject more inputs. To summarize this statistic we compute the AURAC—the total area enclosed by the accuracies at all cut-off percentages X%. This should increase towards 1 as given uncertainty method becomes more accurate and better at detecting likely-inaccurate responses but it is more sensitive to the overall accuracy of the model than the AUROC metric. In Supplementary Note 5, we provide the unaggregated rejection accuracies for sentence-length generations. Assessing accuracy. For the short-phrase-length generation setting presented in Supplementary Note 7, we simply assess the accuracy of the generations by checking if the F1 score of the commonly used SQuAD metric exceeds 0.5. There are limitations to such simple scoring rules63 but this method is widely used in practice and its error is comparatively small on these standard datasets. For our default scenario, the longer sentence-length generations, this measure fails, as the overlap between the short reference answer and our long model answer is invariably too small. For sentence-length generations, we therefore automatically determine whether an answer to the question is correct or incorrect by using GPT-4 to compare the given answer to the reference answer. We use the template: We are assessing the quality of answers to the following question: {question} The expected answer is: {reference answer} The
evidence/tables/readthrough_evidence_map.md
Read-Through Evidence Map
| Field | Automated read-through value |
|---|---|
| Source PDF | `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf` |
| Raw Markdown | `missing` |
| Grounding | `pdftotext-full` |
| Provisional design | `needs-further-coding` |
| Branch role | `branch-adjacent context` |
| Top terms | llm (63), gpt-4 (18), large language model (5), chatgpt (4) |
| Verification status | Needs human source-checking before exact citation |
level1_report.md
Level 1 Report
- `PAPER.md`: present.
- Source PDF: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`.
- Raw Markdown: `missing`.
- Source note: `wiki/sources/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.md`.
- Required scaffold folders: present.
- Status: `automated-level-1`.
level3_report.md
Level 3 Report
- Automated read-through completed: 2026-05-12.
- Status assigned: `automated-level-3`.
- Source considered: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`.
- Evidence files added:
- `evidence/passages/readthrough_key_passages.md`
- `evidence/tables/readthrough_evidence_map.md`
- Logic files added/refreshed:
- `logic/method_and_design.md`
- `logic/methods_variables_outcomes.md`
- `logic/source_scope.md`
- Remaining work: human close-reading curation before `curated-level-3`.
readthrough_result.md
Read-Through Result
Source Identity Check
- Title: Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy
- Source PDF: `raw/Farquhar et al. - 2024 - Detecting hallucinations in large language models using semantic entropy.pdf`
- Raw Markdown: `missing`
- Grounding used: `pdftotext-full`
Content Read-Through
The source was read through using full PDF text when available, with Markdown sidecar fallback. It was selected because it matched automated data extraction, LLM/AI evidence synthesis, screening, annotation, or related review-automation terms.
Methods And Design Check
- Provisional design: `needs-further-coding`
- Branch role: `branch-adjacent context`
Results Or Findings Check
Baselines. In addition to reporting results for semantic entropy, discrete semantic entropy and naive entropy, we consider two strong baselines. Embedding regression is a supervised baseline inspired by the P(IK) method24. In that paper, the authors fine-tune their proprietary LLM on a dataset of questions to predict whether the model would have been correct. This requires access to a dataset of ground-truth answers to the questions. Rather than fine-tuning the entire LLM in this way, we simply
Theory And Concept Check
- [[AI Data Extraction]]
- [[Evidence Synthesis Automation]]
- [[Human-AI Validation]]
- [[LLM Accuracy]]
- [[Speed-Accuracy Tradeoff]]
Noise Removed
This pass did not preserve title-page boilerplate as claims. It wrote concise method/scope/evidence files and left exact quotation to source checking.
Open Verification Needs
- Verify exact methods, sample sizes, field definitions, and metrics in the PDF.
- Distinguish direct data extraction evidence from adjacent tasks.
- Add parser-compatible APA relations only after close manual comparison with neighboring ARAs.
Final Read-Through Status
`automated-readthrough-complete`; do not treat as `curated-level-3`.