Skip to content

Step-Wise Refusal Dynamics in Autoregressive and Diffusion Language Models

Conference: EMNLP 2026
Paper: ACL Anthology
Area: LLM Safety
Keywords: diffusion language models, jailbreak robustness, step-wise refusal dynamics, internal representations, SRI Guard

TL;DR

This paper demonstrates that discrete diffusion language models naturally recover from intermediate harmful content via remasking competition and semantic conditioning, introduces the Step-Wise Refusal Internal Dynamics (SRI) signal to track internal conflict trajectories, and develops SRI Guard—a lightweight unsupervised anomaly detector trained solely on benign signals that matches or outperforms prior defenses with negligible (<0.04%) overhead.

Background & Motivation

The rapid advancement of large language models across conversational and analytical tasks has underscored the critical challenge of alignment against adversarial jailbreaks. The overwhelming majority of deployed systems rely on autoregressive (AR) transformer decoders, which generate responses strictly through token-by-token next-token prediction. However, causal decoding suffers from an inherent irreversibility trap: once an adversarial prompt tricks the model into generating an initial compliant or harmful token, that token is permanently committed into the key-value cache and conditions all future predictions. Even if internal safety mechanisms are activated later in the sequence, the model cannot roll back its prefix, forcing it to continue generating harmful content.

In parallel, discrete diffusion language models (DLMs), such as LLaDA and Dream, have emerged as a viable paradigm offering parallel decoding, competitive generation quality, and empirical hints of heightened jailbreak robustness. Nonetheless, the true source of this robustness advantage has remained contentious and poorly understood: the community could not determine whether superior defense arises from robust feature representations learned during pre-training/alignment, or whether it is fundamentally driven by the iterative remasking sampling mechanics. Compounding this ambiguity, conventional safety assessments rely strictly on surface text outputs evaluated by discrete keyword heuristics or external LLM judges. These black-box evaluators fail to capture the model's internal cognitive hesitation before explicit refusal is verbalized, completely missing intermediate self-correction dynamics that occur during iterative denoising.

To resolve these limitations, this paper investigates the refusal process under strictly controlled conditions where model weights are held frozen while toggling between AR and diffusion sampling, isolating the precise causal contribution of the sampling algorithm. Moving beyond surface text, the authors examine the continuous activation space across Transformer layers to extract a step-wise, cross-architecture internal refusal trajectory. Core idea: prove that the jailbreak robustness of diffusion language models stems from a sampling-driven "recovery-by-revision" mechanism, reveal that jailbreak attempts induce anomalous non-stationary oscillations in internal refusal space, and construct SRI Guard—a lightweight, unsupervised defense trained purely on benign trajectories that detects unseen attacks across architectures with negligible inference overhead.

Method

Overall Architecture

The proposed framework provides an end-to-end paradigm for formalizing, quantifying, and defending step-wise refusal dynamics. The overall architecture spans three sequential stages: first, an empirical and analytical decomposition of the diffusion sampling process, proving that recovery-by-revision is governed by uncommitted token competition and harmless context conditioning; second, the extraction of mean-pooled last-layer hidden activations across decoding steps to compute cosine distances against pre-calculated harmless and harmful prototype centers, yielding a continuous, calibrated Step-Wise Refusal Internal Dynamics (SRI) scalar trajectory; third, the formulation of safety defense as unsupervised anomaly detection on the low-dimensional benign SRI manifold, training a 3,000-parameter multi-layer perceptron autoencoder (SRI Guard) to flag jailbreaks via temporal reconstruction error at inference time.

%%{init: {'flowchart': {'rankSpacing': 24, 'nodeSpacing': 28, 'padding': 6, 'wrappingWidth': 400}}}%%
flowchart TD
    In["Input Prompt and Time Steps"] --> Des1["Step-Wise Remasking Revision<br/>Entropy competition + harmless context constraint"]
    Des1 --> Des2["Step-Wise Refusal Internal Dynamics<br/>Last-layer pooling + dual-prototype cosine log-ratio"]
    Des2 --> Des3["Lightweight Benign Manifold Anomaly Guard<br/>Benign temporal autoencoder + adaptive reconstruction threshold"]
    Des3 -->|Reconstruction Error > δ| Block["Block Response / Safe Refusal Output"]
    Des3 -->|Smooth Trajectory on Benign Manifold| Out["Normal Safe Generation"]

