Safety Knowledge Is Already There: Reshaping LLM Latent Representations for Harmful Content Detection
Yunhui Liu, Liuye Guo, You Lyu, Xudong Jin, QIGUANG CHEN, Bin Chong, Tieke He
2026/5/24
摘要
Harmful content detection is essential for safe LLM deployment, but existing guard models often require fine-tuning additional LLMs and performing autoregressive classification, leading to high training and inference cost. Recent studies suggest that safety-relevant knowledge is already encoded in LLM latent representations, raising the possibility of building efficient detectors without modifying the backbone. However, these representations are optimized for next-token prediction rather than harmfulness separation, and thus their native geometry may entangle benign and harmful inputs. In this paper, we propose \texttt{SaLR}, a lightweight framework that detects harmful content by reshaping frozen LLM representations. \texttt{SaLR} estimates harmfulness directions, learns compact transformations to improve latent separability, and trains layer-wise classifiers with an asymmetric objective reflecting that benign context should not neutralize genuinely harmful intent. Experiments across multiple benchmarks show that \texttt{SaLR} improves detection performance and generalization over strong baselines while maintaining strong parameter efficiency. It also extends to streaming harmfulness detection without additional training.