Skip to main content
QUICK REVIEW

[Paper Review] The Internal State of an LLM Knows When It's Lying

Amos Azaria, Tom M. Mitchell|arXiv (Cornell University)|Apr 26, 2023
Topic ModelingComputer Science15 citations
TL;DR

The paper presents SAPLMA, a lightweight classifier that uses hidden-layer activations from LLMs to predict whether statements are true or false, outperforming prompting baselines across multiple topics and models.

ABSTRACT

While Large Language Models (LLMs) have shown exceptional performance in various tasks, one of their most prominent drawbacks is generating inaccurate or false information with a confident tone. In this paper, we provide evidence that the LLM's internal state can be used to reveal the truthfulness of statements. This includes both statements provided to the LLM, and statements that the LLM itself generates. Our approach is to train a classifier that outputs the probability that a statement is truthful, based on the hidden layer activations of the LLM as it reads or generates the statement. Experiments demonstrate that given a set of test sentences, of which half are true and half false, our trained classifier achieves an average of 71\% to 83\% accuracy labeling which sentences are true versus false, depending on the LLM base model. Furthermore, we explore the relationship between our classifier's performance and approaches based on the probability assigned to the sentence by the LLM. We show that while LLM-assigned sentence probability is related to sentence truthfulness, this probability is also dependent on sentence length and the frequencies of words in the sentence, resulting in our trained classifier providing a more reliable approach to detecting truthfulness, highlighting its potential to enhance the reliability of LLM-generated content and its practical applicability in real-world scenarios.

Motivation & Objective

  • Motivate and quantify the risk of false information in LLMs due to confident articulation.
  • Propose a method (SAPLMA) to extract truthfulness signals from an LLM’s internal states without fine-tuning.
  • Evaluate SAPLMA across topics and architectures to assess generalizability and robustness.
  • Release a true-false dataset and demonstrate practical integration potential with LLM systems to improve reliability.

Proposed method

  • Train a simple three-layer feedforward classifier on hidden-layer activations from LLMs.
  • Evaluate multiple candidate layers (last, 28th, 24th, 20th, middle) as inputs to the classifier.
  • Use a dataset of true/false statements across six topics to train on all topics except the held-out one for testing.
  • Compare SAPLMA to baselines including BERT embeddings and few-shot prompting.
  • Test on statements generated by the LLM itself to assess internal veracity signals.

Experimental results

Research questions

  • RQ1Can an LLM’s hidden-layer activations reveal whether a statement is true or false?
  • RQ2How does SAPLMA perform relative to prompting-based baselines in truth detection across topics and model families?
  • RQ3Which hidden-layer representations best encode veracity signals for different LLMs?
  • RQ4Does SAPLMA maintain performance when generalizing to topics not seen during training?
  • RQ5How does SAPLMA perform on statements generated by the LLM itself compared to externally sourced true/false statements?

Key findings

  • SAPLMA achieves 60%–80% accuracy on held-out topics with OPT-6.7b and 70%–90% with LLAMA2-7b.
  • SAPLMA consistently outperforms BERT embeddings and few-shot prompting baselines across all six topics.
  • The 20th layer often yields best results for OPT-6.7b, while the LLAMA2-7b model favors the middle or higher layers, depending on topic and setup.
  • Average SAPLMA training accuracy is 86.4% on OPT-6.7b using the 20th layer, suggesting detectable internal veracity representations in the LLM.
  • Probabilities produced by the LLM for entire sentences are highly influenced by syntax and length, whereas SAPLMA’s sigmoid outputs are more aligned with truth value (e.g., on a set of 14 held-out statements).
  • When applied to sentences generated by the LLM itself, SAPLMA still outperforms baselines but shows lower absolute accuracy (70% range for some settings) than the externally sourced true/false data.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.