Source-linked AI summary

MDM-Prime-v2: Binary Encoding and Index Shuffling Enable Scaling of Diffusion Language Models

Chen-Hao Chao, Wei-Fang Sun, Junwei Quan, Chun-Yi Lee, Rahul G. Krishnan

arXiv:2603.16077v3cs.LG

TL;DR

MDM-Prime’s subtokenizer and granularity choices can raise its training objective when paired with BPE tokenizers, while principled guidance for choosing granularity was missing. The paper analyzes these design choices and develops MDM-Prime-v2 with index shuffling and binary encoding. At 1.1B parameters, MDM-Prime-v2 achieves the highest average zero-shot accuracy across eight benchmarks, while entropy-maximizing assignment remains a practical limitation.

  • Problem

    MDM-Prime lacks principled guidance for token granularity, and base-b subtokenization can be suboptimal with BPE tokenizers because its sub-tokens have low entropy.

  • Method

    The paper analyzes the MDM-Prime objective and develops MDM-Prime-v2 using index shuffling to increase sub-token entropy and binary encoding with ℓ=⌈log2 V⌉.

  • Results

    At 1.1B parameters, MDM-Prime-v2 achieves the highest average zero-shot accuracy across eight benchmarks and outperforms similar-sized MDM and ARM baselines.

  • Takeaways & Limitations

    The analysis provides criteria for subtokenizer design based on sub-token entropy and token granularity, supporting the scaled MDM-Prime-v2 framework.

  • Takeaways & Limitations

    Index shuffling is near-optimal rather than rigorously entropy-maximizing, and a stronger lightweight assignment algorithm remains a future direction.

Abstract

from arXiv · show

Masked diffusion models (MDM) exhibit superior generalization when learned using a Partial masking scheme (Prime). This approach converts tokens into sub-tokens and models the diffusion process at the sub-token level. We identify two limitations of the MDM-Prime framework. First, we find that the functional form of the subtokenizer significantly increases the cross-entropy loss in the objective when paired with commonly used Byte-Pair-Encoding (BPE) tokenizers. Second, we lack tools to guide the hyperparameter choice of the token granularity in the subtokenizer. To address these limitations, we analyze the optimal design of the subtokenizer that minimizes MDM-Prime training objective and develop MDM-Prime-v2, a masked diffusion language model which incorporates Binary Encoding and Index Shuffling. Our analysis characterizes how token granularity and sub-token entropy influence the training objective and downstream performance, providing principled criteria for subtokenizer design. When extending the model size to 1.1B parameters, MDM-Prime-v2 demonstrates superior average zero-shot accuracy across eight commonsense reasoning benchmarks, outperforming similar-sized baselines including GPT-Neo, OPT, Pythia, Bloom, SMDM, and TinyLLaMA.

1 Introduction

MDM-Prime models diffusion at the sub-token level, and MDM-Prime-v2 improves its subtokenizer through index shuffling and principled binary encoding. At 1.1B parameters, it achieves the highest average zero-shot accuracy across eight benchmarks.

  • MDM-Prime-v2: MDM-Prime-v2 combines index shuffling, which encodes high-entropy sub-tokens, with binary encoding using ℓ=⌈log2 V⌉.These are presented as two practical techniques derived from the objective analysis.
  • MDM-Prime: MDM-Prime represents each token as a sequence of ℓ sub-tokens, creating partially masked intermediate states during diffusion.This extends the masked/unmasked state space of standard MDMs and supports fine-grained latent transitions.
  • Analysis: The analysis links subtokenizer design to tokenizer-induced data distributions and finds that high-entropy sub-tokens reduce conditional predictive entropy.The resulting objective provides a basis for selecting subtokenizer functions and granularity.
  • Analysis: The paper analyzes how sub-token entropy and token granularity ℓ influence the optimal MDM-Prime objective, providing a theoretical basis for subtokenizer design.The contribution treats both the encoding function and granularity as design choices rather than fixed empirical settings.
  • Scaling results: At 1.1B parameters, MDM-Prime-v2 achieves the highest average zero-shot accuracy across eight benchmarks and outperforms MDM and ARM baselines.The reported scaling study compares the model with GPT-Neo, OPT, Pythia, Bloom, SMDM, and TinyLLaMA.

