CALM: concept alignment and latent space manipulation make LLM answers saferKeep Calm and Avoid Harmful Content: Concept Alignment and Latent Manipulation Towards Safer Answers
Translation in progress — untranslated text is omitted.
CALM is a training-free inference-time method that suppresses harmful concepts by modifying the last-layer latent representation of an LLM, defending against jailbreak attacks that bypass safety guardrails. The method combines concept whitening with orthogonal projection to remove latent directions of harmful content while maintaining model performance. Experiments show CALM reduces harmful outputs on most metrics and outperforms baseline methods, requiring no additional training data or fine-tuning and adding only a small amount of inference compute overhead.
- Adversarial prompts can still bypass LLM safety guardrails. The authors aim to suppress harmful concepts at inference time and constrain response content, avoiding continual retraining and not limiting the approach to refusal.
- CALM whitens last-layer response embeddings, uses an orthogonal rotation to align concept directions to standard axes, then zeros out harmful dimensions, inverts the transformation, and continues generation. Matrices are precomputed offline; no fine-tuning.
- On LLaMA 3, Phi-3, and Gemma 2, comparisons are made against the unmodified model and ProFS. The authors state that on Harmful Q&A, CALM gets 17 (out of 24); on harmfulness it is better than base 23 (out of 32) times. Results on Gemma are mixed, and appendix examples still include answers that do not explicitly refuse.
- The authors note that Detoxify and Llama 3.3 70B review require caution, concept entanglement is left for future work, unstable SVD appears on additional models, and evaluation is English-only. Experiments include these three model families and four data settings; human agreement and number of repetitions are not reported.
Related papers
Both use: Alpaca
- The Struggle Between Continuation and Refusal: A Mechanistic Analysis of the Continuation-Triggered Jailbreak in LLMsAnalysis / interpretabilityarXiv