How LLMs Detect and Correct Their Own Errors: The Role of Internal Confidence Signals

Dharshan Kumaran, Viorica Patraucean, Simon Osindero, Petar Veličković, Nathaniel DawarXiv 2026

TL;DR

Large language models (LLMs) naturally implement a "second-order" confidence mechanism from decision neuroscience, caching an internal evaluative signal at the token immediately following an answer (the post-answer newline, or PANL). This hidden signal not only detects when the model has made an error but uniquely predicts whether the model has the latent knowledge required to successfully fix it—even when all overt behavioral signals completely fail.

What Problem Does This Paper Address?

Large language models frequently demonstrate an ability to catch and fix their own mistakes without external feedback, a phenomenon known as intrinsic self-correction. However, the underlying cognitive mechanics driving this behavior have remained a mystery.

The authors tackle this problem through the lens of decision neuroscience, contrasting two frameworks:

  1. First-Order Models: Confidence is derived directly from the decision-making process itself (in LLMs, this corresponds to token log-probabilities during generation). Under greedy decoding, the chosen token always has the highest probability, meaning a purely first-order system has no baseline to conclude it made an error.
  2. Second-Order Models: Confidence arises from a separate, partially independent evaluative process ($X_{eval}$) that inspects the generated response post-hoc and can disagree with it.

This paper investigates whether LLMs possess such a second-order mechanism, where it lives in their internal representations, and whether it can predict both error detection and downstream correction success.

Figure 1: Left panel: Verification and self-correction prompt structure (see §A.2 for full details). The model’s answer and verbal confidence were generated in a separate prior phase. In the verification phase, the model is shown its own answer to a TriviaQA (or MNLI) question and asked to judge whether it is correct (Y/N), followed by a self-correction prompt. Residual stream activations were extracted during the verification phase at the post-answer newline token (PANL, indicated by arrow)— the first token after the model’s answer following (Kumaran et al., 2026). Right panel: Second- order model of confidence, adapted from Fleming & Daw (2017). Left side (dashed box): the first- order model (FOM), in which a generation process produces an answer (here via greedy decoding) and the associated log-probabilities (Xact) are the only available confidence signal. Under greedy decoding, Xact — and therefore confidence—is by definition maximal for the chosen answer, so a purely first-order system cannot conclude it erred. Right side: the second-order extension, in which the completed answer engages a qualitatively distinct evaluative process that assesses question–answer fit by attending backward over the full response—a different computation from the retrieval process that produced it (see text for details). Because this evaluation performs a different computation over the model’s knowledge, it can shift the internal distribution over possible answers such that the committed answer (A1) is no longer the mode (now A2). The resulting evaluative signal (Xeval; termed Xconf in the original framework), encoded at answer-adjacent token positions (PANL), is partially independent of Xact and drives verbal confidence, error detection, and self-correction.

Methods

The authors employ a verify-then-correct paradigm across three distinct phases:

  • Phase 0 (Generation): The model generates a concise answer along with an overt verbal confidence rating (e.g., "Almost certain").
  • Phase 1 (Verification): The model is shown the question and its own answer, and is asked to verify if it is correct ("Y/N").
  • Phase 2 (Self-Correction): If an error is flagged, the model attempts to provide the revised correct answer.

To look under the hood, the researchers use several advanced interpretability techniques:

  • Linear Probing: They train L2-regularized logistic regression classifiers on the model's internal residual stream activations. They focus specifically on the Post-Answer Newline (PANL) token—the very first token after the answer is finalized. Due to causal attention masks, PANL can look back at the entire question-answer pair but is processed before the model sees any explicit verification instructions.
  • Causal Interventions: To prove the PANL signal causally drives behavior, they use activation patching (corrupting answer token embeddings and selectively restoring clean activations at specific layers) and mean ablation (noising activations to test necessity).
  • Foil Experiments: They test whether the model's error detection generalizes by swapping its own answers with external "foils" (plausible but incorrect answers generated by GPT-4o).

Datasets

The experiments were validated across two primary benchmarks using Gemma 3 27B and Qwen 2.5 7B:

  • TriviaQA: A large-scale open-domain factual question-answering dataset used to evaluate real-world knowledge retrieval.
  • MNLI (Multi-Genre Natural Language Inference): A text entailment dataset. The authors restricted their focus to neutral trials to ensure meaningful verification variability.

Key Insights and Ideas

  • The PANL Token acts as an Evaluative Cache: The post-answer newline token acts like a cognitive switchboard. It automatically computes a backward-looking summary of "question-answer fit" before a verification prompt is even presented. This is analogous to the psychological distinction between recall (generating the answer) and recognition (evaluating if the answer looks right).
  • Hidden Knowledge of Correctability: The most striking insight is that the model internally knows whether it is capable of fixing an error. While behavioral outputs (verbal confidence, verification choices) are entirely blind to whether a correction attempt will succeed, the hidden activations at the PANL token hold this predictive information.
  • Spontaneous Metacognition: LLMs are not explicitly trained to have a second-order metacognitive layer; this architecture emerges spontaneously from standard autoregressive pre-training.