2 Background

Masked diffusion models corrupt token sequences through a forward masking process and learn a reverse process that reconstructs original tokens. MDM-Prime applies an invertible subtokenizer so diffusion can operate over partially masked sub-token sequences while preserving the data distribution.

  • Masked Diffusion Models: MDM samples a data token sequence x0 and introduces masked latent sequences xt through a time-dependent forward diffusion kernel.The latent space extends the token alphabet with a masked token m.
  • Masked Diffusion Models: The reverse diffusion process iteratively samples earlier states from xt, using a learned distribution over original sequences x0.At each timestep, the process first samples x0 conditioned on xt and then samples the preceding state.
  • Training objective: Training commonly minimizes a weighted cross-entropy loss over paired clean and diffused sequences, yielding a variational upper bound on negative log-likelihood.When w(t)=1, the objective is an integral of conditional cross-entropy loss.
  • MDM-Prime: MDM-Prime maps each token into ℓ sub-tokens with an invertible subtokenizer fℓ, then applies diffusion to the resulting sub-token sequence.The maximum granularity is ⌈log2 V⌉, which encodes tokens into binary sub-tokens; the standard MDM-Prime choice uses base-b encoding.
  • MDM-Prime: Because fℓ is invertible and the representations are discrete, the change-of-variable principle leaves the target data distribution invariant.MDM-Prime therefore approximates the same objective as MDM after substituting the sub-token representation for the original token representation.
  • Architecture: MDM-Prime requires only a modified embedding lookup: sub-token embeddings are aggregated into token embeddings before token-level neural processing.This design preserves the FLOPs of each training iteration.

3 Methodology

MDM-Prime-v2 improves the subtokenizer by combining index shuffling with binary encoding, while analysis links sub-token entropy and token granularity to the training objective and downstream performance. Experiments show that shuffling lowers loss and that selecting maximum granularity tracks improved downstream results.

  • Subtokenizer design: The proposed subtokenizer composes binary base-b encoding with index shuffling to approximate the loss-minimizing transformation.The operation is implemented with lookup tables and can be performed during preprocessing without FLOPs.
  • Objective analysis: High-entropy sub-tokens are theoretically optimal because the fℓ-dependent objective term is minimized when unmasked sub-token values are uniformly distributed.The objective decomposition separates an fℓ-independent joint-entropy term from an fℓ-dependent entropy term.
  • Index shuffling: BPE token indices produce low-entropy base-b sub-tokens because frequent tokens receive lower indices through iterative frequency-based merging.Index shuffling addresses this mismatch between the tokenizer-induced data distribution and the subtokenizer.
  • Index shuffling: Index shuffling substantially decreases loss across all tested granularities by increasing conditional predictive certainty.The operation scatters similar probability masses across slots, making the conditional distribution more certain after observing a sub-token.
  • Token granularity: The maximum viable granularity, ℓ=⌈log2 V⌉, performs binary encoding and is supported by a non-increasing optimal loss with increasing ℓ.The ARC-e study reports a consistent trend between lower loss and higher downstream accuracy across different ℓ selections.
  • Scaling and evaluation: At 1.1B parameters, MDM-Prime-v2 achieves the highest average zero-shot accuracy across eight commonsense reasoning benchmarks and outperforms similar-sized baselines.The compared baselines include GPT-Neo, OPT, Pythia, Bloom, SMDM, and TinyLLaMA.

4 Experiments

