Empirical Analysis of Decoding Biases in Masked Diffusion Models

Pengcheng Huang, Tianming Liu, Zhenghao Liu, Yukun Yan, Shuo Wang +3 more
8/18/2025
cs.AIcs.CL

Official code: NEUIR/Uncode (45 stars, MIT, last commit 2026-01-11).

Abstract

Masked diffusion models (MDMs), which leverage bidirectional attention and a denoising process, are narrowing the performance gap with autoregressive models (ARMs). However, their internal attention mechanisms remain under-explored. This paper investigates the attention behaviors in MDMs, revealing the phenomenon of Attention Floating. Unlike ARMs, where attention converges to a fixed sink, MDMs exhibit dynamic, dispersed attention anchors that shift across denoising steps and layers. Further analysis reveals its Shallow Structure-Aware, Deep Content-Focused attention mechanism: shallow layers utilize floating tokens to build a global structural framework, while deeper layers allocate more capability toward capturing semantic content. Empirically, this distinctive attention pattern provides a mechanistic explanation for the strong in-context learning capabilities of MDMs, allowing them to double the performance compared to ARMs in knowledge-intensive tasks. All codes are available at https://github.com/NEUIR/Uncode.

View on arXivView PDF

Code Implementations(1)

NEUIR/UncodeOfficial100%
MIT

[ACL '26] Source code for paper "Empirical Analysis of Decoding Biases in Masked Diffusion Models"

452Shell, PythonAug 16, 20259 months agoMIT

Similar Papers

Cite this paper

@article{huang2025empirical,
  title  = {Empirical Analysis of Decoding Biases in Masked Diffusion Models},
  author = {Pengcheng Huang and Tianming Liu and Zhenghao Liu and Yukun Yan and Shuo Wang and Tong Xiao and Zulong Chen and Maosong Sun},
  year   = {2025},
  eprint = {2508.13021},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2508.13021v3}
}

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/2508.13021.svg)](https://codeofpaper.com/paper/2508.13021)

Discussion