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

有害意图作为LLM残差流中的几何可恢复特征

Harmful Intent as a Geometrically Recoverable Feature of LLM Residual Streams

Independent Researcher(独立研究员)

Isaac Llorente-Saguer

AI总结:

研究通过几何方法识别LLM残差流中有害意图的特征,发现其在不同模型架构中线性可分离,并通过优化策略实现高检测性能。

摘要:

对齐的语言模型拒绝有害指令,但其识别此类指令的表示方式不如生成行为那样明确。在12个模型(涵盖四种架构家族:Qwen2.5、Qwen3.5、Llama-3.2、Gemma-3)和三种对齐变体(基础、指令微调、擦除)中,有害意图在残差流激活中线性可分离,参数规模从0.5B到1.3B,Qwen3.5家族扩展至9B。通过Soft-AUC优化从100个标记示例中拟合的方向达到平均有效AUROC 0.982和TPR@1%FPR 0.797,能泛化到三个测试有害基准和一个难辨的良性对照,并在擦除变体中与指令微调版本的AUROC相差±0.003。所有监督策略的AUROC均超过0.96,但TPR@1%FPR差异超过AUROC差距的十倍;一个部署的9B安全分类器在AUROC 0.94和TPR 0.30时表现出相同模式,推动在安全相关检测评估中采用低FPR报告。几何测量细化了图景。恢复的方向在每种提取协议中集中,但协议依赖性跨协议存在:对同一聊天模板激活在相同残差流层上的两种池化选择(内容令牌上的最大池化与指令后位置的最后一个令牌)恢复的有害方向相差73度,投影其中一个出后,使用最大池化提取的检测在任一提取下基本保持完整。探测识别出协议特定的方向,而非唯一的计算特征。

英文摘要:

Aligned language models refuse harmful instructions, but the representations through which they recognise such instructions are less well characterised than the behaviours they produce. Harmful intent is linearly separable from residual-stream activations across 12 models spanning four architectural families (Qwen2.5, Qwen3.5, Llama-3.2, Gemma-3) and three alignment variants (base, instruction-tuned, abliterated), with parameter scales from 0.5B to 1.3B and a within-family scale extension to 9B on Qwen3.5. A direction fitted from 100 labelled examples per class via Soft-AUC optimisation reaches mean effective AUROC 0.982 and TPR@1\%FPR 0.797, generalises to three held-out harm benchmarks and a hard-benign control, and matches its instruction-tuned counterpart within $\pm 0.003$ AUROC in abliterated variants from which the refusal mechanism has been removed. The supervised strategies all exceed AUROC 0.96, but their TPR@1\%FPR varies by more than ten times the AUROC gap; a deployed 9B safety classifier shows the same pattern at AUROC 0.94 and TPR 0.30, motivating low-FPR reporting as a default in safety-adjacent detection evaluation. Geometric measurements refine the picture. The recovered direction is concentrated within each extraction protocol but protocol-dependent across them: two pooling choices applied to the same chat-templated activations at the same residual-stream layer (max-pool over content tokens versus last-token at the post-instruction position) recover harm directions $73^\circ$ apart, and projecting one out leaves detection under either max-pool extraction essentially intact. Probing identifies a protocol-specific direction rather than a unique computational feature.

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

↑