File size: 1,066 Bytes
d7102c3
 
 
0eb243b
 
 
a7c0616
0eb243b
a7c0616
0eb243b
 
 
 
 
 
 
 
a7c0616
 
 
 
 
0eb243b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
license: gpl-3.0
---

# TruthX: Alleviating Hallucinations by Editing Large Language Models in Truthful Space

> [Shaolei Zhang](https://zhangshaolei1998.github.io/), Tian Yu, [Yang Feng](https://people.ucas.edu.cn/~yangfeng?language=en)*

TruthX is an inference-time method to elicit the truthfulness of LLMs by editing their internal representations in truthful space, thereby mitigating the hallucinations of LLMs. On the TruthfulQA benchmark, TruthX yields an average enhancement of 20% in truthfulness across various LLMs.

This repository provides TruthX models trained on a variety of LLMs:
- Llama-1-7B, Alpaca-7B
- Llama-2-7B, Llama-2-7B-Chat, Vicuna-7B-v1.5
- Mistral-7B-v0.1, Mistral-7B-Instruct-v0.1, Mistral-7B-Instruct-v0.2
- Baichuan2-7B-Base, Baichuan2-7B-Chat
- Chatglm3-6B-Base, Chatglm3-6B

## Results on TruthfulQA benchmark
- MC1 accuracy on TruthfulQA benchmark. More results refer to the paper.

![truthfulqa_result](assert/truthfulqa_result.png)

Please refer to [GitHub repo](https://github.com/ictnlp/TruthX) for specific usage scripts.