Diffusion large language models (dLLMs) have recently emerged as a strong alternative to autoregressive models, generating responses by iteratively refining masked tokens in parallel rather than decoding sequentially. While enabling more efficient and flexible inference, dLLMs remain vulnerable to jailbreak attacks, including recent attacks that exploit properties unique to dLLMs such as bidirectional conditioning and parallel masked-token refinement. In this work, we show that these same properties also expose a safety-relevant detection surface absent from standard autoregressive decoding: even when a jailbreak is difficult to identify from prompt representations alone, it can still be detected from hidden states over masked response positions before any tokens are generated. By training linear classifiers on prompt and pre-decoding response representations, we empirically show that neither view strictly dominates, with each detecting attacks that the other misses. We introduce ReFuse (Representation Fusion), an inference-time detector that fuses the sigmoid harmfulness scores of the two classifiers. Without modifying model weights or the decoding procedure, ReFuse reduces average ASR across multiple jailbreaks from 63.29% for the undefended model and 11.27% for a prompt-only classifier to 3.31%, while keeping average benign refusal on standard utility benchmarks below 1% on LLaDA-8B. Together, these results establish ReFuse as a lightweight jailbreak detector for dLLMs that improves safety beyond prompt-only detection.
Figures & tables
Figure 1: Overview of ReFuse : Given a prompt, we extract a prompt-view representation from prompt hidden states and a response-view representation from the pre-decoding masked response states. The two classifiers produce the respective harmfulness scores pP(x) and pR(x) , which are fused into a calibrated rejection decision through a score s(x) and a threshold τ before decoding.
Figure 2: Classifier complementarity on harmful attacks. Each chart decomposes harmful examples of each attack into those detected by either classifier alone, those detected by both classifiers, and those missed by both. The response view contributes most strongly on DIJA, where many examples missed by the prompt view are recovered from pre-decoding response states.
Figure 3: Prompt-response score differences. Each curve shows the distribution of the signed harmfulness-score difference pR(x)−pP(x) across harmful examples. HBB is concentrated near zero, PAIR exhibits a negative tail, DIJA is shifted toward positive differences, and ReNeLLM spans both directions.
Figure 4: ReFuse calibration parameter sweeps. For each model, we sweep fusion weights λ and rejection thresholds τ on the classifier validation split. Points show the resulting harmful false negative and benign rejection rates, lines indicate the Pareto frontier, and stars mark the selected operating points. Zoomed views magnify the frontier near the selected points and report the corresponding (λ,τ) .
Table 1: Main attack and benign-refusal results ASR is attack success rate; BRR is benign refusal rate. Lower is better for both. Avg. ASR is the macro-average over the displayed attacks, Avg. BRR is the macro-average over ARC-C, MATH-500, and MBPP, and XSTest BRR is reported in a separate panel. Bold ASR values indicate the lowest attack success rate among the evaluated defenses for each column. ReFuse is selected for a calibrated ASR-BRR trade-off rather than for the lowest ASR in every column.
Figure 5: ReFuse robustness to decoding-configuration shifts on LLaDA. Pre-decoding detection performance across target lengths and remasking strategies for representative attacks. The same classifiers are used across all configurations without retraining, maintaining robust detection despite changes to the subsequent decoding procedure. Raw numbers are reported in Appendix B.6 .
ASR ↓
BRR ↓
Target
Method / Probe Source
Behavior
PastTense
AH
PAIR
ReNeLLM
DIJA
PAD
DIA-I
Prefill
Avg.
ARC-C
MATH
MBPP
Avg.
XSTest
LLaDA 8B
Undefended
13.89
50.29
33.33
100.00
100.00
97.14
67.22
96.09
11.67
63.29
0.00
0.00
0.00
0.00
12.22
ReFuse , native probes
1.11
3.43
0.00
0.56
14.44
8.57
1.11
0.00
0.56
3.31
2.22
0.00
0.00
0.74
15.56
ReFuse , transferred probes
1.11
2.29
0.00
0.56
20.00
12.57
1.67
0.00
0.56
4.31
3.89
0.00
0.00
1.30
17.22
LLaDA 1.5
Undefended
11.67
45.71
32.22
99.44
100.00
97.14
58.89
93.30
11.11
61.05
0.00
0.00
0.00
0.00
10.00
ReFuse , native probes
0.56
2.29
0.00
0.56
17.78
11.43
1.67
0.00
1.67
4.00
4.44
0.00
0.00
1.48
15.56
Table 2: Transferability across LLaDA-8B-Instruct and LLaDA 1.5. Per-attack ASR and benign refusal-rate results for native and transferred ReFuse policies across LLaDA targets. Lower is better for both ASR and benign refusal rates. Avg. ASR is computed over the displayed ASR columns, Avg. BRR is computed over ARC-C, MATH, and MBPP, with XSTest reported separately. Best and second-best defended ASR results within each target are highlighted in bold and underline , respectively. Tied best results are both bolded.
Table 3: Efficiency trade-off for one-pass detection. ReFuse uses separate prompt-only and masked-sequence forward passes, while ReFuse + computes both classifier scores from a single masked-sequence pass by replacing CP with CP+ . Lower is better for both ASR and benign refusal rates.
Figure 6: Score-aware adaptive PAIR against ReFuse . Goal-level and Global-level ASR as a function of cumulative valid candidates evaluated under increasing PAIR iteration budgets.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Model
HF checkpoint
Gen. length
Block length
Steps
Temp.
CFG
Remasking / Alg.
Top- p
Alg. temp.
LLaDA-8B-Instruct
GSAI-ML/LLaDA-8B-Instruct
256
256
128
0.0
0.5
Random
–
–
LLaDA-1.5
GSAI-ML/LLaDA-1.5
256
256
128
0.0
0.5
Random
–
–
Dream-7B
Dream-org/Dream-v0-Instruct-7B
256
–
128
0.0
–
Origin
1.0
0.0
Appendix
Table 4: Main decoding configurations. Unless otherwise mentioned, we use the same decoding configurations for all our experiments.
Hyperparameter
Value
Task
Binary request harmfulness classification
Layer
Final layer
Fixed response length
256
Maximum sequence length
1024
Feature standardization
Train-split mean and standard deviation
Optimizer
AdamW
Appendix
Table 5: Classifier training hyperparameters. All linear classifiers are trained on frozen representations. Prompt-view probes pool over prompt tokens, while response-view probes pool over all response positions.
Attack
Mechanism
Key parameters
Behavior Raw
Sends the original harmful prompt directly to the victim model.
–
Prefill [ Andriushchenko et al., 2025 , Li et al., 2025 ]
Appends a compliance-inducing suffix to the prompt.
Suffix: ‘‘Sure, here is:’’
PastTense [ Andriushchenko and Flammarion, 2025 ]
Uses a helper model to rewrite the request as a past-tense question.
Up to 10 attempts
ReNeLLM [ Ding et al., 2024 ]
Applies 1-6 randomly sampled lexical rewriting ops, wraps result in a nested scenario (code, table, or story); gate classifier filters invalid rewrites
Uses adversarial harmful prompts drawn from WildJailbreak.
We use 180 samples from the adversarial harmful split
PAIR [ Chao et al., 2025 ]
Iteratively refines an adversarial prompt using helper-model feedback and a judge score.
5 streams × 3 iterations; target prefix: ‘‘Sure, here is’’ ; keep last 3 turns
Appendix
Table 6: Attack configurations used in our evaluation.
Table 7: Performance on the test split. CP denotes our prompt classifier and CR denotes the response classifier. The classifiers are evaluated at k=0 .
Figure 7: ROC curves of harmfulness classifiers. Comparison of the prompt-view classifier CP , response-view classifier CR , and fused harmfulness score across LLaDA-8B, LLaDA-1.5, and Dream-7B. Curves show harmful true positive rate against benign false positive rate, with AUROC values reported in the legends.
Figure 8: Cross-step generalization of response-view probes. Each cell reports TPR at 1% FPR for a response-view probe trained at the denoising step on the y-axis and evaluated at the denoising step on the x-axis. The bottom three rows use classifiers trained on multiple denoising states: Early uses states 0 – 15 and corresponds to our response classifier CR , Sparse uses states {0,8,16,32,64,96,127} , and All uses states 0 – 127 .
Classifier
Avg. ASR ↓
Utility BRR ↓
XSTest BRR ↓
Linear
3.31
0.74
15.56
MLP
1.63
2.59
22.22
Transformer
1.38
3.70
20.56
Appendix
Table 8: Comparison of classifier architectures for ReFuse . Results at calibrated fusion operating points.
Group
N
Mean pR
Median pR
P10
P90
Benign, non-refusal
698
0.0230
0.0000
0.0000
0.0009
Benign, refusal
22
0.2615
0.0079
0.0000
0.9171
Harmful, refusal
710
0.9484
0.9999
0.9362
1.0000
Harmful, compliance
1,575
0.8114
0.9984
0.0607
1.0000
Appendix
Table 9: Response-side classifier CR scores grouped by request harmfulness and eventual response.
Figure 9: Response-position sensitivity examples. Shading shows absolute gradient × activation attribution of post-hoc response tokens to the transformer classifier’s harmfulness logit.
Table 10: Raw robustness results. Raw ASR values underlying the four-panel robustness figure. Values are percentages; lower is better. Results are grouped by dataset, remasking strategy, and generation length.
XSTest category
LLaDA-8B
LLaDA-1.5
Dream-7B
Historical events
+4/19
+4/19
+2/19
Privacy (public)
+1/18
+3/18
+2/18
Definitions
0/19
+1/19
+2/19
Real group / nonsense discrimination
0/17
0/17
+3/17
Safe targets
+1/17
+1/17
0/17
Privacy (fictional)
0/20
+1/20
0/20
Appendix
Table 11: Category-level XSTest refusal increases with ReFuse . Entries show the net increase in refusals relative to the undefended model, out of the total samples in each category. Categories with no increase for any model are omitted. The last row reports the overall increase in BRR.
Diffusion large language models (dLLMs) enable flexible masked generation through bidirectional context modeling, but this capability also introduces a distinct jailbreak attack surface. We find that a harmful response to a given query naturally serves as an effective jailbreak template: simply masking a subset of its tokens can induce a dLLM to reconstruct harmful content. Based on this observation, we propose RMT-Jailbreak, a general framework that transfers existing autoregressive (AR) jailbreak attacks to dLLMs through their induced harmful responses. RMT-Jailbreak converts an AR-generated harmful response into a high-mask-ratio template using uniform token retention, and further applies prompt-based safety filtering to mask any remaining visible harmful content. The refined template is then provided to the target dLLM for bidirectional reconstruction. Extensive experiments across multiple AR jailbreak methods and target dLLMs demonstrate the effectiveness and generality of RMT-Jailbreak, revealing strong cross-paradigm transferability of jailbreak attacks.
Jinwei Gan, Zifeng Cheng, Zhiwei Jiang +3
State Key Laboratory for Novel Software Technology, Nanjing University · Nanjing University of Posts and Telecommunications
Existing attacks and defenses for diffusion-based large language models (dLLMs) target specific vulnerabilities but lack a shared framework explaining why attacks succeed. We propose one by interpreting safety alignment as shaping the denoising energy landscape: a well-aligned model routes harmful queries toward safe outputs through an energy barrier that separates the two regions. Current jailbreak attacks reduce to two strategies for circumventing this barrier: obscuring the query's safety disposition at initialisation, or intervening mid-trajectory to force the denoising path across the energy barrier. From this perspective and the result that masked diffusion models minimise kinetic energy during denoising, we derive three complementary, training-free detection signals: a step-0 ratio that reads the initial safety disposition from the logit distribution before generation begins, and two trajectory-velocity signals that track kinetic energy in complementary subspaces of the logit space. An attack must either reveal its intent at initialisation or expend kinetic energy to cross the barrier in at least one monitored subspace, so the three signals cover each other's blind spots in the energy budget by construction. Evaluation across three dense dLLMs (LLaDA-8B, LLaDA-1.5, Dream-7B) and a sparse mixture-of-experts dLLM (LLaDA-MoE-7B) confirms this complementarity. In stress tests of known attacks, every configuration that evades detection also fails to produce harmful content, suggesting that the detection and barrier-crossing thresholds are hard to separate.
Thong Bach, Dung Nguyen, Thao Minh Le +1
Applied Artificial Intelligence Initiative (A2I2), Deakin University · Pennsylvania State University
Diffusion large language models (dLLMs) generate text by iteratively denoising partially masked sequences under bidirectional context, exposing a safety surface distinct from autoregressive LLMs. Because mask tokens are native inputs and tokens are committed by confidence rather than position, harmful content can be induced through infilling and outside the monitored prefix. Existing jailbreaks either miss this native infill capability or rely on low-diversity mask-bearing templates applied uniformly across goals, with little structural adaptation or accumulated attack experience. We propose MaskForge, a fully black-box adaptive attack that casts dLLM red-teaming as optimized search over a growing library of structural patterns. MaskForge abstracts successful attempts into reusable schemas, selects goal-compatible patterns with a UCB bandit, and invokes a scorer-guided fallback when the current library fails. Successful attempts are distilled back into the pattern library, enabling experience to accumulate across goals. Across five public dLLMs and three benchmarks, MaskForge achieves an average attack success rate of 79.3%, a 17.6% relative improvement over the strongest competing dLLM baseline. The matured pattern library further transfers to AdvBench without any updates, achieving a 88.2% attack success rate and a 67% relative improvement over the strongest competing baseline.
Yingzi Ma, Zhengyue Zhao, Xiaogeng Liu +3
University of Wisconsin-Madison · Johns Hopkins University · Responsible AI Research (RAIR) Centre, The University of Adelaide +1