Instructions to use yifanyu/LLaDA2.1-mini-ORL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yifanyu/LLaDA2.1-mini-ORL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yifanyu/LLaDA2.1-mini-ORL", 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("yifanyu/LLaDA2.1-mini-ORL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yifanyu/LLaDA2.1-mini-ORL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yifanyu/LLaDA2.1-mini-ORL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yifanyu/LLaDA2.1-mini-ORL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yifanyu/LLaDA2.1-mini-ORL
- SGLang
How to use yifanyu/LLaDA2.1-mini-ORL 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 "yifanyu/LLaDA2.1-mini-ORL" \ --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": "yifanyu/LLaDA2.1-mini-ORL", "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 "yifanyu/LLaDA2.1-mini-ORL" \ --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": "yifanyu/LLaDA2.1-mini-ORL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yifanyu/LLaDA2.1-mini-ORL with Docker Model Runner:
docker model run hf.co/yifanyu/LLaDA2.1-mini-ORL
LLaDA2.1-mini-ORL
LLaDA-2.1-mini + ORL: LLaDA-2.1-mini post-trained with On-Policy Residual Learning (ORL), with a residual adapter
Highlights
- Up to 1.5× tokens per forward (TPF) and up to 3× throughput at comparable quality
- 2,124 tokens/s for a single request on HumanEval with dlmrt on one H100; with NVFP4, 5,046 on one B200 and 2,788 on a consumer RTX 5090
- Data-efficient: 4.2M self-generated tokens and 36 H100-hours of post-training, about 10× less additional data than earlier LLaDA parallel-decoding recipes
Results
Accuracy (%) / TPF; each model uses its selected decoder.
| Model | GSM8K | MATH-500 | HumanEval | MBPP |
|---|---|---|---|---|
| LLaDA-2.1-mini | 91.9 / 5.6 | 84.6 / 8.2 | 86.6 / 11.3 | 77.5 / 7.7 |
| LLaDA2.1-mini-ORL | 92.0 / 8.5 | 87.0 / 10.2 | 89.0 / 13.1 | 77.3 / 10.3 |
Speed

