chen-hao-chao/mdm-prime-v2

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

30

stars

15

commits

Python

primary language

Sep 2, 2026

updated

binary
bit
bit-diffusion
diffusion
diffusion-lm
llm
megatron
scaling-laws
subtoken

README



MDM-Prime Paper on arXiv MDM-Prime-v2 on Hugging Face MDM-Prime-v2 on Docker MDM-Prime-v2 on Docker MDM-Prime-v2 on X

News

  • :rocket: [Aug 20, 2026] Our paper has been accepted to EMNLP 2026 (Main).
  • :pencil2: [May 22, 2026] Released a corrected paper. Check out mdm-prime for perplexity evaluation on OWT.
  • :notebook: [May 1, 2026] Released errata note. The current NLL evaluation has bugs. (old preprint)

What’s Inside

This repository contains the code implementation of the experiments presented in the paper MDM-Prime-v2: Binary Encoding and Index Shuffling Enable Scaling of Diffusion Language Models.

  • :whale: Docker environments for easy installation
  • 🤗 Pretrained weights for inference and evaluation
  • :chart_with_downwards_trend: Weights and Biases logs for enhanced reproducibility
  • :microscope: Code for all experiments in our paper:
    • Scaling Analysis
    • Larger-scale Pretraining

Overview

Scaling Analysis

Larger-scale Pretraining

Demo

  • Download our docker image and launch gradio_demo.py:
# Pull and launch the docker image
docker pull chenhaochao/mdm-prime-v2-litgpt:latest
docker run -v $(pwd):/workspace --rm -it --gpus all --ipc=host -p 3000:3000 chenhaochao/mdm-prime-v2-litgpt:latest

# Install gradio and run gradio_demo.py
uv pip install gradio
/venv/mdm-prime-v2-litgpt/bin/python gradio_demo.py
  • Loading the model's weights takes a few minutes. After running the commands, the demo website will be available at http://localhost:3000/.

License

This code implementation is developed based on the following repositories.

Further changes based on the code in this folder are licensed under the Apache-2.0 license.

Citation

If you find this code implementation useful, please consider citing our papers.

@inproceedings{chao2026mdmprimev2,
      title = {{MDM-Prime-v2: Binary Encoding and Index Shuffling Enable Scaling of Diffusion Language Models}}, 
      author = {Chen-Hao Chao and Wei-Fang Sun and Junwei Quan and Chun-Yi Lee and Rahul G. Krishnan},
      booktitle = {Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP)},
      year = {2026},
}
@article{chao2026dependency,
      title   = {{Dependency Breaks Validity of Loss Functions in Masked Diffusion Models}},
      author  = {Chen-Hao Chao and Minkai Xu and Tomas Geffner and Arash Vahdat and Rahul G. Krishnan},
      journal = {chen-hao-chao.github.io},
      year    = {2026}
}
@inproceedings{chao2025mdmprime,
      title = {{Beyond Masked and Unmasked: Discrete Diffusion Models via Partial Masking}}, 
      author = {Chen-Hao Chao and Wei-Fang Sun and Hanwen Liang and Chun-Yi Lee and Rahul G. Krishnan},
      booktitle = {Proceedings of the Conference on Neural Information Processing Systems (NeurIPS)},
      year = {2025},
}

Contributors

chen-hao-chao

15 commits

chen-hao-chao/mdm-prime-v2

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

30

stars

15

commits

Python

primary language

Sep 2, 2026

updated

binary
bit
bit-diffusion
diffusion
diffusion-lm
llm
megatron
scaling-laws
subtoken

README



MDM-Prime Paper on arXiv MDM-Prime-v2 on Hugging Face MDM-Prime-v2 on Docker MDM-Prime-v2 on Docker MDM-Prime-v2 on X

News

  • :rocket: [Aug 20, 2026] Our paper has been accepted to EMNLP 2026 (Main).
  • :pencil2: [May 22, 2026] Released a corrected paper. Check out mdm-prime for perplexity evaluation on OWT.
  • :notebook: [May 1, 2026] Released errata note. The current NLL evaluation has bugs. (old preprint)

What’s Inside

This repository contains the code implementation of the experiments presented in the paper MDM-Prime-v2: Binary Encoding and Index Shuffling Enable Scaling of Diffusion Language Models.

  • :whale: Docker environments for easy installation
  • 🤗 Pretrained weights for inference and evaluation
  • :chart_with_downwards_trend: Weights and Biases logs for enhanced reproducibility
  • :microscope: Code for all experiments in our paper:
    • Scaling Analysis
    • Larger-scale Pretraining

Overview

Scaling Analysis

Larger-scale Pretraining

Demo

  • Download our docker image and launch gradio_demo.py:
# Pull and launch the docker image
docker pull chenhaochao/mdm-prime-v2-litgpt:latest
docker run -v $(pwd):/workspace --rm -it --gpus all --ipc=host -p 3000:3000 chenhaochao/mdm-prime-v2-litgpt:latest

# Install gradio and run gradio_demo.py
uv pip install gradio
/venv/mdm-prime-v2-litgpt/bin/python gradio_demo.py
  • Loading the model's weights takes a few minutes. After running the commands, the demo website will be available at http://localhost:3000/.

License

This code implementation is developed based on the following repositories.

Further changes based on the code in this folder are licensed under the Apache-2.0 license.

Citation

If you find this code implementation useful, please consider citing our papers.

@inproceedings{chao2026mdmprimev2,
      title = {{MDM-Prime-v2: Binary Encoding and Index Shuffling Enable Scaling of Diffusion Language Models}}, 
      author = {Chen-Hao Chao and Wei-Fang Sun and Junwei Quan and Chun-Yi Lee and Rahul G. Krishnan},
      booktitle = {Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP)},
      year = {2026},
}
@article{chao2026dependency,
      title   = {{Dependency Breaks Validity of Loss Functions in Masked Diffusion Models}},
      author  = {Chen-Hao Chao and Minkai Xu and Tomas Geffner and Arash Vahdat and Rahul G. Krishnan},
      journal = {chen-hao-chao.github.io},
      year    = {2026}
}
@inproceedings{chao2025mdmprime,
      title = {{Beyond Masked and Unmasked: Discrete Diffusion Models via Partial Masking}}, 
      author = {Chen-Hao Chao and Wei-Fang Sun and Hanwen Liang and Chun-Yi Lee and Rahul G. Krishnan},
      booktitle = {Proceedings of the Conference on Neural Information Processing Systems (NeurIPS)},
      year = {2025},
}

Contributors

chen-hao-chao

15 commits

Languages

Python

95.8%

Shell

3.7%