Mitigating Backdoors in Masked Diffusion Language Models

Chengzhong Wang, Lang Lin, Shengfang Zhai, Chenru Wang, Daniel Yiming Cao +4 more
11/21/2026
cs.AI
diffusion-flow

No confident code implementation found for this paper.

Abstract

Masked diffusion language models (MDLMs) have emerged as a promising alternative to autoregressive models because they can predict multiple tokens in parallel rather than generating tokens sequentially. However, recent studies have shown that MDLMs are vulnerable to backdoor attacks: when an input contains an attacker-chosen trigger, a backdoored model generates a targeted output, such as malicious code, while otherwise behaving normally.

Show full abstract

Despite this threat, backdoor defenses for MDLMs remain largely underexplored. We present UNMASK, the first defense framework for MDLMs that detects trigger-containing inputs, localizes the trigger tokens, and removes the backdoor from the compromised model. UNMASK exploits two fundamental properties of backdoor triggers, specificity and dominance, to assign a suspiciousness score to each input token. By leveraging two distinctive capabilities of MDLMs, parallel token prediction and token reconstruction at arbitrary positions, UNMASK computes these scores both effectively and efficiently. We further provide a theoretical analysis supporting the design of UNMASK. Evaluations across 40 settings spanning two attacks and four models show that UNMASK detects 99.3% of trigger-containing inputs at a 5% false-positive rate, substantially outperforming the strongest adapted baseline, which achieves 54.8%. UNMASK also achieves over 99% trigger-localization accuracy and reduces the average attack success rate from 95% to 1%, while largely preserving the model's utility on clean inputs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2026mitigating,
  title  = {Mitigating Backdoors in Masked Diffusion Language Models},
  author = {Chengzhong Wang and Lang Lin and Shengfang Zhai and Chenru Wang and Daniel Yiming Cao and Sheng-Yen Chou and Jiaheng Zhang and Pin-Yu Chen and Shengwei An},
  year   = {2026},
  eprint = {2611.28640},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.28640v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.28640.svg)](https://codeofpaper.com/paper/2611.28640)

Discussion