Experiments characterize MDM-Prime-v2 scaling, compute-optimal allocation, benchmark accuracy, sample quality, and internal attention and spectral behavior. At 1.1B parameters, it achieves the highest average accuracy across eight commonsense reasoning benchmarks while showing favorable sampling and representation diagnostics.

  • 4.1 Loss Behavior and Scaling Properties: Training loss for ARM, MDM, and MDM-Prime-v2 decreases as compute increases, but absolute losses are not directly comparable across their different objectives.Figure 7 compares within-family scaling behavior using loss envelopes and isoFLOP curves over compute budgets from 3 × 10^18 to 3 × 10^20 FLOPs.
  • 4.1 Loss Behavior and Scaling Properties: MDM-Prime-v2’s compute-optimal configuration prioritizes training tokens more than model parameters, unlike ARM’s parameter-focused allocation.The comparison follows Chinchilla coefficients: MDM-Prime-v2 has the smallest ˆa and largest ˆb, whereas ARM has the largest ˆa and smallest ˆb.
  • 4.2 Improvement at Larger-Scale Pretraining: At 1.1B parameters, MDM-Prime-v2 achieves the highest average accuracy across eight tasks and outperforms similar-sized baselines on six of eight tasks.Compared baselines include GPT-Neo, OPT, Pythia, Bloom, SMDM, and TinyLLaMA; gains are noted on SciQ and McTaco.
  • 4.2 Improvement at Larger-Scale Pretraining: MDM-Prime-v2 consistently achieves lower Gen PPL with equal or higher entropy than SMDM, with the quality gap widening at larger sampling-step counts.Gen PPL is evaluated using TinyLLaMA trained on 3T tokens.

5 Conclusion

The paper presents MDM-Prime-v2 as a scaled enhancement of MDM-Prime, combining index shuffling with binary encoding and analyzing its scaling and downstream behavior. At 1.1B parameters, it improves performance across eight zero-shot reasoning benchmarks and shows specialized routing and larger stable ranks.

  • 5 Conclusion: MDM-Prime-v2 addresses subtokenizer design issues by using index shuffling and selecting ℓ=⌈log2 V⌉ for binary encoding.The analysis links token granularity and sub-token entropy to the objective and identifies base-b encoding as sub-optimal with BPE tokenizers.
  • 5 Conclusion: At the 1.1B-parameter scale, MDM-Prime-v2 improves performance across eight zero-shot reasoning benchmarks.The conclusion presents this as evidence of practical effectiveness at larger scale.
  • 5 Conclusion: Attention and singular-value analyses indicate more specialized routing mechanisms and larger stable ranks in MDM-Prime-v2’s linear weights.These analyses are presented as indicators of improved representational capacity.

Limitations

The paper identifies entropy-maximizing subtokenizer assignment as an unresolved limitation beyond its practical index-shuffling solution.

  • Limitations: Index shuffling is near-optimal but not rigorously derived as an entropy-maximizing assignment strategy.A greedy entropy-maximizing alternative achieves marginally higher entropy but negligible performance improvement and requires corpus token-frequency statistics.
  • Limitations: Future work could develop entropy-maximizing assignment strategies that improve MDM-Prime-v2 beyond the off-the-shelf random shuffling operation.The paper recommends index shuffling for practical use because it requires no additional corpus statistics.

A.1 Theoretical Analyses

The appendix presents theoretical derivations and proofs for the paper’s propositions, alongside a consolidated notation reference. It directs readers to the relevant sections for formal justification and symbol definitions.

  • A.1.1 Proofs: Theoretical derivations include proofs of Proposition 3.3 and justifications for Propositions 3.1 and 3.2.These materials are organized in Sections A.1.1 and A.1.2, respectively.
  • A.1.2 Notation: Table A1 provides the paper’s table of symbols for interpreting the theoretical analysis.The table is referenced as the notation resource for the appendix.

A.1.1 Proof of Propositions 3.3

The proof establishes a chain of inequalities comparing MDM with MDM-Prime and shows that the optimal MDM-Prime loss decreases as token granularity increases. It proceeds through expectation equivalence, pointwise likelihood comparison, and scheduling-function invariance.

  • Proof structure: The proof of Proposition A.5 uses three steps to establish its inequality.The steps are illustrated in Fig. A1 and combine auxiliary lemmas before synthesizing the final proposition.
  • Proof structure: An appropriate scheduling function and mapping make expectations under MDM and MDM-Prime equivalent for any function F.This equivalence is formalized in Lemma A.2 using fℓ^-1 and gℓ.
  • Proof structure: MDM-Prime’s logarithmic probability is pointwise greater than or equal to MDM’s at every timestep.Lemma A.3 provides this comparison, with equality characterized by the corresponding conditional distributions.
  • Proof structure: The training objective is invariant to the choice of scheduling function when the schedules satisfy the stated monotonicity and boundary conditions.Lemma A.4 proves this invariance by reparameterizing the integration variable.
  • Granularity comparison: The optimal loss becomes smaller as token granularity ℓ increases, extending the comparison from MDM versus MDM-Prime to MDM-Prime models with different granularities.Proposition A.6 generalizes Proposition A.5 to two granularities ℓ1 < ℓ2, and the resulting inequalities are combined in the proof.

