cs.AINov 21, 2026

Mitigating Backdoors in Masked Diffusion Language Models

Authors: Chengzhong Wang, Lang Lin, Shengfang Zhai, Chenru Wang, Daniel Yiming Cao, Sheng-Yen Chou, Jiaheng Zhang, Pin-Yu Chen, 

Organizations: Virginia Tech · University of Texas at Austin · National University of Singapore · Cornell University · 

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. 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.

Figures & tables

Appendix figures & tables16 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Backdooring Masked Diffusion Language Models

    May 19, 2026Daniel Yiming Cao, Chengzhong Wang, Sheng-Yen Chou +3LLM Backdoor AttacksMasked Diffusion Models

  2. Machine Unlearning for Masked Diffusion Language Models

    May 18, 2026Georu Lee, Seungwon Jeong, Hoki Kim +2Masked Diffusion ModelsDiffusion Model Unlearning