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:
- South America (0.04)
- Oceania > Micronesia (0.04)
- Atlantic Ocean (0.04)
- North America
- Mexico (0.04)
- Dominican Republic (0.04)
- United States
- New York (0.04)
- New Hampshire (0.04)
- Delaware (0.04)
- Nevada > Clark County
- Las Vegas (0.04)
- Arizona
- Pima County > Tucson (0.14)
- Maricopa County > Phoenix (0.04)
- Utah > Salt Lake County
- Salt Lake City (0.04)
- Oregon > Multnomah County
- Portland (0.04)
- Massachusetts
- Suffolk County > Boston (0.04)
- Plymouth County > Plymouth (0.04)
- California
- San Francisco County > San Francisco (0.14)
- Los Angeles County > Los Angeles (0.04)
- San Diego County > San Diego (0.04)
- Canada
- Quebec > Montreal (0.04)
- Ontario > Toronto (0.04)
- British Columbia
- Europe
- France (0.04)
- Holy See > Vatican City (0.04)
- Germany (0.04)
- Iceland (0.04)
- Switzerland (0.04)
- Denmark (0.04)
- Finland (0.04)
- Norway (0.04)
- Sweden (0.04)
- Spain
- Galicia > Madrid (0.04)
- Catalonia > Barcelona Province
- Barcelona (0.04)
- Italy > Lazio
- Rome (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- United Kingdom
- Scotland (0.04)
- Northern Ireland (0.04)
- Wales (0.04)
- England > Greater London
- London (0.04)
- Asia
- Genre:
- Research Report > New Finding (1.00)
- Personal (1.00)
- Industry:
- Law (1.00)
- Transportation (0.92)
- Consumer Products & Services (0.92)
- Banking & Finance > Trading (0.67)
- Media > Film (0.67)
- Education > Health & Safety
- School Nutrition (0.67)
- Health & Medicine
- Consumer Health (1.00)
- Pharmaceuticals & Biotechnology (0.67)
- Therapeutic Area
- Oncology (1.00)
- Psychiatry/Psychology (0.93)
- Cardiology/Vascular Diseases (0.93)
- Government
- Space Agency (0.92)
- Military (0.67)
- Regional Government > North America Government
- United States Government (1.00)
- Leisure & Entertainment > Sports
- Soccer (1.00)
- Basketball (0.92)
- Technology: