Text Generation
Transformers
Safetensors
English
a2d-qwen3
fill-mask
DLLM
diffusion-language-model
on-policy-distillation
post-training
conversational
Instructions to use divelab/OPDLM-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use divelab/OPDLM-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="divelab/OPDLM-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelWithLMHead model = AutoModelWithLMHead.from_pretrained("divelab/OPDLM-4B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use divelab/OPDLM-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "divelab/OPDLM-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "divelab/OPDLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/divelab/OPDLM-4B
- SGLang
How to use divelab/OPDLM-4B 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 "divelab/OPDLM-4B" \ --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": "divelab/OPDLM-4B", "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 "divelab/OPDLM-4B" \ --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": "divelab/OPDLM-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use divelab/OPDLM-4B with Docker Model Runner:
docker model run hf.co/divelab/OPDLM-4B
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,4 +12,45 @@ pipeline_tag: text-generation
|
|
| 12 |
base_model: Qwen/Qwen3-4B
|
| 13 |
datasets:
|
| 14 |
- divelab/opdlm_train_data
|
|
|
|
| 15 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
base_model: Qwen/Qwen3-4B
|
| 13 |
datasets:
|
| 14 |
- divelab/opdlm_train_data
|
| 15 |
+
arxiv: 2606.06712
|
| 16 |
---
|
| 17 |
+
# OPDLM-4B
|
| 18 |
+
|
| 19 |
+
OPDLM-4B is a block diffusion language model (DLM) obtained by post-training an
|
| 20 |
+
autoregressive language model (ARLM) into a diffusion language model via
|
| 21 |
+
**on-policy distillation**. arXiv report: [arxiv.org/abs/2606.06712](https://arxiv.org/abs/2606.06712)
|
| 22 |
+
|
| 23 |
+
## Highlights
|
| 24 |
+
- **Converted, not pretrained from scratch:** built from a strong ARLM, reusing its prior.
|
| 25 |
+
- **Training-efficient:** ~0.076B tokens of conversion vs. ~50B tokens for from-scratch DLM training (same base ARLM).
|
| 26 |
+
- **Inference-efficient:** parallel token decoding via block diffusion.
|
| 27 |
+
|
| 28 |
+
## Model Details
|
| 29 |
+
- **Developed by:** DIVE Lab, Texas A&M University
|
| 30 |
+
- **Base model:** [Qwen3-4B](https://huggingface.co/Qwen/Qwen3-4B)
|
| 31 |
+
- **Model type:** Block diffusion language model (decoder-based)
|
| 32 |
+
- **Block size:** 4
|
| 33 |
+
- **Parameters:** ~4B
|
| 34 |
+
- **Language:** English
|
| 35 |
+
- **License:** MIT
|
| 36 |
+
|
| 37 |
+
## Training
|
| 38 |
+
- **Method:** On-policy distillation from a frozen ARLM teacher into a block DLM student.
|
| 39 |
+
- **Conversion budget:** ~0.076B tokens
|
| 40 |
+
- **Data:** [opdlm_train_data](https://huggingface.co/datasets/divelab/opdlm_train_data)
|
| 41 |
+
|
| 42 |
+
## Results
|
| 43 |
+
For detailed results and benchmarks, please refer to our paper: [arxiv.org/abs/2606.06712](https://arxiv.org/abs/2606.06712)
|
| 44 |
+
|
| 45 |
+
## Citation
|
| 46 |
+
```bibtex
|
| 47 |
+
@misc{su2026dataefficientautoregressivetodiffusionlanguagemodels,
|
| 48 |
+
title={Data-Efficient Autoregressive-to-Diffusion Language Models via On-Policy Distillation},
|
| 49 |
+
author={Xingyu Su and Jacob Helwig and Shubham Parashar and Atharv Chagi and Lakshmi Jotsna and Degui Zhi and James Caverlee and Dileep Kalathil and Shuiwang Ji},
|
| 50 |
+
year={2026},
|
| 51 |
+
eprint={2606.06712},
|
| 52 |
+
archivePrefix={arXiv},
|
| 53 |
+
primaryClass={cs.CL},
|
| 54 |
+
url={https://arxiv.org/abs/2606.06712},
|
| 55 |
+
}
|
| 56 |
+
```
|