arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.21483cs.AI
收藏

带统计信息的FlashAttention:用于紧凑幻觉检测器的低开销注意力特征

FlashAttention with Statistics: Low-Overhead Attention Features for Compact Hallucination Detectors

Applied AI Institute(应用人工智能研究所);Yandex(Yandex公司);Risk AI Research Lab(风险人工智能研究实验室)

Andrei Volodichev, Maksim Savichev, Nikita Sviridov, Artem Yuliy, Dmitry Simakov, Alexey Zaytsev

AI总结:

该研究提出带统计信息的FlashAttention,以低开销计算注意力特征,训练紧凑冻结Qwen3代理作为幻觉检测器,其性能优于部分LLM评判器和专用接地检查器,添加注意力特征可提升检测F1值。

摘要:

大语言模型可能会生成与提供的上下文不符的流畅回答。紧凑的冻结代理模型可通过读取上下文和另一模型的响应来检测此类回答,即使是来自专有生成器的响应也可检测。基于注意力的检测器使用代理模型注意力权重的汇总统计信息,但标准流水线会实例化注意力矩阵,其内存随序列长度呈二次增长。我们通过在FlashAttention过程中累积、之后的稀疏查找或对分数的第二个平铺过程来计算这些统计信息,无需实例化注意力,并将这些路径分类为几乎无开销和开销较高的路径。在H100上,五个已发表检测器的统计信息使Qwen3-8B在2K token时的前向传播延迟增加16%,在35K token时降至1.4%,每个响应token存储22.5 KiB。在三个基准测试中,基于0.6B至8B参数的冻结Qwen3代理训练的探测模型表现出强大的检测能力:4B代理在三个基准中的两个上,F1值优于9个零样本4-9B LLM评判器中最强的一个;这些代理的性能与高达7B参数的专用接地检查器相当或更优;探测每个代理的效果优于将其作为评判器进行提示;添加注意力特征在12个基准-代理对中的一半显著提高了F1值,且从未显著降低F1值。

英文摘要:

Large language models can produce fluent answers that the supplied context does not support. A compact frozen proxy model can detect such answers by reading the context and another model's response, even from a proprietary generator. Attention-based detectors use summary statistics of the proxy's attention weights, but standard pipelines materialize the attention matrix, whose memory grows quadratically with sequence length. We compute these statistics without materializing attention, by accumulation in the FlashAttention pass, sparse lookups after it, or a second tiled pass over the scores, and classify them by this path into nearly free and costlier ones. On an H100, the statistics of five published detectors add 16% to the latency of a Qwen3-8B forward at 2K tokens, falling to 1.4% at 35K, and store 22.5 KiB per response token. On three benchmarks, probes trained on frozen Qwen3 proxies of 0.6B to 8B parameters prove strong detectors: a 4B proxy outperforms the strongest of nine zero-shot 4-9B LLM judges in F1 on two of the three, the proxies match or outperform specialized grounding checkers of up to 7B parameters, probing each proxy beats prompting it as a judge, and adding attention features significantly improves F1 in half of the 12 benchmark-proxy pairs, never significantly lowering it.

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

↑