Tokens per second for a single request, measured with dlmrt unless noted, with the paper's prompts and decoders (the paper reports the base model on GSM8K and HumanEval):
| Model | GPU, precision | GSM8K | MATH-500 | HumanEval | MBPP |
|---|---|---|---|---|---|
| LLaDA-2.1-mini (SGLang) | H100, BF16 | 716 | — | 1,302 | — |
| LLaDA-2.1-mini | H100, BF16 | 918 | — | 1,698 | — |
| LLaDA2.1-mini-ORL | H100, BF16 | 1,281 | 1,627 | 2,124 | 1,539 |
| LLaDA2.1-mini-ORL-NVFP4 | RTX 5090, NVFP4 | 1,648 | 2,081 | 2,788 | 2,053 |
| LLaDA2.1-mini-ORL-NVFP4 | B200, NVFP4 | 2,953 | 3,882 | 5,046 | 3,564 |
Usage
Plain
transformersgeneration does not run the paper's decoding. Two engines do: dlmrt, our inference engine, and the ORL repository's SGLang engine and decoder configuration, which the paper's evaluation uses.
dlmrt
dlmrt, our inference engine, decodes one request at a time with the paper's decoder (role="orl")
and measures the paper's throughput; see its README for installation, tensor parallelism and the commands of every
paper cell.
from dlmrt import LLM
llm = LLM("yifanyu/LLaDA2.1-mini-ORL", role="orl")
out = llm.generate("Write a Python function that reverses a linked list.", max_new_tokens=4096)
print(out.text)
print(f"{out.request_tps:.0f} tokens/s")
python -m dlmrt serve --model yifanyu/LLaDA2.1-mini-ORL --role orl --port 18080
curl -N localhost:18080/generate -d '{"messages": [{"role": "user", "content": "Hi!"}], "max_new_tokens": 512}'
The paper's evaluation pipeline
Reproduce the paper's numbers (GSM8K, MATH-500, HumanEval, MBPP) with the repository's evaluation pipeline:
git clone https://github.com/Introspective-Diffusion/ORL orl && cd orl/evaluation
export ORL_EVAL_WORK=/path/to/eval-work
bash scripts/build_images.sh && bash scripts/prepare.sh
hf download yifanyu/LLaDA2.1-mini-ORL --local-dir $ORL_EVAL_WORK/hf/LLaDA2.1-mini-ORL
bash scripts/main_table.sh llada-orl $ORL_EVAL_WORK/hf/LLaDA2.1-mini-ORL
The evaluation generates with SGLang's offline engine (here with the GSM8K decoder, rendered by
python3 -m repro.paper.render_config --suite main --model llada-orl --benchmark gsm8k --seed 12345 --out decoder.yaml),
inside $ORL_EVAL_WORK/images/sglang-gen.sif with PYTHONPATH=$ORL_EVAL_WORK/runtime/llada/engine/inference/sglang:
import sglang as sgl
engine = sgl.Engine(model_path="LLaDA2.1-mini-ORL", trust_remote_code=True, tp_size=1, mem_fraction_static=0.60,
disable_cuda_graph=False, sdar_rollout_cuda_graph=True, sdar_rollout_cuda_graph_capture_sizes=[1, 2],
attention_backend="flashinfer", disable_radix_cache=True,
dllm_algorithm="SDARPrefixKV", dllm_algorithm_config="decoder.yaml")
Training
ORL trains on fresh, verified trajectories of the current model, replays the exact residual inputs each denoising
step consumed, and adds adjacent entropy contraction (AEC) so that refinement gets faster, not only more accurate.
This checkpoint is step 625 of the paper run, trained on a mixture of 819 GSM8K, 819 MATH and 819 Python problems read
in order, on one node of 8 × H100. training/scripts/reproduce_llada2.sh in the code repository reruns the recipe in
one launch; MoE kernels accumulate in a nondeterministic order, so reruns differ slightly.
Checkpoint identity
Paper role llada-orl, training step 625. Weights, tokenizer, configuration and custom model code are byte-identical
to the inventory used in the paper reproduction; checkpoint_manifest.json records their hashes, and
paper_decoding.json the engine and benchmark-specific decoding settings, which downloading the model does not apply.
Related Models
| Model | Hugging Face | Description |
|---|---|---|
| LLaDA-2.1-mini | inclusionAI/LLaDA2.1-mini | Start model of this checkpoint |
| QwenDLM-4B | yifanyu/QwenDLM-4B | Qwen3-4B-Thinking-2507 converted to block diffusion; start model of QwenDLM-4B-ORL |
| QwenDLM-4B-ORL | yifanyu/QwenDLM-4B-ORL | ORL on QwenDLM-4B |
| LLaDA2.1-mini-ORL | yifanyu/LLaDA2.1-mini-ORL | This model |
| LLaDA2.1-mini-ORL-NVFP4 | yifanyu/LLaDA2.1-mini-ORL-NVFP4 | NVFP4 quantization of LLaDA2.1-mini-ORL |
| DiffusionGemma-26B-A4B-it-ORL | yifanyu/DiffusionGemma-26B-A4B-it-ORL | ORL on DiffusionGemma-26B-A4B |
| DiffusionGemma-26B-A4B-it-ORL-NVFP4 | yifanyu/DiffusionGemma-26B-A4B-it-ORL-NVFP4 | NVFP4 quantization of DiffusionGemma-26B-A4B-it-ORL |
| ORL-training-data | yifanyu/ORL-training-data | Dataset of the three ORL training runs |
Citation
@misc{yu2026orl,
title = {On-Policy Residual Learning for Diffusion Language Models},
author = {Yu, Yifan and Jian, Yuqing and Li, Jisen and Hu, Yuezhou and Zhang, Tianyi and Wu, Xiaoxia and
Zhu, Rui-Jie and Wang, Junxiong and Zhou, Zhongzhu and Lai, Fan and Zou, James and Xu, Chenfeng},
year = {2026},
eprint = {2610.20687},
archivePrefix = {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2610.20687}
}
- Downloads last month
- 485