ρ-$\texttt{EOS}$: Training-free Bidirectional Variable-Length Control for Masked Diffusion LLMs

Jingyi Yang, Yuxian Jiang, Jing Shao
1/30/2026
cs.CL

Official code: yjyddq/rho-EOS (8 stars, Apache-2.0, last commit 2026-02-07).

Abstract

Beyond parallel generation and global context modeling, current masked diffusion large language models (masked dLLMs, i.e., LLaDA) suffer from a fundamental limitation: they require a predefined, fixed generation length, which lacks flexibility and forces an inevitable trade-off between output quality and computational efficiency. To address this, we study the denoising dynamics and find that the implicit density ($ρ$) of end-of-sequence ($\texttt{EOS}$) tokens serves as a reliable signal of generation sufficiency. In particular, the evolving implicit $\texttt{EOS}$ density during denoising reveals whether the current masked space is excessive or insufficient, thereby guiding the adjustment direction for generation length. Building on this insight, we propose $\textbf{$ρ$-$\texttt{EOS}$}$, a training-free, single-stage strategy that enables bidirectional variable-length generation for masked dLLMs. Unlike prior two-stage approaches--which require separate length adjustment and iterative mask insertion phases while supporting only unidirectional expansion--$\textbf{$ρ$-$\texttt{EOS}$}$ achieves bidirectional length adjustment within a unified denoising process by continuously estimating the implicit $\texttt{EOS}$ density: excessively high density triggers $\texttt{MASK}$ token contraction, while insufficient density induces expansion. Extensive experiments on mathematics and code benchmarks demonstrate that $\textbf{$ρ$-$\texttt{EOS}$}$ achieves comparable performance while substantially improving inference efficiency and token utilization. Code is available at https://github.com/yjyddq/rho-EOS.

View on arXivView PDF

Code Implementations(1)

yjyddq/rho-EOSOfficial100%
Apache-2.0

Official Repository of "ρ-𝙴𝙾𝚂: Training-free Bidirectional Variable-Length Control for Masked Diffusion LLMs"

80Shell, PythonFeb 7, 20268 months agoApache-2.0
diffusiondiffusion-language-modelsdiffusion-large-language-modelsdiffusion-modelsdllm+2 more

Similar Papers

Cite this paper

@article{yang2026texttteos,
  title  = {ρ-$\texttt{EOS}$: Training-free Bidirectional Variable-Length Control for Masked Diffusion LLMs},
  author = {Jingyi Yang and Yuxian Jiang and Jing Shao},
  year   = {2026},
  eprint = {2601.22527},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.22527v2}
}

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

Discussion