NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

$\mathcal{D}^2$-Monitor: $\mathcal{D}$ynamic Safety Monitoring for $\mathcal{D}$iffusion LLMs via Hesitation-Aware Routing

Aoxi Liu, Yupeng Chen, James Oldfield, Guan Zhe Hong, Junchi Yu, Baoyuan Wu, Philip Torr, Adel Bibi

TL;DR

Researchers have developed $\mathcal{D}^2$-Monitor, a bi-level safety system for Diffusion Large Language Models (D-LLMs) that uses a model's internal "hesitation" to detect harmful prompts. By routing only difficult, high-hesitation samples to a complex secondary probe while handling easy cases with a lightweight linear monitor, they achieve state-of-the-art safety detection with a tiny memory footprint ($\leq$ 0.85M parameters).

What Problem Does This Paper Address?

While standard Autoregressive LLMs (like GPT-4) generate text one token at a time, Diffusion LLMs (D-LLMs) are emerging as a faster, more flexible alternative. They generate text by starting with a fully masked sequence and iteratively "denoising" it over multiple steps.

However, safety monitoring for these models is still in its infancy. Most current monitors only look at the final output (single-step monitoring). The authors argue this is a missed opportunity: because D-LLMs refine the whole sequence over many steps, they expose a "trajectory" of internal hidden states. This trajectory contains rich information about the model's uncertainty that isn't visible in the final result alone.

The challenge is how to use this multi-step data efficiently. Running a heavy, complex safety classifier at every single denoising step would be computationally ruinous for real-time applications.

Methods

The authors introduce a concept called Safety Hesitation. They found that when a D-LLM is faced with a "hard" or adversarial prompt, its intermediate hidden states often hover near the decision boundary of a safety classifier.

They propose $\mathcal{D}^2$-Monitor, a two-stage system:

  1. The Base Probe (Always-On): A lightweight linear probe that processes every denoising step. It performs a basic safety check and calculates Hesitation Severity ($n_\tau$)—the number of steps where the model's internal state was "unsure" (close to the decision boundary).
  2. The Router: If the hesitation severity is low, the base probe's answer is used. If hesitation exceeds a certain threshold, the sample is flagged as "hard" and routed to the next stage.
  3. The Advanced Probe (Conditional): A more expressive (but heavier) model—either a Multi-Layer Perceptron (MLP) or a Temporal Attention (TimeAttn) probe. This probe is trained specifically on these "hesitant" trajectories to make the final call.

This "cascade" approach ensures that simple, safe queries incur almost zero overhead, while suspicious or complex queries trigger a more robust defense.

Datasets

The researchers evaluated their method across three major safety benchmarks:

  • WildGuardMix: A large-scale dataset (86.8k training prompts) that includes many adversarial inputs designed to "jailbreak" or bypass safety filters.
  • ToxicChat: A collection of 10k real-world user-AI interactions annotated for toxicity.
  • OpenAI-Moderation: Used for cross-dataset evaluation to see how well the monitor generalizes to unseen categories like hate speech and self-harm.

They tested these against four D-LLMs, including the LLaDA family (ranging from 8B to 16B parameters).

Key Insights and Ideas

  • Hesitation is a Proxy for Difficulty: The number of steps a model spends in a "hesitant" state is a remarkably accurate predictor of whether a simple probe will fail.
  • Intrinsic vs. Extrinsic Signals: The authors compared "extrinsic" signals (like the entropy of the predicted tokens) to "intrinsic" signals (the margin of the probe's decision boundary). They found that probe-intrinsic margins are far more effective at identifying hard samples.
  • Adversarial Detection: Adversarial prompts (jailbreaks) naturally push D-LLMs into borderline decision states across multiple denoising steps. Consequently, $\mathcal{D}^2$-Monitor acts as an implicit detector for adversarial conditioning; in tests, the "routed" subset of samples was significantly enriched with adversarial inputs (up to 86% in some cases).
  • Trajectory Matters: Using the full denoising trajectory consistently outperforms looking only at the final step, proving that the "path" to an answer is just as important as the answer itself for safety.

Key Results

  • Efficiency: $\mathcal{D}^2$-Monitor uses fewer than 0.85 million parameters—roughly 0.01% of the size of an 8B parameter model.
  • Performance: It achieved the best trade-off between effectiveness (F1 score) and efficiency compared to 8 baselines.
  • Speed: The $\mathcal{D}^2$-MLP variant achieved a 2.4x to 6.6x speedup over standard full-trajectory MLP monitors by only activating the complex probe when necessary.
  • Generalization: The system remained robust even when the generation length or the number of denoising steps was changed at test time, showing it doesn't just memorize specific training configurations.

Limitations and Future Work

  • Model Scale: The study was limited to D-LLMs up to 16B parameters. While the authors expect the trends to hold for larger models (like 100B+), this remains to be empirically proven.
  • Adaptive Adversaries: A sophisticated attacker might try to craft "stealthy" prompts that result in very few hesitation steps to avoid triggering the second-stage probe. The authors suggest that future work should investigate the robustness of these activation cascades against such adaptive attacks.
  • Deployment: The current work focuses on external monitors; integrating these insights directly into the D-LLM's alignment process is another potential avenue.

Summary updated

BibTeX
@inproceedings{liu2026mathcal,
  author = {Aoxi Liu and Yupeng Chen and James Oldfield and Guan Zhe Hong and Junchi Yu and Baoyuan Wu and Philip Torr and Adel Bibi},
  title = {{$\textbackslash\{\}mathcal\{D\}^2$-Monitor: $\textbackslash\{\}mathcal\{D\}$ynamic Safety Monitoring for $\textbackslash\{\}mathcal\{D\}$iffusion LLMs via Hesitation-Aware Routing}},
  booktitle = {AI4GOOD @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=MrFnMWpY77},
}
Figure