Fast-dLLM v2 is a carefully designed block diffusion language model (dLLM) that efficiently adapts pretrained autoregressive (AR) models into dLLMs for parallel text generation, requiring only approximately 1B tokens of fine-tuning. This represents a 500x reduction in training data compared to full-attention diffusion LLMs while preserving the original model's performance.
https://github.com/user-attachments/assets/f2e055f5-3a44-41ca-9ef8-c84cf3ac2951
Block-wise causal attention mask and complementary training strategy
Block-level autoregressive generation with sub-block parallelization
Fast-dLLM v2 significantly outperforms baselines in both efficiency and accuracy:
Throughput and accuracy comparison across different model variants
Comprehensive evaluation across diverse tasks:
| Model Size | Model | HumanEval-Base | HumanEval-Plus | MBPP-Base | MBPP-Plus | GSM8K | Math | IFEval | MMLU | GPQA | Average |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1B-scale | Fast-dLLM v2 (1.5B) | 43.9 | 40.2 | 50.0 | 41.3 | 62.0 | 38.1 | 47.0 | 55.1 | 27.7 | 45.0 |
| 7B+ scale | Fast-dLLM v2 (7B) | 63.4 | 58.5 | 63.0 | 52.3 | 83.7 | 61.6 | 61.4 | 66.6 | 31.9 | 60.3 |
Comprehensive benchmark comparison across diverse tasks
First, create and activate a conda environment:
conda create -n lmflow python=3.9 -y
conda activate lmflow
conda install mpi4py
Install the package in development mode:
pip install -e .
Download the training data (e.g., Alpaca dataset):
cd data
bash download.sh alpaca
Run the fine-tuning script:
bash train_scripts/finetune_alpaca.sh
This will start the training process using the Alpaca dataset with the optimized block diffusion training recipe.
Launch the Gradio-based web interface:
python app.py
This will start a web server at http://localhost:10086 with:
For a simple command-line interface:
python run_chatbot.py
Commands:
clear - Clear conversation historyexit - Quit the chatbotExecute the evaluation script for comprehensive benchmarking:
bash eval_script.sh
This script evaluates the model on:
For custom evaluation with specific parameters:
accelerate launch eval.py \
--tasks gsm8k \
--batch_size 32 \
--num_fewshot 0 \
--model fast_dllm_v2 \
--model_args model_path=Efficient-Large-Model/Fast_dLLM_v2_7B,threshold=0.9
v2/
โโโ app.py # Gradio web interface
โโโ run_chatbot.py # Command-line chatbot
โโโ eval.py # Evaluation harness integration
โโโ eval_script.sh # Benchmark evaluation script
โโโ generation_functions.py # Core generation algorithms
โโโ index.html # Project webpage
โโโ asset/ # Visual assets
โ โโโ demo.mp4
โ โโโ benchmark_results.png
โ โโโ throughput.png
โ โโโ training_recipe.png
โ โโโ visualization_animation.gif
โโโ README.md # This file
The web interface provides real-time visualization of:
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
If you find this work useful, please cite our paper:
@misc{wu2025fastdllmv2efficientblockdiffusion,
title={Fast-dLLM v2: Efficient Block-Diffusion LLM},
author={Chengyue Wu and Hao Zhang and Shuchen Xue and Shizhe Diao and Yonggan Fu and Zhijian Liu and Pavlo Molchanov and Ping Luo and Song Han and Enze Xie},
year={2025},
eprint={2509.26328},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.26328},
}
We thank Qwen2.5 for the base model architecture
1 commits
Python
98.3%
Shell
1.7%
Fast-dLLM v2 is a carefully designed block diffusion language model (dLLM) that efficiently adapts pretrained autoregressive (AR) models into dLLMs for parallel text generation, requiring only approximately 1B tokens of fine-tuning. This represents a 500x reduction in training data compared to full-attention diffusion LLMs while preserving the original model's performance.
https://github.com/user-attachments/assets/f2e055f5-3a44-41ca-9ef8-c84cf3ac2951
Block-wise causal attention mask and complementary training strategy
Block-level autoregressive generation with sub-block parallelization
Fast-dLLM v2 significantly outperforms baselines in both efficiency and accuracy:
Throughput and accuracy comparison across different model variants
Comprehensive evaluation across diverse tasks:
| Model Size | Model | HumanEval-Base | HumanEval-Plus | MBPP-Base | MBPP-Plus | GSM8K | Math | IFEval | MMLU | GPQA | Average |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1B-scale | Fast-dLLM v2 (1.5B) | 43.9 | 40.2 | 50.0 | 41.3 | 62.0 | 38.1 | 47.0 | 55.1 | 27.7 | 45.0 |
| 7B+ scale | Fast-dLLM v2 (7B) | 63.4 | 58.5 | 63.0 | 52.3 | 83.7 | 61.6 | 61.4 | 66.6 | 31.9 | 60.3 |
Comprehensive benchmark comparison across diverse tasks
First, create and activate a conda environment:
conda create -n lmflow python=3.9 -y
conda activate lmflow
conda install mpi4py
Install the package in development mode:
pip install -e .
Download the training data (e.g., Alpaca dataset):
cd data
bash download.sh alpaca
Run the fine-tuning script:
bash train_scripts/finetune_alpaca.sh
This will start the training process using the Alpaca dataset with the optimized block diffusion training recipe.
Launch the Gradio-based web interface:
python app.py
This will start a web server at http://localhost:10086 with:
For a simple command-line interface:
python run_chatbot.py
Commands:
clear - Clear conversation historyexit - Quit the chatbotExecute the evaluation script for comprehensive benchmarking:
bash eval_script.sh
This script evaluates the model on:
For custom evaluation with specific parameters:
accelerate launch eval.py \
--tasks gsm8k \
--batch_size 32 \
--num_fewshot 0 \
--model fast_dllm_v2 \
--model_args model_path=Efficient-Large-Model/Fast_dLLM_v2_7B,threshold=0.9
v2/
โโโ app.py # Gradio web interface
โโโ run_chatbot.py # Command-line chatbot
โโโ eval.py # Evaluation harness integration
โโโ eval_script.sh # Benchmark evaluation script
โโโ generation_functions.py # Core generation algorithms
โโโ index.html # Project webpage
โโโ asset/ # Visual assets
โ โโโ demo.mp4
โ โโโ benchmark_results.png
โ โโโ throughput.png
โ โโโ training_recipe.png
โ โโโ visualization_animation.gif
โโโ README.md # This file
The web interface provides real-time visualization of:
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
If you find this work useful, please cite our paper:
@misc{wu2025fastdllmv2efficientblockdiffusion,
title={Fast-dLLM v2: Efficient Block-Diffusion LLM},
author={Chengyue Wu and Hao Zhang and Shuchen Xue and Shizhe Diao and Yonggan Fu and Zhijian Liu and Pavlo Molchanov and Ping Luo and Song Han and Enze Xie},
year={2025},
eprint={2509.26328},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2509.26328},
}
We thank Qwen2.5 for the base model architecture
1 commits
Python
98.3%
Shell
1.7%