Prediction of Prediction (PoP): Inter-Layer Activation Fusion for Single-Pass Hallucination Detection in Large Language Models
Abstract
Autoregressive large language models (LLMs) routinely generate factually incorrect outputs with high decoding confidence, limiting their deployment in high-stakes workflows. Existing output-stage uncertainty metrics can fail when models are overconfident on false assertions, while multi-sample verification pipelines introduce substantial memory and latency overhead. This work evaluates whether internal hidden-state transition dynamics during generation can signal factual errors without auxiliary decoding calls. We introduce Prediction of Prediction (PoP), a mechanism that captures layer-transition uncertainty by fusing intermediate hidden representations across depth during a single forward pass. Evaluated on the TruthfulQA benchmark using autoregressive transformer backbones, PoP achieves an area under the receiver operating characteristic curve (AUROC) of 75.5% for factual-correctness classification. The mechanism operates within the base forward pass, adding less than 1.2% runtime latency and requiring zero additional generation passes. The numerical results are reported from the author-verified experimental implementation and are bounded by the evaluation scope described below.
Figures & tables
| Family | Signal source | PoP comparison question |
|---|---|---|
| Output-only | Logits, entropy, perplexity | Do transitions add information beyond output uncertainty? |
| Multi-sample | Multiple meanings/completions | Does one-pass inference reduce the cost fairly? |
| Static probe | One hidden layer | Do ordered transitions beat the best single layer? |
| Dynamic internal | Layer or temporal trajectories | Is the transition statistic mathematically distinct? |
| Attention/ graph | Attention, spectra, routing, graphs | Does PoP improve the matched-cost frontier? |
| Component | Specification |
|---|---|
| Model families | Llama-3-8B-Instruct; Qwen2.5-7B-Instruct; Mistral-7B-Instruct-v0.2 |
| Precision | FP16 or BF16 native precision |
| Decoding | Greedy, temperature 0.0; nucleus, temperature 0.7, |
| Maximum length | 256 generated tokens |
| Datasets | TruthfulQA; HaluEval 2.0; FaithDial |
| Split | 70% train, 15% validation, 15% test, stratified by factual label |
| Family | Methods included |
|---|---|
| Output-only heuristics | Token-logit entropy; sequence predictive perplexity; final-layer vocabulary-logit margin |
| Multi-sample and post-hoc | Semantic entropy with generations; external DeBERTa-v3-large NLI entailment scoring |
| Static internal probing | LDA and logistic regression on isolated mid-layer and final-layer hidden states |
| Dynamic internal and spectral | Residual-stream norm growth; attention-head entropy dispersion; layer-wise spectral geometry distance |
| Method | Type | TQ AUC | TQ AP | TQ P@R90 | HE AUC | HE AP | HE P@R90 |
|---|---|---|---|---|---|---|---|
| Logit entropy | Output | 54.2% | 51.8% | 22.4% | 52.1% | 49.3% | 18.7% |
| Perplexity | Output | 56.1% | 53.4% | 24.1% | 55.0% | 52.6% | 21.0% |
| Static probe, | Static | 63.8% | 61.2% | 35.6% | 61.4% | 58.9% | 31.2% |
| Static probe, | Static | 66.1% | 64.0% | 39.8% | 64.2% | 62.1% | 36.5% |
| Spectral geometry | Dynamic | 68.4% | 66.7% | 43.1% | 67.0% | 65.2% | 40.8% |
| Semantic entropy, | Multi-sample | 74.1% | 72.8% | 51.3% | 72.8% | 71.0% | 48.6% |
| Configuration | ECE | Brier | Pre- cision | Recall | F1 |
|---|---|---|---|---|---|
| Uncalibrated PoP | 0.142 | 0.188 | 68.4% | 76.2% | 0.721 |
| Platt-calibrated PoP, , | 0.031 | 0.124 | 73.1% | 74.5% | 0.738 |
| Method | Extra calls | Latency | VRAM overhead | Through- put penalty |
|---|---|---|---|---|
| Unhooked base LLM | 0 | 24.1 ms/token | 0.0 MB | 0.0% |
| PoP (ours) | 0 | 24.4 ms/token | 18.4 MB | 1.2% |
| Spectral geometry | 0 | 31.8 ms/token | 142.0 MB | 31.9% |
| Semantic entropy, | 4 auxiliary generations | 120.5 ms/token | 0.0 MB | 400.0% |
| External DeBERTa NLI | 1 auxiliary pass | 48.2 ms/token | 1740.0 MB | 100.0% |
| Backbone | Dataset/ domain | Zero-shot AUROC | |
|---|---|---|---|
| Llama-3-8B-Instruct | TruthfulQA, in-domain | 75.5% | – |
| Llama-3-8B-Instruct | FaithDial, dialogue | 72.1% | -3.4% |
| Qwen2.5-7B-Instruct | TruthfulQA | 73.8% | -1.7% |
| Mistral-7B-Instruct-v0.2 | TruthfulQA | 72.4% | -3.1% |
| Mistral-7B-Instruct-v0.2 | HaluEval, QA/dialogue | 71.2% | -4.3% |
| Pertur- bation | Control | Base | Pert. | |
|---|---|---|---|---|
| Entity swap | Factual validity flips; syntax retained | 75.5% | 74.8% | -0.7% |
| Style transformation | Register changes; factual status constant | 75.5% | 75.2% | -0.3% |
| Paraphrase | Surface form changes; meaning constant | 75.5% | 74.9% | -0.6% |
| Distractor context | Irrelevant facts appended | 75.5% | 73.8% | -1.7% |
| Temperature 0.7 | Nucleus sampling increases variation | 75.5% | 73.1% | -2.4% |
| Configuration | AUROC | |
|---|---|---|
| Full PoP framework | 75.5% | – |
| Best single layer, | 66.8% | -8.7% |
| Static features only | 67.2% | -8.3% |
| Transition features only | 70.1% | -5.4% |
| No layer normalization | 68.9% | -6.6% |
| Shuffled layer order | 58.3% | -17.2% |
Language Model Error Detection
Language model error detection identifies unreliable answers, reasoning steps, and actions so systems can flag, verify, or repair them.
See all 90 papers