Hypergraph Modeling of Transformer Attention for Hallucination Detection
Mark Junjie Li, zhishun liu, Wei Wang, Yuanshan Lu, yangjingxi, Xianyu Bao, Jun Li, Sunjie Huang
NeurIPS page · OpenReview · Open on the map
Category: LLM Reasoning, Memory & RAG › Hallucination Detection Methods · Type: new method · Keywords: hallucination detection, hypergraph modeling, transformer attention, RAGTruth benchmark, zero-shot transfer, efficient inference
Areas: Safety & Security › Language Model Security › Hallucination Detection; Graph Learning › Graph Reasoning and Representation › Graph-Based Retrieval and Reasoning
Summary
AttnHyper models Transformer attention as a hypergraph to detect hallucinations, achieving a +5.08 AUROC gain over baselines.
Explained to a 5-year-old
Large language models sometimes make up facts that aren't true. These made-up facts are called hallucinations. Existing ways to catch them look at single words or simple clues, which often miss the problem. We want a method that looks at how many words work together to find false information. The new method builds a network where groups of words that appear together are linked.
Explained to a 5-year-old, longer
Large language models sometimes make up facts that aren't true. These made-up facts are called hallucinations. Existing ways to catch them look at single words or simple clues, which often miss the problem. We want a method that looks at how many words work together to find false information. The new method builds a network where groups of words that appear together are linked. This network captures complex relationships between words. By learning from this network, the method can tell whether a generated fact is likely made up. It works better than the old methods on many tests. It also works on new models it hasn't seen before. The method doesn't need a lot of extra computer power, so it can be used in real applications. It helps keep information from AI more reliable. It makes detecting false facts easier for developers.
For a technical reader
AttnHyper converts a transformer’s attention patterns into a hypergraph where tokens are nodes and hyperedges capture multi-token interactions across heads and layers. It then trains a hypergraph neural network to learn structural cues that indicate whether generated text is factually unsupported. The model is evaluated on the RAGTruth benchmark, where it improves AUROC by about 5 points over existing detectors. It also transfers zero-shot to other models with little extra computation. This makes hallucination detection both more accurate and efficient for production use.
Problem
Large Language Models often produce factually unsupported content, known as hallucination, which is difficult to detect using existing heuristics that rely on isolated attention signals. There is a need for detection methods that capture higher-order dependencies among tokens.
Method
The approach represents Transformer attention patterns as a hypergraph where tokens are nodes and hyperedges capture co-occurrence across heads and layers, using attention weights as features. It then formulates detection as a hypergraph learning problem and applies a hypergraph neural network to extract structural cues.
Results
The approach achieves an average gain of +5.08 AUROC over the strongest baseline on the RAGTruth benchmark across diverse settings and architectures, and shows strong zero-shot transfer while incurring minimal inference overhead.
Contributions
It introduces a hypergraph-based representation of attention to capture higher-order token interactions and a hypergraph neural network for detection, outperforming existing methods and enabling efficient deployment.
Practical relevance
It provides an efficient, scalable solution for detecting hallucinations in deployed LLM systems.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction