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

无需训练的策略违规检测:通过激活空间白化在大语言模型中

Training-Free Policy Violation Detection via Activation-Space Whitening in LLMs

Fujitsu Research of Europe(富士通欧洲研究机构);Ben-Gurion University of the Negev(贝内杰尔大学)

Oren Rachmil, Avishag Shapira, Roy Betser, Omer Hofman, Itay Gershon, Asaf Shabtai, Yuval Elovici, Roman Vainshtein

AI总结:

本文提出一种无需训练的策略违规检测方法,通过激活空间白化技术在大语言模型中实现高效检测。

摘要:

随着组织越来越多地在法律、金融和医疗等敏感领域部署大语言模型(LLMs),确保与内部组织政策的一致性已成为优先事项。现有的内容审核框架仍然主要局限于安全领域,缺乏捕捉细致组织政策的鲁棒性。LLM-as-a-judge和微调方法虽然灵活,但会引入显著的延迟和训练成本。为了解决这些限制,我们将策略违规检测框架为模型激活空间中的分布外(OOD)问题。我们提出了一种无需训练的方法,直接在LLM内部表示上操作,利用先前证据表明决策相关的信息编码在其中。受白化技术的启发,我们应用线性变换来去相关和标准化模型的隐藏激活,并使用此变换空间中的欧几里得范数作为检测策略违规的合规分数。我们的方法仅需要策略文本和少量示例样本,使其轻量且易于部署。我们广泛评估了我们的方法在多个LLM和具有挑战性的策略基准上的表现,取得了86.0%的F1分数,同时在微调基线和LLM-as-a-judge上分别高出9.1和16个百分点,计算成本显著降低。代码可在:https://github.com/FujitsuResearch/LLM-policy-violation-detection上获得。

英文摘要:

As organizations increasingly deploy LLMs in sensitive domains such as legal, financial, and medical settings, ensuring alignment with internal organizational policies has become a priority. Existing content moderation frameworks remain largely confined to the safety domain and lack the robustness to capture nuanced organizational policies. LLM-as-a-judge and fine-tuning approaches, though flexible, introduce significant latency and training cost. To address these limitations, we frame policy violation detection as an out-of-distribution (OOD) problem in the model's activation space. We propose a training-free method that operates directly on the LLM internal representations, leveraging prior evidence that decision-relevant information is encoded within them. Inspired by whitening techniques, we derive policy-violation scores directly from normalized representations of LLM hidden activations. Our method requires only the policy text and a small number of illustrative samples, making it lightweight and easily deployable. We extensively evaluate our method across multiple LLMs and challenging policy benchmarks. It achieves up to 86.0% F1, outperforming both fine-tuned and LLM-as-a-judge baselines while requiring substantially less computation. Our code is publicly available at: https://github.com/FujitsuResearch/LLM-policy-violation-detection

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

↑