Revealing the Attention Floating Mechanism in Masked Diffusion Models

Xin Dai, Pengcheng Huang, Zhenghao Liu, Shuo Wang, Yukun Yan +4 more
1/12/2026
cs.LGcs.AI

Official code: NEUIR/Attention-Floating (14 stars, last commit 2026-01-14).

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 and datasets are available at https://github.com/NEUIR/Attention-Floating.

View on arXivView PDF

Code Implementations(1)

Source code for our paper "Revealing the Attention Floating Mechanism in Masked Diffusion Models".

140PythonJan 11, 20269 months ago

Similar Papers

Cite this paper

@article{dai2026revealing,
  title  = {Revealing the Attention Floating Mechanism in Masked Diffusion Models},
  author = {Xin Dai and Pengcheng Huang and Zhenghao Liu and Shuo Wang and Yukun Yan and Chaojun Xiao and Yu Gu and Ge Yu and Maosong Sun},
  year   = {2026},
  eprint = {2601.07894},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.07894v1}
}

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

Discussion