TruthX: Alleviating Hallucinations by Editing Large Language Models in Truthful Space
Shaolei Zhang, Tian Yu, Yang Feng

TL;DR
TruthX is a novel inference-time method that enhances large language models' truthfulness by editing their internal representations within a learned truthful space, significantly reducing hallucinations.
Contribution
The paper introduces TruthX, a new approach that activates LLMs' truthfulness by identifying and editing features in their internal representations during inference.
Findings
TruthX improves truthfulness of 13 LLMs by 20% on TruthfulQA.
It can control responses to be truthful or hallucinatory by editing a single vector.
Experiments demonstrate effective internal representation editing for truth activation.
Abstract
Large Language Models (LLMs) sometimes suffer from producing hallucinations, especially LLMs may generate untruthful responses despite knowing the correct knowledge. Activating the truthfulness within LLM is the key to fully unlocking LLM's knowledge potential. In this paper, we propose TruthX, an inference-time intervention method to activate the truthfulness of LLM by identifying and editing the features within LLM's internal representations that govern the truthfulness. TruthX employs an auto-encoder to map LLM's representations into semantic and truthful latent spaces respectively, and applies contrastive learning to identify a truthful editing direction within the truthful space. During inference, by editing LLM's internal representations in truthful space, TruthX effectively enhances the truthfulness of LLM. Experiments show that TruthX improves the truthfulness of 13 advanced…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsMachine Learning in Healthcare · Mental Health via Writing
MethodsLLaMA · Solana Customer Service Number +1-833-534-1729 · Contrastive Learning
