Enhancing Language Model Factuality via Activation-Based Confidence Calibration and Guided Decoding

Xin Liu, Farima Fatahi Bayat, Lu Wang
6/19/2024
cs.CL

No official code found. Best implementation: launchnlp/ActCab (1 star, last commit 2024-11-13).

Abstract

Calibrating language models (LMs) aligns their generation confidence with the actual likelihood of answer correctness, which can inform users about LMs' reliability and mitigate hallucinated content. However, prior calibration methods, such as self-consistency-based and logit-based approaches, are either limited in inference-time efficiency or fall short of providing informative signals. Moreover, simply filtering out low-confidence responses reduces the LM's helpfulness when the answers are correct. Therefore, effectively using calibration techniques to enhance an LM's factuality remains an unsolved challenge. In this paper, we first propose an activation-based calibration method, ActCab, which trains a linear layer on top of the LM's last-layer activations that can better capture the representations of knowledge. Built on top of ActCab, we further propose CoDec, a confidence-guided decoding strategy to elicit truthful answers with high confidence from LMs. By evaluating on five popular QA benchmarks, ActCab achieves superior calibration performance than all competitive baselines, e.g., by reducing the average expected calibration error (ECE) score by up to 39%. Further experiments on CoDec show consistent improvements in several LMs' factuality on challenging QA datasets, such as TruthfulQA, highlighting the value of confidence signals in enhancing factuality.

View on arXivView PDF

Code Implementations(1)

launchnlp/ActCabCommunity100%

Codebase for paper: Enhancing Language Model Factuality via Activation-Based Confidence Calibration and Guided Decoding

10Shell, PythonJun 19, 20241 years ago

Similar Papers

Cite this paper

@article{liu2024enhancing,
  title  = {Enhancing Language Model Factuality via Activation-Based Confidence Calibration and Guided Decoding},
  author = {Xin Liu and Farima Fatahi Bayat and Lu Wang},
  year   = {2024},
  eprint = {2406.13230},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.13230v2}
}

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/2406.13230.svg)](https://codeofpaper.com/paper/2406.13230)

Discussion