Key Results

  • Ruling out First-Order Accounts: Verbal confidence significantly outperformed token log-probabilities at predicting error detection (AUROC of 0.832 vs 0.668 on TriviaQA), proving that self-evaluation is decoupled from generation fluency.
  • PANL Outperforms Overt Behavior: Linear probes trained on PANL activations at layer 30 predicted verification responses with an outstanding AUROC of 0.986 across all trials, and 0.958 within incorrect trials only, far exceeding any combination of behavioral metrics.
Figure 3: Linear probing results across layers for three targets: A: verification response (all trials), B: verification response (incorrect trials only), C: A2 correctness (incorrect trials that changed answer). Probes are L2-regularised logistic regression (C = 0.001, 5-fold CV) on residual stream activations at four token positions: question third token (control), last answer token (LAT), post-answer newline (PANL), and prompt last token. The dashed green line indicates the best behavioural baseline (see Table A1). PANL exceeds the behavioural baseline across all three targets at mid-to-upper layers, with the largest margin for A2 correctness among changed incorrect trials (C), where behavioural predictors are at chance. The control position shows no improvement for any target. D: Distribution of PANL L30 probe scores (trained on verification Y/N) within incorrect trials, split by verification response. The probe cleanly separates correct rejections (CR; model detected its error) from false alarms (FA; model missed its error), with minimal overlap near the decision boundary (AUROC = .892). This signal is encoded at PANL during the answer phase, before the verification instruction is presented.
  • Predicting Correctability: For incorrect trials where the model decided to change its answer, behavioral signals were completely at chance (AUROC 0.475) at predicting whether the new answer would be correct. However, the PANL probe successfully predicted correction success with an AUROC of 0.614 on TriviaQA and a massive 0.862 on MNLI neutral trials.
  • Causal Sufficiency: Activation patching confirmed that restoring clean activations at the PANL position alone was sufficient to rescue up to 74% of error-detection performance, even when the answer tokens themselves were completely corrupted.

Limitations and Future Work

  • Absence of Reasoning Traces: This study focused entirely on short, factual QA and classification tasks without Chain-of-Thought (CoT) reasoning. It remains to be seen how these second-order signals behave when a model evaluates a multi-step reasoning trace.
  • Task-Specific Correctability Directions: While the error-detection signal generalized well across tasks, the correctability directions were highly task-specific. A probe trained to predict if a trivia answer can be fixed shows near-zero transfer when applied to an NLI task.
  • Practical Exploitation: The authors note that monitoring PANL activations could allow developers to build selective backtracking mechanisms (only attempting self-correction when internal states signal the model actually has the knowledge to fix it), but implementing this during active decoding is left to future work.

Summary updated

Abstract

Large language models can detect their own errors and sometimes correct them without external feedback, but the underlying mechanisms remain unknown. We investigate this through the lens of second-order models of confidence from decision neuroscience. In a first-order system, confidence derives from the generation signal itself and is therefore maximal for the chosen response, precluding error detection. Second-order models posit a partially independent evaluative signal that can disagree with the committed response, providing the basis for error detection. Kumaran et al. (2026) showed that LLMs cache a confidence representation at a token immediately following the answer (i.e. post-answer newline: PANL) -- that causally drives verbal confidence and dissociates from log-probabilities. Here we test whether this PANL signal extends beyond confidence to support error detection and self-correction. Here we test whether this signal supports error detection and self-correction, deriving predictions from the second-order framework. Using a verify-then-correct paradigm, we show that: (i) verbal confidence predicts error detection far beyond token log-probabilities, ruling out a first-order account; (ii) PANL activations predict error detection beyond verbal confidence itself; and (iii) PANL predicts which errors the model can correct -- where all behavioural signals fail. Causal interventions confirm that PANL signals rescue error detection behavior when answer information is corrupted. All findings replicate across models (Gemma 3 27B and Qwen 2.5 7B) and tasks (TriviaQA and MNLI). These results reveal that LLMs naturally implement a second-order confidence architecture whose internal evaluative signal encodes not only whether an answer is likely wrong but whether the model has the knowledge to fix it.
BibTeX
@misc{kumaran2026how,
  author = {Dharshan Kumaran and Viorica Patraucean and Simon Osindero and Petar Veličković and Nathaniel Daw},
  title = {{How LLMs Detect and Correct Their Own Errors: The Role of Internal Confidence Signals}},
  year = {2026},
  eprint = {2604.22271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.22271},
}

Loading related content...

Figure