Leveraging Graph Structures to Detect Hallucinations in Large Language Models
Noa Nonkes, Sergei Agaronian, Evangelos Kanoulas, Roxana Petcu
Abstract
Large language models are extensively applied across a wide range of tasks, such as customer support, content creation, educational tutoring, and providing financial guidance. However, a well-known drawback is their predisposition to generate hallucinations. This damages the trustworthiness of the information these models provide, impacting decision-making and user confidence. We propose a method to detect hallucinations by looking at the structure of the latent space and finding associations within hallucinated and non-hallucinated generations. We create a graph structure that connects generations that lie closely in the embedding space. Moreover, we employ a Graph Attention Network which utilizes message passing to aggregate information from neighboring nodes and assigns varying degrees of importance to each neighbor based on their relevance. Our findings show that 1) there exists a structure in the latent space that differentiates between hallucinated and non-hallucinated generations, 2) Graph Attention Networks can learn this structure and generalize it to unseen generations, and 3) the robustness of our method is enhanced when incorporating contrastive learning. When evaluated against evidence-based benchmarks, our model performs similarly without access to search-based methods.- Anthology ID:
- 2024.textgraphs-1.7
- Volume:
- Proceedings of TextGraphs-17: Graph-based Methods for Natural Language Processing
- Month:
- August
- Year:
- 2024
- Address:
- Bangkok, Thailand
- Editors:
- Dmitry Ustalov, Yanjun Gao, Alexander Panchenko, Elena Tutubalina, Irina Nikishina, Arti Ramesh, Andrey Sakhovskiy, Ricardo Usbeck, Gerald Penn, Marco Valentino
- Venues:
- TextGraphs | WS
- SIG:
- Publisher:
- Association for Computational Linguistics
- Note:
- Pages:
- 93–104
- Language:
- URL:
- https://aclanthology.org/2024.textgraphs-1.7
- DOI:
- Cite (ACL):
- Noa Nonkes, Sergei Agaronian, Evangelos Kanoulas, and Roxana Petcu. 2024. Leveraging Graph Structures to Detect Hallucinations in Large Language Models. In Proceedings of TextGraphs-17: Graph-based Methods for Natural Language Processing, pages 93–104, Bangkok, Thailand. Association for Computational Linguistics.
- Cite (Informal):
- Leveraging Graph Structures to Detect Hallucinations in Large Language Models (Nonkes et al., TextGraphs-WS 2024)
- PDF:
- https://preview.aclanthology.org/dois-2013-emnlp/2024.textgraphs-1.7.pdf