通过修改模型隐状态,安全生成内容而不需重训。
Keep Calm and Avoid Harmful Content: Concept Alignment and Latent Manipulation Towards Safer Answers
- 在推理阶段修改最后一层隐表示,抑制有害概念。
- 大幅减少有害输出,且保持模型原有性能。
- 无需额外数据或微调,适合部署在现有系统中。
大型语言模型容易受到越狱攻击,即通过对抗性提示绕过内置的安全防护。本文提出一种推理阶段的方法——概念对齐与概念操控(CALM),通过修改模型最后一层的隐表示来抑制有害内容,无需重新训练。该方法结合计算机视觉中的概念去相关技术和正交投影,移除与有害内容相关的隐空间方向,同时保留模型性能。实验表明,CALM显著降低了有害输出,在多数指标上优于基线方法,是一种轻量级的AI安全方案,不依赖额外训练数据或模型微调,仅带来少量推理开销。
原文摘要 · Abstract (English)
Large Language Models are susceptible to jailbreak attacks that bypass built-in safety guardrails (e.g., by tricking the model with adversarial prompts). We propose Concept Alignment and Concept Manipulation CALM, an inference-time method that suppresses harmful concepts by modifying latent representations of the last layer of the model, without retraining. Leveraging concept whitening technique from Computer Vision combined with orthogonal projection, CALM removes unwanted latent directions associated with harmful content while preserving model performance. Experiments show that CALM reduces harmful outputs and outperforms baseline methods in most metrics, offering a lightweight approach to AI safety with no additional training data or model fine-tuning, while incurring only a small computational overhead at inference.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。