On the Universal Truthfulness Hyperplane Inside LLMs

Junteng Liu, Shiqi Chen, Yu Cheng, Junxian He

Abstract

Recent research suggests that Large Language Models (LLMs) contain internal representations that distinguish factual truth from hallucination. This paper explores the existence of a "universal truthfulness hyperplane"—a linear direction in hidden states that generalizes across diverse tasks. By training probes on a wide array of datasets, the authors demonstrate that internal truth is a global feature of the model, significantly outperforming probes trained on single, narrow benchmarks.

Introduction: The Challenge of Hallucination

Hallucination remains a critical failure mode for LLMs. While external methods like self-evaluation or token probability analysis can flag errors, researchers have increasingly turned to internal probing. This involves training small classifiers on a model's hidden states to determine if the model "knows" it is producing incorrect information.

However, previous probing efforts were often brittle. A probe trained on a specific dataset, such as TruthfulQA, typically fails to generalize to other tasks like summarization. This raises a fundamental question: are these probes capturing a genuine internal sense of truth, or are they merely overfitting to spurious correlations within a single dataset?

The universal truthfulness hyperplane is found by training on diverse data, avoiding the overfitting common in single-dataset benchmarks like TruthfulQA.

Methodology

The authors utilize linear probing through two primary techniques: Logistic Regression (LR) and Mass Mean (MM). The latter finds the direction between the average "true" and "false" states.

Key Innovations

  • Representation Selection: The study identifies that attention head outputs are more effective at capturing truthfulness than the standard residual stream.
  • Feature Sparsity: Truthfulness is encoded in a small fraction of neurons. By selecting top-performing attention heads and using $k$-sparse probes, the researchers maintain high accuracy while minimizing noise.
  • Diversity Scaling: The core innovation is training on a massive, diverse collection of data (17 task categories across 40+ datasets) to prevent overfitting to any single domain.

Experimental Setup and Datasets

The study employs an extensive suite of datasets to evaluate cross-task generalization. The training set includes tasks ranging from knowledge-seeking QA and paraphrase identification to sentiment analysis and structure-to-text conversion.

The study utilizes a broad spectrum of training tasks and distinct test tasks to ensure the robustness and universality of the identified truthfulness hyperplane.

Test tasks include sentence completion (e.g., HellaSwag), short-answer QA (e.g., SciQ), and summarization (e.g., CNN/DM). This rigorous separation ensures that the identified hyperplane is truly "universal" and not specific to the training distribution.

Key Insights

  1. Diversity Over Volume: The diversity of tasks is more critical than the sheer number of samples. Probes trained with only 10 samples per dataset performed nearly as well as those with 800, provided the tasks were sufficiently varied.
  2. Attention as a Truth Hub: Truthfulness is more linearly separable in attention heads, suggesting that the model's mechanism for weighing information is central to its internal "fact-checking."
  3. Alignment and Truth: Fine-tuning (instruction tuning) makes the truthfulness hyperplane even more distinct. Probes trained on base models often perform better on their fine-tuned counterparts, indicating that alignment processes clarify internal truth representations.

Results

The "Universal" probe achieved approximately 70% cross-task accuracy, surpassing single-dataset probes by 14 absolute percentage points. Furthermore, this probing method significantly outperformed standard baselines such as model self-evaluation and output probability checks. These findings were consistent across multiple model families, including LLaMA-2 and Mistral.

Limitations and Future Directions

A primary limitation is the "knowledge ceiling": a probe can only detect a hallucination if the model internally possesses the correct fact. If the information is missing from the weights, the hidden states will not reflect a "lie."

Future work should investigate causality through intervention—shifting hidden states along the "truth vector" to actively reduce hallucinations. Additionally, exploring whether these hyperplanes become more complex or even more universal in models exceeding 70B parameters remains a vital area for research.

Summary updated

BibTeX
@inproceedings{liu2024universal,
  author = {Junteng Liu and Shiqi Chen and Yu Cheng and Junxian He},
  title = {{On the Universal Truthfulness Hyperplane Inside LLMs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.1012},
}
Figure