Uncertainty-Aware Attention Heads: Efficient Unsupervised Uncertainty Quantification for LLMs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Vazhentsev, Artem, Rvanova, Lyudmila, Kuzmin, Gleb, Fadeeva, Ekaterina, Lazichny, Ivan, Panchenko, Alexander, Panov, Maxim, Baldwin, Timothy, Sachan, Mrinmaya, Nakov, Preslav, Shelmanov, Artem
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915504330899456
author Vazhentsev, Artem
Rvanova, Lyudmila
Kuzmin, Gleb
Fadeeva, Ekaterina
Lazichny, Ivan
Panchenko, Alexander
Panov, Maxim
Baldwin, Timothy
Sachan, Mrinmaya
Nakov, Preslav
Shelmanov, Artem
author_facet Vazhentsev, Artem
Rvanova, Lyudmila
Kuzmin, Gleb
Fadeeva, Ekaterina
Lazichny, Ivan
Panchenko, Alexander
Panov, Maxim
Baldwin, Timothy
Sachan, Mrinmaya
Nakov, Preslav
Shelmanov, Artem
contents Large language models (LLMs) exhibit impressive fluency, but often produce critical errors known as "hallucinations". Uncertainty quantification (UQ) methods are a promising tool for coping with this fundamental shortcoming. Yet, existing UQ methods face challenges such as high computational overhead or reliance on supervised learning. Here, we aim to bridge this gap. In particular, we propose RAUQ (Recurrent Attention-based Uncertainty Quantification), an unsupervised approach that leverages intrinsic attention patterns in transformers to detect hallucinations efficiently. By analyzing attention weights, we identified a peculiar pattern: drops in attention to preceding tokens are systematically observed during incorrect generations for certain "uncertainty-aware" heads. RAUQ automatically selects such heads, recurrently aggregates their attention weights and token-level confidences, and computes sequence-level uncertainty scores in a single forward pass. Experiments across 4 LLMs and 12 question answering, summarization, and translation tasks demonstrate that RAUQ yields excellent results, outperforming state-of-the-art UQ methods using minimal computational overhead (<1% latency). Moreover, it requires no task-specific labels and no careful hyperparameter tuning, offering plug-and-play real-time hallucination detection in white-box LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2505_20045
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Uncertainty-Aware Attention Heads: Efficient Unsupervised Uncertainty Quantification for LLMs
Vazhentsev, Artem
Rvanova, Lyudmila
Kuzmin, Gleb
Fadeeva, Ekaterina
Lazichny, Ivan
Panchenko, Alexander
Panov, Maxim
Baldwin, Timothy
Sachan, Mrinmaya
Nakov, Preslav
Shelmanov, Artem
Computation and Language
Large language models (LLMs) exhibit impressive fluency, but often produce critical errors known as "hallucinations". Uncertainty quantification (UQ) methods are a promising tool for coping with this fundamental shortcoming. Yet, existing UQ methods face challenges such as high computational overhead or reliance on supervised learning. Here, we aim to bridge this gap. In particular, we propose RAUQ (Recurrent Attention-based Uncertainty Quantification), an unsupervised approach that leverages intrinsic attention patterns in transformers to detect hallucinations efficiently. By analyzing attention weights, we identified a peculiar pattern: drops in attention to preceding tokens are systematically observed during incorrect generations for certain "uncertainty-aware" heads. RAUQ automatically selects such heads, recurrently aggregates their attention weights and token-level confidences, and computes sequence-level uncertainty scores in a single forward pass. Experiments across 4 LLMs and 12 question answering, summarization, and translation tasks demonstrate that RAUQ yields excellent results, outperforming state-of-the-art UQ methods using minimal computational overhead (<1% latency). Moreover, it requires no task-specific labels and no careful hyperparameter tuning, offering plug-and-play real-time hallucination detection in white-box LLMs.
title Uncertainty-Aware Attention Heads: Efficient Unsupervised Uncertainty Quantification for LLMs
topic Computation and Language
url https://arxiv.org/abs/2505.20045