arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.17811cs.CLcs.AIcs.LG

TruthX:在真实性空间中编辑大型语言模型以缓解幻觉

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

Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Key Laboratory of AI Safety, Chinese Academy of Sciences(中国科学院人工智能安全重点实验室)

Shaolei Zhang, Tian Yu, Yang Feng

AI总结:

提出TruthX推理时干预方法,通过自编码器和对比学习在真实空间编辑LLM内部表示,显著提升模型真实性并缓解幻觉。

摘要:

大型语言模型(LLMs)有时会产生幻觉,尤其是LLMs可能尽管知道正确知识却生成不真实的回复。激活LLM内部的真实性是充分释放LLM知识潜力的关键。在本文中,我们提出TruthX,一种推理时干预方法,通过识别并编辑LLM内部表示中控制真实性的特征来激活LLM的真实性。TruthX采用自编码器将LLM的表示分别映射到语义和真实潜在空间,并应用对比学习在真实空间中识别一个真实的编辑方向。在推理过程中,通过在真实空间中编辑LLM的内部表示,TruthX有效增强了LLM的真实性。实验表明,TruthX在TruthfulQA基准上将13个先进LLM的真实性平均提高了20%。进一步分析表明,TruthX可以通过仅编辑LLM内部表示中的一个向量来控制LLM产生真实或幻觉的回复。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