用视觉模型分析大模型激活张量,实现跨模型幻觉检测
Beyond Token Probes: Hallucination Detection via Activation Tensors with ACT-ViT
- 将激活张量视为图像,用ViT架构统一处理多模型输出
- 在多个模型和数据集上表现优于传统探测方法,零样本性能强
- 支持多模型联合训练与迁移,适合实际部署场景
大语言模型生成文本中的幻觉检测对安全应用至关重要。现有探测分类器仅作用于单一层-词元对,且依赖特定模型,限制了效果与跨模型适用性。本文提出新方法:利用激活数据在层×词元两个维度上的自然序列结构,将完整激活张量类比为图像。设计受视觉变换器启发的ACT-ViT模型,可高效处理激活张量,并支持多模型数据联合训练。大量实验表明,ACT-ViT在多种大模型与数据集上均显著优于传统探测方法,且具备优异的零样本性能与跨模型迁移能力。完整代码已开源。
原文摘要 · Abstract (English)
Detecting hallucinations in Large Language Model-generated text is crucial for their safe deployment. While probing classifiers show promise, they operate on isolated layer-token pairs and are LLM-specific, limiting their effectiveness and hindering cross-LLM applications. In this paper, we introduce a novel approach to address these shortcomings. We build on the natural sequential structure of activation data in both axes (layers $\times$ tokens) and advocate treating full activation tensors akin to images. We design ACT-ViT, a Vision Transformer-inspired model that can be effectively and efficiently applied to activation tensors and supports training on data from multiple LLMs simultaneously. Through comprehensive experiments encompassing diverse LLMs and datasets, we demonstrate that ACT-ViT consistently outperforms traditional probing techniques while remaining extremely efficient for deployment. In particular, we show that our architecture benefits substantially from multi-LLM training, achieves strong zero-shot performance on unseen datasets, and can be transferred effectively to new LLMs through fine-tuning. Full code is available at https://github.com/BarSGuy/ACT-ViT.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。