TruthX: Alleviating Hallucinations by Editing Large Language Models in Truthful Space
Zhang, Shaolei, Yu, Tian, Feng, Yang
–arXiv.org Artificial Intelligence
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 LLMs by an average of 20% on TruthfulQA benchmark. Further analyses suggest that TruthX can control LLM to produce truthful or hallucinatory responses via editing only one vector in LLM's internal representations.
arXiv.org Artificial Intelligence
Jun-5-2024
- Country:
- Asia (1.00)
- Europe > United Kingdom (1.00)
- North America
- Canada > British Columbia (0.27)
- United States
- Arizona > Pima County
- Tucson (0.14)
- California > San Francisco County
- San Francisco (0.14)
- Massachusetts > Plymouth County (0.14)
- Arizona > Pima County
- Genre:
- Personal (1.00)
- Research Report > New Finding (1.00)
- Industry:
- Leisure & Entertainment > Sports
- Basketball (0.92)
- Soccer (1.00)
- Banking & Finance > Trading (0.67)
- Transportation (0.92)
- Education (1.00)
- Media > Film (0.67)
- Government
- Military (0.67)
- Regional Government > North America Government
- United States Government (1.00)
- Space Agency (0.92)
- Health & Medicine
- Consumer Health (1.00)
- Pharmaceuticals & Biotechnology (0.67)
- Therapeutic Area
- Cardiology/Vascular Diseases (0.93)
- Oncology (1.00)
- Psychiatry/Psychology (0.93)
- Law (1.00)
- Consumer Products & Services (0.92)
- Leisure & Entertainment > Sports
- Technology: