FactCheckmate: Preemptively Detecting and Mitigating Hallucinations in LMs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Alnuhait, Deema, Kirtane, Neeraja, Khalifa, Muhammad, Peng, Hao
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912448133464064
author Alnuhait, Deema
Kirtane, Neeraja
Khalifa, Muhammad
Peng, Hao
author_facet Alnuhait, Deema
Kirtane, Neeraja
Khalifa, Muhammad
Peng, Hao
contents Language models (LMs) hallucinate. We inquire: Can we detect and mitigate hallucinations before they happen? This work answers this research question in the positive, by showing that the internal representations of LMs provide rich signals that can be used for this purpose. We introduce FactCheckmate, which preemptively detects hallucinations by learning a classifier that predicts whether the LM will hallucinate, based on the model's hidden states produced over the inputs, before decoding begins. If a hallucination is detected, FactCheckmate then intervenes by adjusting the LM's hidden states such that the model will produce more factual outputs. FactCheckmate provides fresh insights that the inner workings of LMs can be revealed by their hidden states. Practically, both its detection and mitigation models are lightweight, adding little inference overhead; FactCheckmate proves a more efficient approach for mitigating hallucinations compared to many post-hoc alternatives. We evaluate FactCheckmate over LMs of different scales and model families (including Llama, Mistral, Qwen and Gemma), across a variety of QA datasets from different domains. Our results demonstrate the effectiveness of FactCheckmate, achieving over 70% preemptive detection accuracy. On average, outputs generated by LMs with intervention are 34.4% more factual compared to those without.
format Preprint
id arxiv_https___arxiv_org_abs_2410_02899
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle FactCheckmate: Preemptively Detecting and Mitigating Hallucinations in LMs
Alnuhait, Deema
Kirtane, Neeraja
Khalifa, Muhammad
Peng, Hao
Computation and Language
Language models (LMs) hallucinate. We inquire: Can we detect and mitigate hallucinations before they happen? This work answers this research question in the positive, by showing that the internal representations of LMs provide rich signals that can be used for this purpose. We introduce FactCheckmate, which preemptively detects hallucinations by learning a classifier that predicts whether the LM will hallucinate, based on the model's hidden states produced over the inputs, before decoding begins. If a hallucination is detected, FactCheckmate then intervenes by adjusting the LM's hidden states such that the model will produce more factual outputs. FactCheckmate provides fresh insights that the inner workings of LMs can be revealed by their hidden states. Practically, both its detection and mitigation models are lightweight, adding little inference overhead; FactCheckmate proves a more efficient approach for mitigating hallucinations compared to many post-hoc alternatives. We evaluate FactCheckmate over LMs of different scales and model families (including Llama, Mistral, Qwen and Gemma), across a variety of QA datasets from different domains. Our results demonstrate the effectiveness of FactCheckmate, achieving over 70% preemptive detection accuracy. On average, outputs generated by LMs with intervention are 34.4% more factual compared to those without.
title FactCheckmate: Preemptively Detecting and Mitigating Hallucinations in LMs
topic Computation and Language
url https://arxiv.org/abs/2410.02899