Text Generation
Transformers
Safetensors
llada2_moe
diffusion
dllm
mmd
code
custom_code
conversational
Instructions to use yresearch/DMax-Coder-MMD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yresearch/DMax-Coder-MMD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yresearch/DMax-Coder-MMD", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("yresearch/DMax-Coder-MMD", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yresearch/DMax-Coder-MMD with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yresearch/DMax-Coder-MMD" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yresearch/DMax-Coder-MMD", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yresearch/DMax-Coder-MMD
- SGLang
How to use yresearch/DMax-Coder-MMD with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yresearch/DMax-Coder-MMD" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yresearch/DMax-Coder-MMD", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yresearch/DMax-Coder-MMD" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yresearch/DMax-Coder-MMD", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yresearch/DMax-Coder-MMD with Docker Model Runner:
docker model run hf.co/yresearch/DMax-Coder-MMD
Preview model card for DMax-Coder-MMD
#1
by free001style - opened
README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
base_model: Zigeng/DMax-Coder-16B
|
| 5 |
+
base_model_relation: finetune
|
| 6 |
+
datasets:
|
| 7 |
+
- Zigeng/DMax-LLaDA-2.0-Mini-Code-Trajectories
|
| 8 |
+
tags:
|
| 9 |
+
- diffusion
|
| 10 |
+
- dllm
|
| 11 |
+
- mmd
|
| 12 |
+
- code
|
| 13 |
+
- custom_code
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# DMax-Coder-MMD
|
| 17 |
+
|
| 18 |
+
[](https://www.apache.org/licenses/LICENSE-2.0)  [](https://github.com/yandex-research/dlm-mmd)
|
| 19 |
+
|
| 20 |
+
**Representation-Space MMD for Diffusion Language Models**
|
| 21 |
+
|
| 22 |
+
DMax-Coder-MMD is a 16B diffusion language model for code generation,
|
| 23 |
+
obtained by MMD post-training of
|
| 24 |
+
[DMax-Coder-16B](https://huggingface.co/Zigeng/DMax-Coder-16B).
|
| 25 |
+
It builds on LLaDA2.0-mini and uses DMax's hybrid masked–uniform block diffusion.
|
| 26 |
+
|
| 27 |
+
The post-training objective minimizes Maximum Mean Discrepancy (MMD) between
|
| 28 |
+
model samples and reference responses, measured in the representation space of
|
| 29 |
+
a frozen diffusion language model. The project reports increased tokens per
|
| 30 |
+
forward pass while maintaining or improving accuracy on the benchmarks below.
|
| 31 |
+
|
| 32 |
+
## Reference results
|
| 33 |
+
|
| 34 |
+
Results reported in the project README, with decoding threshold **0.9**.
|
| 35 |
+
Each entry is **accuracy (%) / tokens per forward pass (TPF)**.
|
| 36 |
+
Baseline results are attributed to the original DMax paper in the project README.
|
| 37 |
+
|
| 38 |
+
| Method | HumanEval-Instruct | MBPP-Instruct |
|
| 39 |
+
| --- | :---: | :---: |
|
| 40 |
+
| DMax-Coder | 83.5 / 7.36 | 79.2 / 5.86 |
|
| 41 |
+
| **DMax-Coder-MMD** | **85.9** / **8.07** | **83.0** / **6.10** |
|
| 42 |
+
|
| 43 |
+
Results can vary with hardware, tensor parallelism, and library versions.
|
| 44 |
+
TPF measures decoding parallelism; wall-clock speed also depends on the runtime.
|
| 45 |
+
|
| 46 |
+
## Evaluation and inference
|
| 47 |
+
|
| 48 |
+
Use DMax's dInfer evaluation pipeline. After following the evaluation environment
|
| 49 |
+
setup in the [project README](https://github.com/yandex-research/dlm-mmd#installation),
|
| 50 |
+
run from the project repository root:
|
| 51 |
+
|
| 52 |
+
```bash
|
| 53 |
+
conda activate dinfer
|
| 54 |
+
DOMAIN=code MODEL_PATH=yresearch/DMax-Coder-MMD bash scripts/eval.sh
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
The project's code evaluation uses threshold **0.9** and evaluates
|
| 58 |
+
HumanEval-Instruct and MBPP-Instruct.
|
| 59 |
+
|
| 60 |
+
The checkpoint includes nine Safetensors shards with BF16 parameters and FP32
|
| 61 |
+
router bias buffers, plus its tokenizer, chat template, and custom model code.
|
| 62 |
+
Direct Transformers loading requires `trust_remote_code=True`. Pass
|
| 63 |
+
`dtype=torch.bfloat16` for BF16 loading; the current configuration declares FP32.
|
| 64 |
+
|
| 65 |
+
Generation requires the DMax/dInfer diffusion decoder. The included custom
|
| 66 |
+
backbone does not implement the standard Transformers `.generate()` interface.
|
| 67 |
+
|
| 68 |
+
## License and acknowledgements
|
| 69 |
+
|
| 70 |
+
The model follows the **Apache-2.0** license of the
|
| 71 |
+
[DMax-Coder base checkpoint](https://huggingface.co/Zigeng/DMax-Coder-16B)
|
| 72 |
+
and [LLaDA2.0-mini](https://huggingface.co/inclusionAI/LLaDA2.0-mini).
|
| 73 |
+
The included model implementation retains its Apache-2.0 notices.
|
| 74 |
+
The separate MMD training repository is MIT-licensed, with Apache-2.0 third-party components.
|
| 75 |
+
|
| 76 |
+
We thank the authors of [DMax](https://github.com/czg1225/DMax),
|
| 77 |
+
[LLaDA2.0-mini](https://huggingface.co/inclusionAI/LLaDA2.0-mini), and
|
| 78 |
+
[dInfer](https://github.com/inclusionAI/dInfer) for releasing their models, data, and code.
|
| 79 |
+
|
| 80 |
+
## Citation
|
| 81 |
+
|
| 82 |
+
If you find this work useful in your research, please consider citing:
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@article{drobyshevskiy2026mmd,
|
| 86 |
+
title = {Representation-Space MMD for Diffusion Language Models},
|
| 87 |
+
author = {Drobyshevskiy, Ilya and Sudakov, Ilia and Semenov, Maksim and Kuznedelev, Denis and
|
| 88 |
+
Ignatov, Maksim and Temirchev, Pavel and Balagansky, Nikita and
|
| 89 |
+
Meshchaninov, Viacheslav and Gushchin, Nikita and Baranchuk, Dmitry},
|
| 90 |
+
journal = {arXiv preprint TODO},
|
| 91 |
+
year = {2026}
|
| 92 |
+
}
|
| 93 |
+
```
|