REVIEW 2 major objections 5 minor 20 references
AggTruth: Contextual Hallucination Detection using Aggregated Attention Scores in LLMs
T0 review · 2 major / 5 minor · reviewed 2026-08-06 · deepseek-v4-flash
Pith's one-line read AggTruth detects contextual hallucinations in LLM outputs online by aggregating attention scores over the source passage, and it transfers across QA and summarization tasks and across four LLMs.
desk verdict Useful passage-only attention aggregation for hallucination detection, but the headline AUROCs are likely optimistic because best configurations were selected on test-set Gap. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The mechanism is the passage-only attention aggregate: for each layer $l$, head $h$, and generated token $t$, the attention scores over the context tokens are reduced to one scalar by one of four formulas. Sum simply adds the attention placed on passage tokens; CosSim averages the cosine similarity between a head and all other heads in the same layer; Entropy treats the attention vector as a pseudo-probability distribution; and JS-Div measures the Jensen-Shannon distance between a head's attention and the layer's average head, with an extra appended value so the pseudo-distribution sums to one. These scalars become features for an eight-token sliding window, and the window label is positive if GPT-4o judged any token in it hallucinated; a logistic-regression classifier then makes the final decision. The paper's additional machinery is head selection: it reduces the feature set via Spearman correlation with the target, a simplified Boruta-style 'above random' selector, Lasso, or a center-ratio baseline.
What would settle it
Re-annotate a random sample of, say, 400 responses with token-level human labels, ideally with two or more annotators per token, and recompute the AUROC of the best AggTruth configuration against these human labels instead of GPT-4o labels. If the AUROC drops to near random, the method is detecting the judge's labeling style rather than hallucination; if it stays high, the central claim survives.
Extended reading notes
Core claim
The central discovery is that you do not need the full attention map, hidden states, or multiple sampled generations to detect contextual hallucinations: the attention scores the model assigns to the provided passage, aggregated per head per generated token, carry enough signal. AggTruth reduces the attention tensor to a single scalar per layer-head for each generated token, by summing the scores over passage tokens, by measuring how similar each head is to its layer-mates, or by treating the attention distribution as a pseudo-probability and measuring its entropy or Jensen-Shannon distance to the layer average. These per-token features are then windowed into overlapping chunks of eight tokens, labeled by GPT-4o as containing a hallucination or not, and fed to a logistic-regression classifier. In same-task and cross-task tests across four LLMs on Natural Questions, HotPotQA, CNN/Daily Mail, and XSum, the authors find that AggTruth variants achieve small gaps between source and target test performance and outperform hidden-state classifiers and, where comparable, the Lookback Lens baseline. The paper also finds that selecting a subset of attention heads, often 10 to 50 percent, can improve or preserve performance compared with using all heads.
Load-bearing premise
Every reported accuracy figure assumes GPT-4o's token-level hallucination labels are trustworthy; the only human check covered 75 samples and reached moderate agreement (a Cohen's Kappa of 0.7), so if GPT-4o's judgment is biased, the detector is really predicting GPT-4o's notion of hallucination rather than ground truth.
Editorial extensions
If this is right
- A retrieval-augmented generation system using AggTruth could detect hallucinated tokens while the answer is still being generated, making post-hoc correction unnecessary.
- Because the features come only from attention on the source passage, the detector transfers between question answering and summarization and across four different LLMs without target-task retraining.
- Selecting a subset of attention heads, often between 10 and 50 percent, can match or slightly beat using all heads, so the classifier can be trained and run more cheaply.
- The Sum aggregation is the recommended default: it is the fastest, most interpretable, and most stable variant across the tested settings.
Reading between the lines
- Beyond the paper: because AggTruth only needs attention onto a reference passage, the same recipe could apply to other grounded-generation tasks such as dialogue grounded in retrieved documents, clinical note generation, or legal citation, but the paper only tests QA and summarization, so this is an open question.
- Beyond the paper: all responses were generated with greedy decoding; under sampling or higher temperatures the attention distributions would shift, so thresholds and head subsets would likely need recalibration, a setting the paper does not evaluate.
- Beyond the paper: the paper itself notes that AggTruth requires access to attention scores for context tokens, which flash-attention and sparse or window attention implementations do not offer, so deployment is restricted to models that expose raw attention maps, and those regimes are left untested.
- Beyond the paper: since GPT-4o supplied the training labels, a fully human-annotated benchmark would clarify whether AggTruth detects unfaithfulness itself or merely predicts the judge's labeling style.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes AggTruth, an online, windowed hallucination detector for RAG settings that uses attention scores restricted to the provided passage, aggregated via four techniques (Sum, CosSim, Entropy, JS-Div). A Logistic Regression classifier is trained on token-level labels produced by GPT-4o, with features optionally selected by several head-selection methods (Center, Random/Random+, Lasso, Spearman). The method is evaluated on QA and summarization datasets across four LLMs, comparing against Lookback Lens and hidden-state baselines in same-task and cross-task settings. The authors report that AggTruth achieves high and stable AUROC values and outperforms baselines in multiple scenarios, and that head selection can improve performance while reducing the number of heads.
Significance. If the reported results hold, AggTruth offers a practical, interpretable, and computationally light approach to detecting contextual hallucinations during decoding, with the passage-only attention aggregation being a simple and reusable feature. The strengths of the paper include evaluation across four LLMs and four datasets, comparison against a recent SOTA (Lookback Lens) and hidden-state baselines, and a systematic exploration of feature/head selection. However, the central claim of 'high and stable results' rests on two assumptions that need tightening: the labels are generated by GPT-4o with only a small human check, and the reported configurations are selected based on test-set Gap values, which risks optimistic bias. The paper's contribution is valuable, but these issues must be addressed before the headline claim is secure.
major comments (2)
- [Section 5, Eq. (5), Table 5, Table 6] The central outperformance claim in Section 7 is based on Tables 5 and 6, which report 'best obtained results w.r.t. Gap value.' Since Gap (Eq. 5) is computed on the three test sets, the selection of the aggregation variant, selector, and head percentage is performed using test-set performance. This is selection on the test set, which inflates expected AUROC. For example, in Table 5, for Llama-2 QA→SUM, Random+3,3 reduces Gap from 6.836 to 2.048 relative to no selection; for Gemma-2 SUM→QA, Spearman0.1 reduces Gap from 8.642 to 5.901. No validation-based selection protocol or multiple-comparison correction is described. The paper should either fix the configuration using only training/validation data before computing test AUROC, or use nested cross-validation, and then report the resulting test numbers as the primary results.
- [Section 4.1] All token-level labels are produced by GPT-4o, with human agreement checked on only 75 samples (Cohen's Kappa 0.7). If GPT-4o's judgments are biased or noisy, the classifier learns to predict GPT-4o's notion of hallucination rather than true unfaithfulness, and every reported AUROC inherits this label assumption. The paper should provide evidence that the GPT-4o labels are reliable on a larger human-annotated sample, or use human labels as ground truth for at least one full dataset to confirm the ranking of methods.
minor comments (5)
- [Section 3.2] The description of the Center selector is ambiguous: 'keep the top r/2 fraction of heads with the highest ratio and r/2 fraction with the lowest ratio' should clarify whether r is the total fraction of selected heads and how ties are broken.
- [Table 1] The column labeled 'truthfulness evaluation results' reports percentages that look like hallucination rates, but the caption does not state this explicitly. Please clarify whether higher percentages mean more hallucinations or more truthful responses.
- [Figure 4 caption] The caption says 'best obtained hidden states-based method w.r.t. Gap value,' which again implies selection on the test set; this should be reworded to avoid reinforcing the impression of test-set selection in the main results.
- [Section 4, Experimental Setup] The windowing procedure is described as 'overlapping chunks of size 8, sliding token by token,' but the degree of overlap and the label assignment for a chunk that contains both hallucinated and non-hallucinated tokens are not fully specified; please define this precisely.
- [Throughout] There are numerous formatting typos (e.g., 'T able 1', 'AggT ruth' in Table 5, 'AUCROC' instead of 'AUROC') that should be corrected in a revision.
Circularity Check
No derivation-to-fit circularity; central claim rests on an empirical classifier comparison, with test-set-based selector choice and GPT-4o labels as validity (not circularity) concerns.
full rationale
AggTruth is a supervised classifier: the four aggregation features (Eqs. 1-4) and the passage-percentage feature are computed from attention maps, while the token-level labels are produced by GPT-4o independently of those features. There is therefore no equation whose output is defined by a fitted parameter or by the target label; the training/evaluation loop is a standard fit-and-test design against external baselines (Lookback Lens, hidden-state classifiers, and an NLI-based SOTA). The paper's self-citations ([4], [10]) are contextual and do not carry the derivation. The two genuine concerns are statistical rather than circular: (i) Tables 5-6 report 'best obtained results w.r.t. Gap value,' meaning the selector and head percentage are chosen by minimizing a Gap defined on the three test sets (Eq. 5), which can bias reported AUROCs upward; and (ii) token labels come from GPT-4o with only 75 human samples (Cohen's Kappa 0.7), so the classifier may learn GPT-4o's notion of hallucination rather than an independent ground truth. Neither concern makes AggTruth's output equivalent to its inputs by construction, so no circular step is identified.
Assumptions & free parameters
free parameters (3)
- window size =
8
- selector hyperparameters (r, n, k) =
various, e.g., Center0.2, Random+3,3, Spearman1.0
- significance thresholds =
p=0.001 for Spearman, p=0.01 for Welch's t-test
assumptions (4)
- domain assumption GPT-4o token-level labels are a valid ground truth for contextual hallucination
- domain assumption Attention map from generating token t+1 describes token t
- domain assumption Attention scores can be aggregated arithmetically across context tokens and heads
- domain assumption Sliding window attention can be handled by restricting context to 4096 tokens
Cite this review
Pith. "Pith review of AggTruth: Contextual Hallucination Detection using Aggregated Attention Scores in LLMs." pith.science (2026). https://pith.science/paper/X2EBIQY6
@misc{pith2026250618628,
author = {Pith},
title = {Pith review of: AggTruth: Contextual Hallucination Detection using Aggregated Attention Scores in LLMs},
year = {2026},
howpublished = {\url{https://pith.science/paper/X2EBIQY6}},
note = {Machine review of arXiv:2506.18628}
}
read the original abstract
In real-world applications, Large Language Models (LLMs) often hallucinate, even in Retrieval-Augmented Generation (RAG) settings, which poses a significant challenge to their deployment. In this paper, we introduce AggTruth, a method for online detection of contextual hallucinations by analyzing the distribution of internal attention scores in the provided context (passage). Specifically, we propose four different variants of the method, each varying in the aggregation technique used to calculate attention scores. Across all LLMs examined, AggTruth demonstrated stable performance in both same-task and cross-task setups, outperforming the current SOTA in multiple scenarios. Furthermore, we conducted an in-depth analysis of feature selection techniques and examined how the number of selected attention heads impacts detection performance, demonstrating that careful selection of heads is essential to achieve optimal results.
Figures
Figures from the paper (1 more)
Reference graph
Works this paper leans on
- [1]
-
[2]
Chuang, Y.S., et al.: Lookback lens: Detecting and mitigating contextual halluci- nations in large language models using only attention maps (2024)
work page 2024
-
[3]
Nature630(8017), 625–630 (Jun 2024)
Farquhar, S., et al.: Detecting hallucinations in large language models using se- mantic entropy. Nature630(8017), 625–630 (Jun 2024)
work page 2024
-
[4]
Ferdinan, T., et al.: Into the unknown: Self-learning large language models. In: SENTIRE at ICDM’2024. pp. 423–432. IEEE (2024)
work page 2024
-
[5]
Gekhman, Z., et al.: Does fine-tuning llms on new knowledge encourage hallucina- tions? (2024), https://arxiv.org/abs/2405.05904
arXiv 2024
-
[6]
Gemma, T., et al.: Gemma 2: Improving open language models at a practical size (2024), https://arxiv.org/abs/2408.00118
arXiv 2024
- [7]
-
[8]
ACM Com- puting Surveys 55(12), 1–38 (Mar 2023)
Ji, Z., et al.: Survey of hallucination in natural language generation. ACM Com- puting Surveys 55(12), 1–38 (Mar 2023)
work page 2023
Show all 20 references
-
[9]
Ke, Z., et al.: Continual training of language models for few-shot learning (2022), https://arxiv.org/abs/2210.05549
2022 arXiv
-
[10]
Information Fusion 99, 101861 (2023)
Kocoń, J., et al.: Chatgpt: Jack of all trades, master of none. Information Fusion 99, 101861 (2023)
2023
-
[11]
Journal of statistical software36, 1–13 (2010)
Kursa, M.B., Rudnicki, W.R.: Feature selection with the boruta package. Journal of statistical software36, 1–13 (2010)
2010
-
[12]
Transactions of the ACL7, 452–466 (2019)
Kwiatkowski, T., et al.: Natural questions: A benchmark for question answering research. Transactions of the ACL7, 452–466 (2019)
2019
-
[13]
Lewis, P., et al.: Retrieval-augmented generation for knowledge-intensive nlp tasks (2021), https://arxiv.org/abs/2005.11401
2021 arXiv
-
[14]
Manakul, P., et al.: Selfcheckgpt: Zero-resource black-box hallucination detection for generative large language models (2023), https://arxiv.org/abs/2303.08896
2023 arXiv
-
[15]
Narayan, S., et al.: Don’t give me the details, just the summary! topic-aware con- volutional neural networks for extreme summarization (2018)
2018
-
[16]
In: Findings of the Association for Computational Linguistics: EMNLP 2023 (2023)
Peng, B., Alcaide, E., et al.: Rwkv: Reinventing rnns for the transformer era. In: Findings of the Association for Computational Linguistics: EMNLP 2023 (2023)
2023
-
[17]
In: ACL 2017
See, A., et al.: Get to the point: Summarization with pointer-generator networks. In: ACL 2017. pp. 1073–1083. ACL (2017)
2017
-
[18]
Yang, Z., et al.: Hotpotqa: A dataset for diverse, explainable multi-hop question answering (2018), https://arxiv.org/abs/1809.09600
2018 arXiv
-
[19]
0.858 0.853 0.731 0.587 0.713 5.639 Spearman1.0 SUM
Zhao, W.X., et al.: A survey of large language models (2024), https://arxiv.org/abs/2303.18223 A Appendix LLM AggT ruth Selector Source T arget Source T arget Gap [%] T rain V al T est T est (1) T est (2) llama-2-7b- chat-hf CosSim Lasso QA SUM. 0.858 0.853 0.731 0.587 0.713 5...
2024 arXiv
-
[2023]
pp. 967–976. ACL, Singapore (Dec 2023)
2023
Reviewed August 6, 2026 · model on record in the stance chip above.
Discussion (0). Continue with ORCID to comment.