Key Designs

1. Step-Wise Remasking Revision: Transitioning from Irreversible Commitments to Competitive Self-Correction Autoregressive generation suffers from a critical single-step failure mode: any generated token is instantly committed via highest-logit or top-k selection, even under high entropy, permanently corrupting the sequence. Addressing this weakness, the paper formalizes the "recovery-by-revision" physics intrinsic to discrete remasking diffusion. In DLMs, committing a harmful prediction requires satisfying two competitive criteria simultaneously: the token must achieve the highest logit at its own coordinate, and its position must be selected for commitment among all uncommitted positions (exhibiting the lowest entropy under greedy remasking, or being drawn under random remasking). Because early adversarial intermediate tokens often exhibit high prediction entropy, they are routinely passed over in favor of confident harmless tokens. Once harmless tokens are committed, their bidirectional attention constraints drastically depress the conditional likelihood of generating harmful continuations at later steps. To quantify this recovery dynamics, the authors define the Harmful Remasking Rate (HRR) and Full Recovery Rate (FRR): $\(\text{HRR} = \frac{|\{x : \exists t < t' \text{ s.t. } H(X^{(t)}(x)) \land \neg H(X^{(t')}(x))\}|}{|\{x : \exists t \text{ s.t. } H(X^{(t)}(x))\}|}\)$ $\(\text{FRR} = \frac{|\{x : \exists t \text{ s.t. } H(X^{(t)}(x)) \land \neg H(X^{(T)}(x))\}|}{|\{x : \exists t \text{ s.t. } H(X^{(t)}(x))\}|}\)$ where \(H(\cdot) \in \{0, 1\}\) denotes a binary harmfulness predicate. Empirical validation demonstrates HRR values between 0.81 and 0.96 and FRR between 0.63 and 0.73 across DLMs, confirming that the remasking process serves as an active, structural self-correction filter against adversarial attacks.

2. Step-Wise Refusal Internal Dynamics: Moving from Discrete Surface Text to Continuous Activation Trajectories Surface text provides only a discrete, delayed, and low-resolution signal of refusal, failing to expose intermediate cognitive conflict in AR models (where hesitation is hidden behind committed tokens) or in DLMs (where intermediate drafts resemble incomplete noise). To address this diagnostic gap, the paper introduces the Step-Wise Refusal Internal Dynamics (SRI) signal, a continuous representation unified across AR and diffusion architectures. At generation step \(t\), the model maintains \(P_t\) tokens; last-layer hidden activations \(h_{t,j} \in \mathbb{R}^d\) are extracted and mean-pooled into a step vector \(\phi_t = \frac{1}{P_t} \sum_{j=1}^{P_t} h_{t,j}\). Using offline anchor datasets \(\mathcal{D}_{\text{harmless}}\) and \(\mathcal{D}_{\text{harmful}}\), step-wise prototype centers are defined as \(\mu_t^{\text{harmless}} = \mathbb{E}[\phi_t]\) and \(\mu_t^{\text{harmful}} = \mathbb{E}[\phi_t]\). Alignment is measured via scale-invariant cosine distances: $\(d_t^{\text{harmless}} = 1 - \frac{\langle \phi_t, \mu_t^{\text{harmless}}\rangle}{\|\phi_t\| \|\mu_t^{\text{harmless}}\|}, \quad d_t^{\text{harmful}} = 1 - \frac{\langle \phi_t, \mu_t^{\text{harmful}}\rangle}{\|\phi_t\| \|\mu_t^{\text{harmful}}\|}\)$ A smoothed log-ratio calibrated by temperature \(\tau = 0.1\) and mapped through a sigmoid yields a bounded, step-wise score: $\(\ell_t = \frac{\log(d_t^{\text{harmful}} + \epsilon) - \log(d_t^{\text{harmless}} + \epsilon)}{\tau}, \quad \sigma_t = \text{sigmoid}(\ell_t) \in (0, 1)\)$ The resulting trajectory \(\{\sigma_t\}_{t=1}^T\) defines the SRI signal. Linear Discriminant Analysis (LDA) reveals that benign and explicit refusal responses follow smooth, low-variance, near-deterministic trajectories, whereas adversarial jailbreaks induce violent, non-stationary temporal fluctuations across both AR and DLM architectures. The paper introduces the Internal Recovery Rate (IRR) metric to evaluate how frequently generations transition from compliant intermediate states (\(\sigma_t > \lambda_c\)) to safe terminal states (\(\sigma_T < \lambda_r\)).

