Abstract
Large Language Models (LLMs) are increasingly integrated into various applications, yet they remain vulnerable to "jailbreak" attacks that bypass safety guardrails. We introduce CALM (Concept Alignment and Latent Manipulation), a lightweight, inference-time technique designed to suppress harmful outputs. By identifying and neutralizing "harmful concept" dimensions within a model's latent space, CALM steers generation toward safer content without requiring expensive retraining or fine-tuning. Our results demonstrate that CALM effectively reduces harmfulness across multiple open-weight models while providing a new layer of interpretability into the model's internal conceptual representations.
Introduction
Despite extensive safety fine-tuning via Reinforcement Learning from Human Feedback (RLHF), LLMs are susceptible to adversarial prompts that elicit inappropriate or dangerous content. Traditional defenses often rely on hard refusals, which can be brittle and easily bypassed by evolving attack vectors. Furthermore, retraining models to address new threats is computationally prohibitive. CALM addresses these challenges by intervening at the latent level during inference, focusing on controlling the semantic content of the response rather than simply triggering a canned refusal.
Methodology: Concept Alignment and Latent Manipulation
CALM operates on the internal representations of the LLM's final decoder layer. The process involves three primary stages:
- Decorrelation (Whitening): To isolate harmful concepts from general language statistics, CALM first extracts embeddings from harmful, harmless, and neutral responses. A whitening transformation is applied to remove the mean embedding of normal answers, highlighting the statistical differences specific to unsafe text.
- Concept Alignment: Using Singular Value Decomposition (SVD), CALM identifies orthogonal axes in the latent space that align with human-interpretable concepts, such as "violence" or "illegal acts."
- Concept Projection (Suppression): During text generation, a diagonal projection matrix is used to "zero out" activations along the identified harmful axes. This modified embedding is then projected back into the original space for final token prediction.
Experimental Evaluation
The effectiveness of CALM was evaluated using several key datasets, including LLM-LAT Harmful for concept definition and HarmfulQA/AdvBench for safety testing. We tested CALM on LLaMA 3 (8B), Phi-3 (Mini), and Gemma 2 (2B/9B), including "abliterated" versions where built-in safety mechanisms were intentionally disabled.
Results and Discussion
CALM significantly improves safety metrics across most tested models. A key insight is that whitening is essential for effective concept separation; without it, projecting out harmful dimensions often degrades general model performance.
Steering vs. Refusal
Unlike traditional safety filters that result in a hard refusal, CALM often "steers" the model toward a constructive or educational response. For example, when prompted with a harmful request regarding property destruction, a CALM-equipped model might instead discuss the social consequences and alternative conflict resolution strategies.
Interpretability and Latent Dynamics
CALM provides a window into the model's "thought process." By monitoring activations along the aligned axes, researchers can observe spikes in specific concepts during the generation of sensitive content. Interestingly, some axes were found to be bi-directional, where positive and negative activations represented distinct but related harmful concepts, such as "Identity Theft" versus "Bomb Making."
Conclusion and Future Work
CALM offers a robust, inference-time defense against harmful content generation with minimal computational overhead. While highly effective for LLaMA and Phi-3, future work is needed to address stability issues observed in the Gemma model family and to better handle entangled concepts. Expanding the training data for the whitening phase and exploring fine-grained concepts across multiple languages are key priorities for future development.
Summary updated