Beyond the Prompt: Leveraging Pre-Decoding States for Jailbreak Detection in dLLMs

Adam Hazimeh, Amel Abdelraheem, Ke Wang, Mariam Salman, Ljiljana Dolamic, Gérôme Bovet, Pascal Frossard

TL;DR

Researchers have discovered a powerful new way to detect "jailbreak" attacks in Diffusion Language Models (dLLMs) by peeking at the model's internal states before it even starts generating text. Their proposed system, ReFuse, combines signals from the user's prompt with the model's own "pre-decoding" response states to slash attack success rates from over 63% to just 3.3% without sacrificing performance on benign tasks.

What Problem Does This Paper Address?

As Large Language Models (LLMs) become more integrated into our lives, "jailbreaking"—the art of crafting prompts to bypass safety filters—remains a persistent cat-and-mouse game. Most current defenses focus on the prompt: they try to guess if a user's input is malicious. However, clever attackers use techniques like "context nesting" or dLLM-specific "mask-interleaving" to hide their harmful intent in ways that look benign to a prompt-only filter.

This paper focuses on discrete Diffusion Language Models (dLLMs), a rising alternative to standard autoregressive (AR) models (like GPT-4). Unlike AR models that generate text one token at a time from left to right, dLLMs work by "denoising" an entire block of text simultaneously. This unique architecture creates a new opportunity for defense that hasn't been fully explored until now.

Methods

The authors introduce ReFuse (Representation Fusion), a lightweight, inference-time detector. The core idea is that even if a jailbreak prompt successfully "hides" its intent, the model’s internal hidden states for the response area often reflect the "emerging completion" (i.e., the harmful answer it's about to give) at the very first step of the process.

ReFuse works by training two simple linear classifiers on "frozen" representations (meaning the model itself isn't changed):

  1. Prompt-view ($C_P$): Analyzes the hidden states of the input prompt.
  2. Response-view ($C_R$): Analyzes the hidden states of the "masked" response positions at the initial denoising step ($k=0$).

ReFuse then fuses these two scores using a weighted average and a calibrated threshold. Because it only requires a forward pass of the model's internal states, it doesn't require expensive fine-tuning or changes to the complex denoising math.

Datasets

The researchers used a robust mix of data for training and evaluation:

  • Training: A balanced set of 2,048 samples from WildJailbreak (WJB) and Alpaca.
  • Attack Evaluation: They tested against a "greatest hits" of jailbreaks, including HarmBench (HBB), PAIR, ReNeLLM, and dLLM-specific attacks like DIJA and PAD.
  • Utility Evaluation: To ensure the model doesn't become "too safe" (refusing harmless questions), they tested on ARC-Challenge, MATH-500, and MBPP.
  • Over-refusal Check: They used XSTest, which contains "safe-looking" prompts that are often accidentally blocked by over-eager safety filters.

Key Insights and Ideas

  • The "Aha" Moment: Prompt-side and response-side signals are complementary. Prompt-only detection is great at catching direct attacks, but it's weak against structural attacks like DIJA (which interleaves masks and text). Conversely, the response-side hidden states catch these structural attacks because the model "commits" to the harmful nature of the answer internally before the first token is even finalized.
  • Early Answer Convergence: The paper builds on the observation that dLLMs often decide on the semantic content of an answer very early in the denoising trajectory.
  • Calibration is Crucial: Simply using an "OR" logic (reject if either classifier flags it) leads to too many false positives. ReFuse uses a "Pareto frontier" approach to find the perfect balance between catching bad guys and letting benign users through.

Key Results

The results on the LLaDA-8B-Instruct model are striking:

  • Attack Success Rate (ASR): The undefended model had a 63.29% ASR. A prompt-only classifier brought that down to 11.27%. ReFuse dropped it to 3.31%.
  • Specific Attacks: On the tricky DIJA attack, prompt-only detection failed miserably (63.43% ASR), while ReFuse caught nearly everything (8.57% ASR).
  • Benign Refusal: ReFuse maintained an average benign refusal rate of below 1% on standard utility benchmarks, proving that you can have high security without breaking the model's usefulness.
  • Transferability: Probes trained on one version of a model (LLaDA-8B) worked effectively on other versions (LLaDA-1.5), suggesting these safety signals are fundamental to the model's architecture.

Limitations and Future Work

  • White-Box Requirement: ReFuse requires access to the model's internal hidden states. This makes it perfect for model developers (like OpenAI or Meta) to use as a "guardrail," but it can't be used by third-party developers who only have API access.
  • Adaptive Attacks: While ReFuse beats current attacks, the authors note that future "adaptive" attackers might try to craft prompts specifically designed to keep the response hidden states looking "clean" for as long as possible.
  • Fixed Lengths: The current implementation assumes a target generation length is specified upfront, which is standard for dLLMs but might need adjustment for more dynamic generation settings.

Summary updated

BibTeX
@inproceedings{hazimeh2026beyond,
  author = {Adam Hazimeh and Amel Abdelraheem and Ke Wang and Mariam Salman and Ljiljana Dolamic and Gérôme Bovet and Pascal Frossard},
  title = {{Beyond the Prompt: Leveraging Pre-Decoding States for Jailbreak Detection in dLLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=cQKisMHGgm},
}
Figure