在生成前捕获污染:面向智能体的谱终止开关
Catching Contamination Before Generation: Spectral Kill Switches for Agents
AI总结:
本文提出一种无需训练的谱诊断方法,通过分析注意力 token 图的高频能量比和谱熵,在智能体推理早期检测上下文污染并实现低于一毫秒的门控决策。
摘要:
智能体语言模型会组合多步推理链,但中间步骤可能因不一致的上下文、检索错误或对抗性输入而受到污染,这使得事后评估为时已晚,因为错误在检测之前就已传播。我们提出一种无需额外训练、仅使用前向传播即可在智能体执行过程中发出二元接受或拒绝信号的诊断方法。该方法分析由注意力诱导的 token 图,并在早期层计算两个谱统计量,即高频能量比和谱熵。我们对这些信号进行了形式化,建立了不变性,并提供了具有不确定性量化的有限样本估计器。在具有单调似然比性质的双状态混合假设下,我们证明在高频能量比上设置单一阈值在贝叶斯意义下对于检测上下文不一致是最优的。实验上,在多个模型家族的上下文验证过程中,高频能量比表现出稳健的双峰性,这在我们硬件和配置下使得门控决策的开销低于一毫秒。我们展示了该方法在检索增强智能体流水线中的集成,并讨论了将其作为内联安全监控器进行部署的方案。该方法在模型仍在处理文本时即可检测污染,在错误进入推理链之前将其拦截。
英文摘要:
Agentic language models compose multi step reasoning chains, yet intermediate steps can be corrupted by inconsistent context, retrieval errors, or adversarial inputs, which makes post hoc evaluation too late because errors propagate before detection. We introduce a diagnostic that requires no additional training and uses only the forward pass to emit a binary accept or reject signal during agent execution. The method analyzes token graphs induced by attention and computes two spectral statistics in early layers, namely the high frequency energy ratio and spectral entropy. We formalize these signals, establish invariances, and provide finite sample estimators with uncertainty quantification. Under a two regime mixture assumption with a monotone likelihood ratio property, we show that a single threshold on the high frequency energy ratio is optimal in the Bayes sense for detecting context inconsistency. Empirically, the high frequency energy ratio exhibits robust bimodality during context verification across multiple model families, which enables gating decisions with overhead below one millisecond on our hardware and configurations. We demonstrate integration into retrieval augmented agent pipelines and discuss deployment as an inline safety monitor. The approach detects contamination while the model is still processing the text, before errors commit to the reasoning chain.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。