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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Rachmil, Oren, Shapira, Avishag, Betser, Roy, Gershon, Itay, Hofman, Omer, Shabtai, Asaf, Elovici, Yuval, Vainshtein, Roman
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912831334514688
author Rachmil, Oren
Shapira, Avishag
Betser, Roy
Gershon, Itay
Hofman, Omer
Shabtai, Asaf
Elovici, Yuval
Vainshtein, Roman
author_facet Rachmil, Oren
Shapira, Avishag
Betser, Roy
Gershon, Itay
Hofman, Omer
Shabtai, Asaf
Elovici, Yuval
Vainshtein, Roman
contents 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 apply a linear transformation to decorrelate and standardize the model's hidden activations, and use the Euclidean norm in this transformed space as a compliance score for detecting policy violations. 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, achieving 86.0% F1 score while outperforming fine-tuned baselines by up to 9.1 points and LLM-as-a-judge by 16 points, with significantly lower computational cost. Code is available at: https://github.com/FujitsuResearch/LLM-policy-violation-detection
format Preprint
id arxiv_https___arxiv_org_abs_2512_03994
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Training-Free Policy Violation Detection via Activation-Space Whitening in LLMs
Rachmil, Oren
Shapira, Avishag
Betser, Roy
Gershon, Itay
Hofman, Omer
Shabtai, Asaf
Elovici, Yuval
Vainshtein, Roman
Machine Learning
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 apply a linear transformation to decorrelate and standardize the model's hidden activations, and use the Euclidean norm in this transformed space as a compliance score for detecting policy violations. 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, achieving 86.0% F1 score while outperforming fine-tuned baselines by up to 9.1 points and LLM-as-a-judge by 16 points, with significantly lower computational cost. Code is available at: https://github.com/FujitsuResearch/LLM-policy-violation-detection
title Training-Free Policy Violation Detection via Activation-Space Whitening in LLMs
topic Machine Learning
url https://arxiv.org/abs/2512.03994