Table of Contents
Fetching ...

Tuning the Implicit Regularizer of Masked Diffusion Language Models: Enhancing Generalization via Insights from $k$-Parity

Jianhao Huang, Baharan Mirzasoleiman

TL;DR

This work analyzes masked diffusion language models through the lens of the $k$-parity problem, revealing that the MD objective naturally decomposes into a task-driven Signal Regime and an information-theoretically obscured Noise Regime that acts as implicit regularization. By deriving an energy-based learning landscape and proposing signal-optimal mask sampling, the authors demonstrate that MDLMs can bypass grokking and generalize rapidly, with empirical gains in both 50M-parameter pretraining and 8B-parameter large-scale settings. They further show that concentrating training on a signal-rich window improves perplexity and downstream task performance, though the optimal masking strategy can depend on the task (discriminative vs. generative). The findings offer a practical temporal scheduling approach for pretraining and fine-tuning masked diffusion models, with potential broad impact on generalization in large language models. Overall, the paper provides a principled framework linking objective structure, mask distribution, and generalization in MDLMs, supported by theory and scalable experiments.

Abstract

Masked Diffusion Language Models have recently emerged as a powerful generative paradigm, yet their generalization properties remain understudied compared to their auto-regressive counterparts. In this work, we investigate these properties within the setting of the $k$-parity problem (computing the XOR sum of $k$ relevant bits), where neural networks typically exhibit grokking -- a prolonged plateau of chance-level performance followed by sudden generalization. We theoretically decompose the Masked Diffusion (MD) objective into a Signal regime which drives feature learning, and a Noise regime which serves as an implicit regularizer. By training nanoGPT using MD objective on the $k$-parity problem, we demonstrate that MD objective fundamentally alters the learning landscape, enabling rapid and simultaneous generalization without experiencing grokking. Furthermore, we leverage our theoretical insights to optimize the distribution of the mask probability in the MD objective. Our method significantly improves perplexity for 50M-parameter models and achieves superior results across both pre-training from scratch and supervised fine-tuning. Specifically, we observe performance gains peaking at $8.8\%$ and $5.8\%$, respectively, on 8B-parameter models, confirming the scalability and effectiveness of our framework in large-scale masked diffusion language model regimes.

Tuning the Implicit Regularizer of Masked Diffusion Language Models: Enhancing Generalization via Insights from $k$-Parity

TL;DR

This work analyzes masked diffusion language models through the lens of the -parity problem, revealing that the MD objective naturally decomposes into a task-driven Signal Regime and an information-theoretically obscured Noise Regime that acts as implicit regularization. By deriving an energy-based learning landscape and proposing signal-optimal mask sampling, the authors demonstrate that MDLMs can bypass grokking and generalize rapidly, with empirical gains in both 50M-parameter pretraining and 8B-parameter large-scale settings. They further show that concentrating training on a signal-rich window improves perplexity and downstream task performance, though the optimal masking strategy can depend on the task (discriminative vs. generative). The findings offer a practical temporal scheduling approach for pretraining and fine-tuning masked diffusion models, with potential broad impact on generalization in large language models. Overall, the paper provides a principled framework linking objective structure, mask distribution, and generalization in MDLMs, supported by theory and scalable experiments.

Abstract

Masked Diffusion Language Models have recently emerged as a powerful generative paradigm, yet their generalization properties remain understudied compared to their auto-regressive counterparts. In this work, we investigate these properties within the setting of the -parity problem (computing the XOR sum of relevant bits), where neural networks typically exhibit grokking -- a prolonged plateau of chance-level performance followed by sudden generalization. We theoretically decompose the Masked Diffusion (MD) objective into a Signal regime which drives feature learning, and a Noise regime which serves as an implicit regularizer. By training nanoGPT using MD objective on the -parity problem, we demonstrate that MD objective fundamentally alters the learning landscape, enabling rapid and simultaneous generalization without experiencing grokking. Furthermore, we leverage our theoretical insights to optimize the distribution of the mask probability in the MD objective. Our method significantly improves perplexity for 50M-parameter models and achieves superior results across both pre-training from scratch and supervised fine-tuning. Specifically, we observe performance gains peaking at and , respectively, on 8B-parameter models, confirming the scalability and effectiveness of our framework in large-scale masked diffusion language model regimes.
Paper Structure (44 sections, 12 theorems, 69 equations, 7 figures, 4 tables)