3. Lightweight Benign Manifold Anomaly Guard: Replacing Costly External Moderation with Unsupervised Temporal Detection Standard jailbreak defenses—such as external classifier models (LlamaGuard 3) or iterative self-examination (Self-Examine)—impose severe inference overheads (5%–12%) and easily overfit to known attack templates. To overcome both efficiency and generalization bottlenecks, the paper introduces SRI Guard. Rather than attempting to fit ever-evolving attack signatures, SRI Guard exploits the geometric prior that benign generations reside on a structured, low-dimensional temporal manifold in SRI space, casting jailbreak defense as pure unsupervised anomaly detection. Training requires only benign SRI trajectories \(\mathcal{S}_{\text{harmless}}\) from harmless prompts to train a lightweight multi-layer perceptron autoencoder \(f_\psi\) (two encoder layers, two decoder layers, ~3,000 parameters total) via \(L_2\) reconstruction loss: $\(\mathcal{L}_{\text{AE}} = \mathbb{E}_{S \sim \mathcal{S}_{\text{harmless}}} \|S - f_\psi(S)\|^2\)$ At test time, the model generates responses while tracking the 32-step scalar trajectory \(S(x^*)\), and the autoencoder computes the reconstruction anomaly score: $\(\ell_{\text{recon}} = \|S(x^*) - f_\psi(S(x^*))\|^2\)$ If \(\ell_{\text{recon}}\) exceeds the threshold \(\delta\) set at the \((1-\alpha)\) quantile of a held-out benign validation set (default \(\alpha = 0.01\)), the generation is immediately rejected as an adversarial anomaly. Operating on a 32-dimensional vector, SRI Guard requires only microsecond-level matrix multiplications, incurring an almost undetectable 0.01%–0.04% inference overhead (150×–300× faster than external moderators) without altering model weights or decoding mechanics.

Loss & Training

The calibration and training procedures for the SRI representation and SRI Guard autoencoder are structured as follows: 1. Hyperparameters & Anchors: The maximum generation step parameter is fixed to \(T = 32\), calibration temperature \(\tau = 0.1\), and numerical stability constant \(\epsilon = 10^{-6}\). Prototype anchor centers are computed from 400 harmless prompts from Alpaca and 400 harmful prompts from AdvBench. 2. Autoencoder Optimization: The detector autoencoder \(f_\psi\) is trained on 1,200 benign trajectories from Alpaca over 1,500 epochs using the Adam optimizer. Crucially, the training pipeline uses zero jailbreak prompts or adversarial signals. 3. Threshold Calibration: A held-out validation set of 200 harmless prompts from Refined-Prompts is used to calculate benign reconstruction errors, setting the detection threshold \(\delta = \mathcal{Q}_{0.99}\{\|S(x) - f_\psi(S(x))\|^2\}\) to enforce a nominal false-positive rate bounded at 1.0%.

Key Experimental Results

Main Results

The authors evaluated six representative instruction-tuned models across 7B–8B scales (three AR: LLaMA-3, Qwen-2.5, Gemma; three DLM: LLaDA, LLaDA-1.5, Dream) on 600 harmful and jailbreak prompts. The benchmark evaluates raw harmful instructions alongside five prominent jailbreak attacks: Flip Attack, PAIR, Refusal Suppression, Random Search, and Wild Jailbreak. The table below details Refusal Rate (RR ↑) and Attack Success Rate (ASR ↓).

