TL;DR
This paper introduces "activation steering" for Masked Diffusion Language Models (MDLMs), a novel method to control model behavior at inference time by manipulating internal activations. They demonstrate this technique can effectively steer MDLMs towards safety refusal, showing it's more potent than existing methods and has unique properties compared to autoregressive models.
What Problem Does This Paper Address?
Controlling the output of large language models (LLMs) to align with desired behaviors, such as safety or specific styles, is a critical area of research. While autoregressive LLMs have seen significant progress in inference-time control methods like activation steering, similar techniques for Masked Diffusion Language Models (MDLMs) have been largely unexplored. MDLMs generate text differently (iterative masked-token denoising) than autoregressive models (next-token prediction), raising questions about whether and how control mechanisms like activation steering can be adapted and if they exhibit unique characteristics due to the diffusion architecture. This paper aims to bridge this gap by developing and evaluating an activation steering primitive for MDLMs, specifically focusing on safety refusal.
Methods
The core contribution is an activation steering primitive for MDLMs. This method involves:
- Direction Extraction: A single forward pass through the MDLM with contrastive prompt sets (harmful vs. harmless) is used to extract activations. A low-dimensional direction (a vector) is then computed from these activations, representing the "refusal" behavior.
- Global Intervention: This extracted direction is applied globally to the residual-stream activations throughout the entire reverse diffusion process. Crucially, this is done without performing optimization or altering the diffusion sampling procedure itself.
- Diffusion-Specific Adaptations: Unlike autoregressive models where control signals are often confined to the end of the prompt due to causal attention, the authors investigate extracting directions from both pre-instruction and post-instruction tokens in MDLMs, leveraging their non-causal, parallel processing.
Datasets
- Training/Extraction Datasets:
- Harmful instructions: Sampled from ADVBENCH, MALICIOUSINSTRUCT, and TDC2023.
- Harmless instructions: Sampled from ALPACA.
- These datasets were filtered to ensure the model actually produced refusals for harmful prompts, making the extracted directions more robust.
- Validation Dataset:
- HARMBENCH validation split: Used to select the most effective steering vector from candidate directions.
- Evaluation Dataset:
- JAILBREAKBENCH: Contains 100 harmful instructions across various categories, held out from extraction and validation.
Key Insights and Ideas
- MDLMs have a "refusal subspace": The paper demonstrates that refusal behavior in MDLMs is governed by a consistent, approximately one-dimensional activation subspace, similar to autoregressive models.
- Pre-instruction tokens are powerful for MDLMs: Unlike autoregressive models where control signals are typically at the end of the prompt, MDLMs can be effectively steered using directions extracted from tokens before the user's instruction. This is a direct consequence of their non-causal, parallel processing.
- Early diffusion steps matter most: Interventions during the early stages of the reverse diffusion process have a disproportionately larger impact on steering the model's behavior compared to later stages.
- Mid-to-late transformer layers are key: Activation steering is most effective when applied to mid-to-late transformer layers, with early layers having less influence.
- Cross-lingual transfer is strong within MDLMs: Steering directions extracted from English prompts transfer well to Chinese inputs (and vice-versa) within the same MDLM, suggesting shared abstract representations of harmful intent.
- Architecture matters: The extracted steering directions do not reliably transfer to autoregressive models, highlighting that steerable representations are architecture-dependent.
Key Results
- Effective Safety Control: Activation steering significantly reduces keyword-based refusal scores (from ~98% to 0-16%) and LLAMA GUARD 2 safety scores (from ~100% to 16-25%) across multiple MDLM models (LLADA-8B-INSTRUCT, LLADA-1.5, MMADA-8B-MIXCOT).
- Superiority over Baselines: The method outperforms direct prompting and other jailbreak baselines like GCG, PAIR, and Slice in reducing safety.
- Localization: Ablations show that steering is most effective when applied to input tokens (rather than just output tokens) and that early denoising steps and mid-to-late transformer layers are crucial.
- Cross-lingual Transfer: Steering directions transferred robustly between English and Chinese in LLADA-8B-INSTRUCT, with minimal performance degradation.
Limitations and Future Work
- Architecture Dependence: The paper highlights that steering directions are specific to the MDLM architecture and do not transfer to autoregressive models. This suggests future work could explore architecture-agnostic control methods or investigate the specific architectural features that enable such transfer.
- Ethical Considerations: The authors acknowledge the dual-use nature of this technique, which can be used for safety alignment but also for bypassing safety mechanisms. They emphasize the need for access controls, monitoring, and broad validation for any deployment beyond research.
- Further Localization: While the paper ablates token positions and layers, further fine-grained localization of steering effects could be explored.
- Broader Control: The current work focuses on safety refusal. Future work could investigate applying activation steering to other forms of controllable generation in MDLMs, such as style, topic, or sentiment.
Summary updated