arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.27412cs.LGcs.AIcs.CL
收藏

有害意图的几何学:通过残差流中的角度偏差实现无训练异常检测

The Geometry of Harmful Intent: Training-Free Anomaly Detection via Angular Deviation in LLM Residual Streams

Independent Researcher(独立研究者)

Isaac Llorente-Saguer

AI总结:

本文提出LatentBiopsy方法,通过分析大语言模型残差流激活的几何特性,无需训练即可检测有害提示。该方法基于残差流激活的主成分分析和角度偏差,实现高精度的异常检测,具有低延迟和强鲁棒性。

摘要:

本文提出LatentBiopsy方法,一种无需训练即可检测有害提示的几何分析方法。通过分析大语言模型残差流激活的几何特性,该方法基于残差流激活的主成分分析和角度偏差,实现高精度的异常检测。该方法通过计算新提示与参考方向的径向偏差角度θ,并基于高斯分布拟合的负对数似然作为异常分数,能够对称地识别偏差,无论方向如何。在Qwen3.5-0.8B和Qwen2.5-0.5B家族的两个完整模型三元组上进行评估,LatentBiopsy在有害与规范提示的检测中达到AUROC≥0.937,在区分有害与良性攻击性提示(XSTest)时达到AUROC=1.000,且每查询的延迟低于毫秒。三个经验发现:首先,几何特性在拒绝消融后仍保持,两个消融变体的AUROC最多比指令微调变体低0.015,建立了有害意图表示与下游生成拒绝机制之间的几何分离。其次,有害提示表现出近退化的角度分布(σθ≈0.03 rad),比规范分布(σθ≈0.27 rad)紧密一个数量级,且在所有对齐阶段包括消融中保持不变。第三,两个家族在相同深度呈现相反的环方向:有害提示在Qwen3.5-0.8B中占据外环,但在Qwen2.5-0.5B中占据内环,直接促使了方向无关的评分规则。

英文摘要:

We present LatentBiopsy, a training-free method for detecting harmful prompts by analysing the geometry of residual-stream activations in large language models. Given 200 safe normative prompts, LatentBiopsy computes the leading principal component of their activations at a target layer and characterises new prompts by their radial deviation angle $θ$ from this reference direction. The anomaly score is the negative log-likelihood of $θ$ under a Gaussian fit to the normative distribution, flagging deviations symmetrically regardless of orientation. No harmful examples are required for training. We evaluate two complete model triplets from the Qwen3.5-0.8B and Qwen2.5-0.5B families: base, instruction-tuned, and \emph{abliterated} (refusal direction surgically removed via orthogonalisation). Across all six variants, LatentBiopsy achieves AUROC $\geq$0.937 for harmful-vs-normative detection and AUROC = 1.000 for discriminating harmful from benign-aggressive prompts (XSTest), with sub-millisecond per-query overhead. Three empirical findings emerge. First, geometry survives refusal ablation: both abliterated variants achieve AUROC at most 0.015 below their instruction-tuned counterparts, establishing a geometric dissociation between harmful-intent representation and the downstream generative refusal mechanism. Second, harmful prompts exhibit a near-degenerate angular distribution ($σ_θ\approx 0.03$ rad), an order of magnitude tighter than the normative distribution ($σ_θ\approx 0.27$ rad), preserved across all alignment stages including abliteration. Third, the two families exhibit opposite ring orientations at the same depth: harmful prompts occupy the outer ring in Qwen3.5-0.8B but the inner ring in Qwen2.5-0.5B, directly motivating the direction-agnostic scoring rule.

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

↑