Model Architecture Raw Harmful RR ↑ Raw Harmful ASR ↓ All Jailbreaks RR ↑ All Jailbreaks ASR ↓ Flip Attack ASR ↓ PAIR ASR ↓ Refusal Suppression ASR ↓ Random Search ASR ↓ Wild Jailbreak ASR ↓
LLaMA-3 (8B) AR 83% 13% 23.4% 59.2% 98% 24% 48% 29% 97%
Qwen-2.5 (8B) AR 53% 26% 11.4% 62.2% 91% 44% 46% 31% 99%
Gemma (7B) AR 88% 8% 46.2% 48.2% 86% 20% 17% 26% 92%
LLaDA (8B) Diffusion 83% 6% 67.4% 18.4% 24% 5% 8% 26% 29%
LLaDA-1.5 (8B) Diffusion 84% 9% 59.6% 21.0% 17% 2% 15% 34% 37%
Dream (7B) Diffusion 89% 1% 44.4% 9.4% 18% 0% 5% 4% 20%

Ablation Study

To rigorously disentangle model weights from sampling algorithms, the authors conducted a controlled fixed-weight experiment on LLaDA and LLaDA-1.5 by switching their decoding strategy from AR sampling to native diffusion remasking. Positive \(\Delta\text{RR}\) and \(\Delta\text{ASR}\) denote improved safety. Additionally, the architectural components of the SRI representation were ablated across all models.

Model Attack Method \(\Delta\text{RR}\) (Refusal Rate Improvement) ↑ \(\Delta\text{ASR}\) (Attack Success Rate Reduction) ↑
LLaDA-1.5 Wild Jailbreak +15.0% +21.0%
LLaDA-1.5 Flip Attack +38.0% +60.0%
LLaDA-1.5 PAIR +0.0% +2.0%
LLaDA-1.5 Refusal Suppression +52.0% +20.0%
LLaDA-1.5 Random Search +19.0% +8.0%
LLaDA Wild Jailbreak +14.0% +18.0%
LLaDA Flip Attack +33.0% +36.0%
LLaDA PAIR +7.0% +5.0%
LLaDA Refusal Suppression +55.0% +26.0%
LLaDA Random Search +21.0% +16.0%

Ablation of SRI Representation Components (Average AUROC Across Models): - Discrete Text-based Signal: \(0.573 \pm 0.221\) - Static Activations (First Step Snapshot): \(0.584 \pm 0.138\) - SRI Trajectory (First Layer / Shallow): \(0.566 \pm 0.101\) - SRI Trajectory (Middle Layer): \(0.864 \pm 0.062\) - SRI Trajectory (Last Layer / Deep): \(0.920 \pm 0.047\)

Inference Overhead and Defense Efficacy (Evaluated on LLaDA Base Model):

Defense Method Relative Overhead (%) ↓ False Positive Rate (FP) (%) ↓ Jailbreak Refusal Rate (RR) (%) ↑ Jailbreak Attack Success Rate (ASR) (%) ↓
Undefended 0.00% 7.00% 67.4% 18.4%
Perplexity Filtering (PPL) 6.26% 9.00% 68.0% 18.2%
Self-Examine 7.74% 7.00% 67.4% 18.4%
LlamaGuard 3 12.42% 7.00% 77.2% 14.4%
SRI Guard (Ours) 0.04% 9.00% 73.4% 16.8%

