幻觉可从量化LLM中间层隐藏状态线性解码
Hallucination Is Linearly Decodable from Mid-Layer Hidden States in Quantized LLMs
AI总结:
研究开源LLM在4位量化下中间层隐藏状态是否编码线性可分的真实性信号,发现单层线性探针AUROC达0.904-1.000,优于采样方法,且信号近似线性。
摘要:
我们研究开源LLM是否在其隐藏状态中编码线性可分的真实性信号,以及该信号在网络哪一层最强。在三个7B-8B指令微调模型(Llama-3.1-8B、Mistral-7B、Qwen2.5-7B)以4位NF4量化加载的情况下,我们在四个幻觉基准(TruthfulQA、HaluEval-QA、FEVER和一个受控合成集)上提取每层隐藏状态,并比较四种检测方法:线性探针、MLP探针、INSIDE EigenScore、自一致性和注意力熵。单个中间网络层的线性探针在保留分割上达到0.904-1.000 AUROC,而基于采样的检测器在相同协议下不超过0.541 AUROC。真实性信号近似线性:MLP探针很少超过线性探针0.01 AUROC。在自然语言基准上,峰值探测层落在模型家族的一致范围内——Llama和Mistral的32层中第13-18块,Qwen的28层中第19-25块。第一块注意力熵在知识基础设置中提供互补信号(HaluEval-QA上0.866-0.941 AUROC),且无额外推理成本。该协议下采样方法的低区分性反映了配对标签评估与这些方法访问信息之间的结构性不匹配,而非这些方法的固有限制。代码和数据已发布,可在单个8 GB GPU上完全复现。
英文摘要:
We investigate whether open-source LLMs encode a linearly separable truthfulness signal in their hidden states, and at which network depth this signal is strongest. Across three $7$B--$8$B instruction-tuned models (Llama-3.1-8B, Mistral-7B, Qwen2.5-7B) loaded in $4$-bit NF4 quantization, we extract per-layer hidden states on four hallucination benchmarks (TruthfulQA, HaluEval-QA, FEVER, and a controlled synthetic set) and compare four detection approaches: linear and MLP probes, INSIDE EigenScore, self-consistency, and attention entropy. A linear probe on a single mid-network layer achieves $0.904$--$1.000$ AUROC on held-out splits, while sampling-based detectors do not exceed $0.541$ AUROC under the same protocol. The truthfulness signal is approximately linear: MLP probes rarely surpass linear probes by more than $0.01$ AUROC. Peak probing layers fall in a consistent band across model families on natural-language benchmarks -- blocks~$13$--$18$ of~$32$ for Llama and Mistral, and blocks~$19$--$25$ of~$28$ for Qwen. First-block attention entropy provides a complementary signal in knowledge-grounded settings ($0.866$--$0.941$ AUROC on HaluEval-QA) at no additional inference cost. The low discriminability of sampling methods under this protocol reflects a structural mismatch between paired-label evaluation and the information these methods access, rather than an inherent limitation of those methods. Code and data are released for full reproducibility on a single $8$\,GB GPU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。