This paper contains 44 sections, 12 theorems, 69 equations, 7 figures, 4 tables.

Key Result

Theorem 4.2

Let $\mathcal{D}'$ be a dataset of $N$ samples subjected to the stochastic masking process in def:stochastic masking. To ensure that the secret set $\mathcal{S}$ is uniquely identifiable from the corrupted dataset with probability at least $1-\delta$, the number of samples $N$ must satisfy: where $k=|\mathcal{S}|$ is the size of the secret set (excluding the parity bit itself).

Figures (7)

  • Figure 1: Identifiability of masking patterns in the $(n,k)=(4,2)$ parity task. Blue cells indicate the secret set $\mathcal{S}$ and grey cells indicate the masked positions.
  • Figure 2: Training and validation accuracy on $(n,k)=(20,6)$ parity. Standard training (blue, directly supervising $y_{\bm{x}}$) exhibits classic grokking behavior; while training accuracy reaches $100\%$ rapidly, validation accuracy remains at chance level ($50\%$) for a prolonged period before eventually converging to $1$ (see full trajectory in \ref{['app:full traj of parity']}). In contrast, Masked Diffusion (purple, orange) enables near-simultaneous generalization. The fastest convergence is achieved near the theoretically predicted optimal range ($\mathcal{U}[0, 0.246]$). Boundary cases ($\mathcal{U}[0, 0.1]$ and $\mathcal{U}[0, 0.4]$) exhibit instability and slower convergence due to excessive regularization.
  • Figure 3: Test Loss vs. Masking Interval. Evaluation of 50M-parameter models trained on restricted masking ranges of width $0.1$. The x-axis represents the midpoint of the sampling interval (e.g., $x=0.05$ corresponds to $t \sim \mathcal{U}[0, 0.1]$). The dashed blue line represents the baseline performance of standard full-range sampling ($t \sim \mathcal{U}[0,1]$). The U-shaped curve demonstrates that training exclusively within the "Signal-Optimal" window ($t \in [0.4,0.5]$ or $[0.5,0.6]$) significantly outperforms the standard practice of sampling the full range. As a result, we use the range $t \in [0.45, 0.55]$ for the following 8B experiments.
  • Figure 4: Pre-training Test Loss (LLaDA-8B). Evolution of the held-out negative log-likelihood (NLL) over 15K steps. The model trained with the restricted schedule $t \in [0.45, 0.55]$ (orange curve) consistently achieves lower loss compared to the standard $t \in [0, 1]$ baseline (blue curve), indicating superior training efficiency.
  • Figure 5: Learning Dynamics with Uniform Attention. Training and test accuracy on the $(20, 6)$ parity task using an MLP model where attention is fixed to a uniform distribution. The model demonstrates efficient generalization to the test set shortly after the training loss begins to converge, showing no characteristic "grokking" delay despite the absence of attention mechanisms.
  • ...and 2 more figures

Theorems & Definitions (26)

  • Definition 3.1: $(n,k)$ Parity Task
  • Definition 3.2: Full Sequence $\bm{x}'$
  • Definition 3.3: One-Layer Transformer
  • Definition 3.4: Stochastic Masking
  • Definition 3.5: Token Embeddings
  • Definition 3.6: Training Loss Function
  • Definition 4.1: Signal and Noise Regimes
  • Theorem 4.2: Information-Theoretic Identifiability
  • Theorem 4.3: Effective Loss Decomposition
  • Theorem 4.4: Energy Landscape
  • ...and 16 more