A.1.2 Proofs of Propositions 3.1 and 3.2

These proofs isolate the subtokenizer-dependent part of the MDM-Prime objective and bound it using sub-token entropy. The resulting criterion favors sub-token distributions that are independent and uniform, while the architecture preserves per-iteration FLOPs.

  • Objective decomposition: The MDM-Prime objective decomposes into terms independent of and dependent on the subtokenizer fℓ.Proposition 3.1 identifies H(yt) as the only component dependent on fℓ and therefore the primary optimization target.
  • Objective decomposition: The negative data entropy and negative conditional entropy are independent of fℓ, whereas H(yt) depends on fℓ.The conditional entropy equals −Lℓ[(1 − αt) log(1 − αt) + αt log αt].
  • Entropy bound: The entropy of yt is bounded, with equality when each unmasked sub-token is uniformly distributed.The bound uses h(αt) = −(1 − αt) log(1 − αt) − αt log αt.
  • Architecture: MDM-Prime adapts the MDM architecture by modifying the embedding lookup, aggregating sub-token embeddings into token embeddings before token-level processing.The modification preserves the computational cost in FLOPs of each training iteration.
  • Entropy bound: The entropy bound is attained when sub-tokens are independent and uniformly distributed.This condition follows from the entropy decomposition and the cardinality of the sub-token vocabulary.

A.1.3 Estimating the Variational Bound of MDM-Prime

The variational-bound derivation requires marginalizing the model’s joint sub-token distribution because the bound assumes mutually independent sub-token predictions.

  • Variational bound: The MDM-Prime objective requires an additional marginalization step to form a valid variational upper bound on the data negative log-likelihood.The need arises because the derivation assumes mutually independent sub-token predictions.
  • Variational bound: Dependencies among sub-tokens within a token group must be marginalized before substituting the distribution into the training objective.The marginalized distribution is defined using the set Mj of compatible sub-token assignments.
  • Implementation: The required marginalization can be implemented efficiently by filtering the model’s logit outputs.This produces the distribution needed for the variational upper bound.

A.2 Technical Specifications

MDM-Prime-v2 combines index shuffling and binary encoding with the MDM-Prime framework, while scaling and ablation studies assess robustness, efficiency, and downstream performance. The reported results show improved benchmark accuracy, but highlight unresolved challenges in optimal encoding, 7B-scale training efficiency, and post-training analysis.

  • Sampling and timestep behavior: Index shuffling consistently improves log-likelihood across timesteps and shifts the MDM-versus-MDM-Prime crossover from t ≈0.65 to t ≈0.75.The reported crossover behavior indicates that the relative advantage of fine-grained denoising depends on the amount of available context.
  • Ablation analysis: 43.76% average accuracy versus 40.02% shows a 3.74% gain across eight commonsense reasoning benchmarks.The ablation reports that both proposed techniques consistently reduce validation loss and improve zero-shot accuracy.
  • Open encoding questions: Random shuffling is recommended over greedy entropy maximization because greedy assignment yields only a marginal ∆loss = 0.002 improvement while requiring corpus statistics.The paper identifies computationally lightweight entropy-maximizing assignment as an open direction.
  • Limitations and future work: A compute-optimal 7B run remains incomplete, and bidirectional MDMs reach 37% MFU versus approximately 45% for standard ARMs.The authors also identify the relationship between subtokenizer design and downstream capabilities after post-training as future work.
Loading 2603.16077v3…