Key Findings

  • Sampling Mechanics are the Primary Driver of Robustness: In the fixed-weight setup, simply changing sampling from AR to diffusion remasking boosted LLaDA's refusal rate under Refusal Suppression by 55.0% and reduced Flip Attack ASR by 36.0% (and by 60.0% on LLaDA-1.5). Crucially, perplexity evaluation confirmed AR models had lower perplexity than DLMs (14.88 vs. 17.38), ruling out general generation fluency as the cause and proving that diffusion remasking actively interrupts and revises harmful intermediate prefixes.
  • Static Snapshots and Shallow Layers Fail: Single-step static activations achieved an AUROC of only 0.584 (barely above chance). Meaningful separability emerges exclusively when temporal dynamics are tracked across diffusion steps using specialized, semantic representations from the final layer (\(0.920\) AUROC).
  • Extreme Efficiency with Cross-Architecture Universality: SRI Guard achieved competitive or superior protection across both AR and DLM families while reducing inference overhead to 0.01%–0.04% (150×–300× faster than external moderation like LlamaGuard 3 or Self-Examine), enabling practical real-time deployment.

Highlights & Insights

  • Sampling Dynamics as a New Alignment Frontier: While existing alignment research focuses almost exclusively on pre-training and preference tuning data, this work demonstrates that the decoding algorithm itself exerts a first-order effect on adversarial safety. Iterative remasking provides an algorithmic space for self-correction that unidirectional AR decoding inherently lacks.
  • Temporal Instability as an Attack Fingerprint: Rather than searching for static refusal directions in embedding space, the authors demonstrate that the temporal variance of internal activations is the true discriminator. Benign generation forms a deterministic low-variance trajectory, whereas adversarial prompts induce sustained, high-variance non-stationary oscillation.
  • Zero-Attack-Data Generalization: By framing jailbreak detection as unsupervised modeling of benign generation manifolds, SRI Guard does not train on any adversarial prompts, making it intrinsically resilient against adaptive over-optimization and unseen attack templates.

Limitations & Future Work

  • Reliance on White-Box Hidden Activations: Extracting the SRI signal requires access to the model's internal Transformer layer activations, precluding deployment in purely black-box commercial API settings where only text output is available.
  • Vulnerability to Zero-Hesitation Jailbreaks: SRI Guard relies on detecting the cognitive conflict that arises when an aligned model is coerced into compliance; if an adversary discovers an attack that suppresses internal refusal representations completely throughout generation, the temporal oscillation will not manifest.
  • Future Directions: Exploring black-box proxies (such as step-wise output logit volatility) and leveraging the continuous SRI gradient to steer the remasking diffusion process actively toward safe generation during inference.
  • vs. Refusal Direction Activation Engineering (Arditi et al., 2024): Arditi et al. identified a static one-dimensional refusal direction in AR hidden states. This paper expands this perspective into dynamic multi-step trajectories (\(T=32\)), extending safety representation analysis to non-autoregressive diffusion models and proving temporal geometry is far more discriminative than static snapshots.
  • vs. Alignment-Enhanced Decoding (AED) (Liu et al., 2024a): AED adjusts next-token probability distributions at the logit level during AR decoding. In contrast, SRI operates in continuous activation space via prototype distances, providing unified tracking across both AR and diffusion architectures without modifying decoding logic.
  • vs. DiffuGuard (Li et al., 2026): DiffuGuard is a diffusion-specific sampling defense that requires access to the original, unmanipulated prompt. SRI Guard does not require clean prompt access, operates effectively across both AR and DLM architectures, and achieves stronger protection against PAD and DIJA attacks.

Rating

  • Novelty: ⭐⭐⭐⭐⭐ Pioneering analysis linking decoding sampling mechanics to jailbreak robustness, introducing the continuous SRI temporal signal and the unsupervised SRI Guard.
  • Experimental Thoroughness: ⭐⭐⭐⭐⭐ Comprehensive evaluation across 6 models, 5 jailbreak paradigms, strictly controlled fixed-weight counterfactuals, and thorough architectural ablations.
  • Writing Quality: ⭐⭐⭐⭐⭐ Rigorous conceptual formulation, clear exposition of sampling dynamics, and clean mathematical definitions.
  • Value: ⭐⭐⭐⭐⭐ Delivers vital empirical and theoretical insights into discrete diffusion safety while providing an ultra-lightweight (<0.04% overhead) defense ready for practical deployment.