Hallucination Detection in LLMs with Topological Divergence on Attention Graphs

Alexandra Bazarova, Aleksandr Yugay, Andrey Shulga, Alina Ermilova, Andrei Volodichev +8 more
4/14/2025
cs.CLcs.AI

No official code found. Best implementation: kamran1993/tda4halluAppl (1 star, MIT, last commit 2026-02-10).

Abstract

Hallucination, i.e., generating factually incorrect content, remains a critical challenge for large language models (LLMs). We introduce TOHA, a TOpology-based HAllucination detector in the RAG setting, which leverages a topological divergence metric to quantify the structural properties of graphs induced by attention matrices. Examining the topological divergence between prompt and response subgraphs reveals consistent patterns: higher divergence values in specific attention heads correlate with hallucinated outputs, independent of the dataset. Extensive experiments - including evaluation on question answering and summarization tasks - show that our approach achieves state-of-the-art or competitive results on several benchmarks while requiring minimal annotated data and computational resources. Our findings suggest that analyzing the topological structure of attention matrices can serve as an efficient and robust indicator of factual reliability in LLMs.

View on arXivView PDF

Code Implementations(1)

MIT

Application of the approach from "Hallucination Detection in LLMs with Topological Divergence on Attention Graphs" on task-oriented dialogue system "LUSTER"

10Shell, PythonSep 16, 20258 months agoMIT

Similar Papers

Cite this paper

@article{bazarova2025hallucination,
  title  = {Hallucination Detection in LLMs with Topological Divergence on Attention Graphs},
  author = {Alexandra Bazarova and Aleksandr Yugay and Andrey Shulga and Alina Ermilova and Andrei Volodichev and Konstantin Polev and Julia Belikova and Rauf Parchiev and Dmitry Simakov and Maxim Savchenko and Andrey Savchenko and Serguei Barannikov and Alexey Zaytsev},
  year   = {2025},
  eprint = {2504.10063},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.10063v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.10063.svg)](https://codeofpaper.com/paper/2504.10063)

Discussion