TL;DR
When an LLM confidently weaves a hallucination into an otherwise accurate paragraph, knowing the whole response is shaky—or that a single punctuation mark had high entropy—doesn't help you fix it. SPANUQ introduces a lightweight probe that reads an LLM's internal hidden states in a single forward pass, automatically carves the output into meaningful factual phrases ("spans"), and scores exactly how uncertain the model is about each one. It beats multi-sample uncertainty methods while running 10–20× faster.
What Problem Does This Paper Address?
Suppose an LLM writes: "Marie Curie was a Polish physicist who won the Nobel Prize in 1901." (She actually won it in 1903.) How do we get the model to flag its own doubt?
Right now, uncertainty estimation lives at two awkward extremes:
- Token-level methods score every sub-word. Function words like "was" get meaningless scores, while "physicist" might look uncertain simply because "chemist" was an equally plausible word choice. Single tokens rarely hold standalone facts.
- Sequence-level methods generate 10 to 20 sampled responses, check if they agree, and output one global score (say,
u = 0.52). That costs 10–20× more compute and smears good facts and bad hallucinations into an unactionable mush.
The authors formalize Span-Level Uncertainty Estimation (SLUE): finding contiguous chunks of text that each carry one assessable claim (like "Polish physicist" or "1901") and assigning a continuous uncertainty score in $[0, 1]$ to each—all from a single forward pass.
Methods
SPANUQ is a ~25M-parameter module bolted onto a frozen LLM. Instead of sampling 20 times at test time, it distills multi-sample disagreement signals directly from the LLM's internal representations, adding less than 3% latency.
Here is how the pipeline flows:
- Mid-to-Late Layer Fusion: Factual signals peak in middle-to-late Transformer layers. SPANUQ averages hidden states from three peak layers and contextualizes them with a lightweight encoder.
- DETR-Style Span Detection: Borrowing from computer vision's DETR object detector, SPANUQ uses 32 learnable "span queries" to predict start and end coordinates in parallel. Unlike standard BIO sequence tagging, set prediction handles overlapping claims effortlessly.
- Differentiable Span Enrichment: Knowing where a span sits isn't enough to judge what it says. A soft sigmoid mask pools token features inside the predicted boundaries and gates them back into the query.
- Mixture of Beta (MoB) Head: Uncertainty isn't bell-shaped—claims tend to be dead certain ($u \approx 0$), dead wrong ($u \approx 1$), or occasionally murky. A 3-component Mixture of Beta distribution naturally models this U-shaped, multi-modal reality.
- Iterative Refinement (UCIR): The model takes a "second look," feeding Round-1 uncertainty estimates back through the shared decoder to sharpen its rankings.
Datasets
Because no benchmark existed with continuous uncertainty labels at the span level, the authors built SPANUQ-BENCH:
- Scale & Sources: 20,000 prompts yielding ~293K annotated spans across five domains: Natural Questions (42%), TriviaQA (25%), ELI5 Reddit explanations (15%), Wikipedia biographies (10%), and challenging hallucination sets from FELM, TruthfulQA, and HaluEval (8%).
- Distillation Labels (No External Knowledge): For each greedy response, an LLM judge extracts atomic claim spans and checks them against $S = 20$ stochastic responses ($T=1.0$). A span's ground-truth uncertainty $u^*$ is simply the contradiction rate among samples that mention the claim. An independent human audit of 2,000 spans confirmed strong alignment with actual factual errors ($\kappa = 0.618$).
Key Insights and Ideas
- Sequence taggers collapse on uncertainty spans: Standard BIO tagging scored a dismal 0.079 F1 on span detection because real-world claims frequently overlap in text. Treating span extraction like 1D object detection (continuous regression + GIoU) jumped F1 to 0.910.
- Right distribution, free calibration: Swapping a single Beta output for a 3-component Mixture of Beta slashed Expected Calibration Error (ECE) by 62% (0.052 $\rightarrow$ 0.020) without post-hoc temperature scaling, because it stops forcing bimodal data into a unimodal mold.
- Whole-sequence uncertainty is just the sum of its parts: Aggregating SPANUQ's span scores via learned importance weights recovers sequence-level uncertainty ($\rho_{\text{seq}} = 0.839$–$0.851$), matching expensive 10-sample methods like SelfCheckGPT. Span-level estimation essentially subsumes sequence-level estimation.
Key Results
Evaluated across five frozen backbones (Qwen3-4B/8B/14B, MoE Qwen3-30B-A3B, and Mistral-7B):
- Uncertainty Quality: SPANUQ hits 0.908–0.944 AUROC and 0.110–0.129 MAE, beating all multi-sample baselines (e.g., SelfCheckGPT-NLI at 0.808 AUROC on Qwen3-14B) and hidden-state baselines like HaloScope (0.834)—even outperforming an MLP probe given oracle ground-truth span boundaries (0.881).
- Span Localization: Achieves 0.910 F1 on boundary detection, outperforming the best sliding-window heuristic (0.653 F1) by 39.4%.
- Real-World Error Filtering: On human-judged factuality labels, rejecting the top 20% most uncertain spans cuts factual error rates from 18.6% down to 10.5% (a 43.9% relative drop).
Limitations and Future Work
- White-box & Per-Model Training: SPANUQ needs access to internal hidden states (no closed APIs) and requires training a fresh ~25M probe per LLM architecture. Building probes requires a compute-heavy, one-time multi-sample dataset generation run.
- Consistency $\neq$ Truth: Because training labels measure cross-sample contradiction without retrieval, SPANUQ is blind to confident hallucinations—errors the LLM repeats identically every single time. Conversely, ~22% of high-uncertainty spans are factually right on the greedy pass, just phrased inconsistently across samples.
- What's Next: Extending beyond English factual claims into multi-step reasoning, and using localized span scores to drive surgical downstream actions: verifying only shady spans via search, rewriting single clauses instead of whole answers, and passing claim-level confidence tags between collaborating AI agents.
Summary updated