CoolFace
Modelpublic

Zigeng/dParallel_Dream_7B_Instruct

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes1.3kdownloads
Model Card

<div align="center"> <h1>๐Ÿš€ dParallel: Learnable Parallel Decoding for dLLMs</h1> <div align="center"> <a href="https://opensource.org/license/mit-0"> <img alt="MIT" src="https://img.shields.io/badge/License-MIT-4E94CE.svg"> </a> <a href="https://arxiv.org/pdf/2509.26488"> <img src="https://img.shields.io/badge/Paper-Arxiv-darkred.svg" alt="Paper"> </a> <a href="https://github.com/czg1225/dParallel"> <img src="https://img.shields.io/badge/GitHub-Code-blue.svg?logo=github&" alt="GitHub"> </a> </div> </div>

dParallel: Learnable Parallel Decoding for dLLMs Zigeng Chen, Gongfan Fang, Xinyin Ma, Ruonan Yu, Xinchao Wang xML Lab, National University of Singapore

๐Ÿ’ก Introduction

We introduce dParallel, a simple and effective method that unlocks the inherent parallelism of dLLMs for fast sampling. We identify that the key bottleneck to parallel decoding arises from the sequential certainty convergence for masked tokens. Building on this insight, we introduce the core of our approach: certainty-forcing distillation, a novel training strategy that distills the model to follow its original sampling trajectories while enforcing it to achieve high certainty on masked tokens more rapidly and in parallel. Extensive experiments across various benchmarks demonstrate that our method can dramatically reduce the number of decoding steps while maintaining performance. When applied to the LLaDA-8B-Instruct model, dParallel reduces decoding steps from 256 to 30 on GSM8K, achieving an 8.5x speedup without performance degradation. On the MBPP benchmark, it cuts decoding steps from 256 to 24, resulting in a 10.5x speedup while maintaining accuracy.

<!-- [image] --> <div align="center"> <img src="assets/method.png" width="100%" ></img> <br> <em> Overview of proposed certainty-forcing distillation. </em> </div> <br>

๐Ÿ’ป Model and Datasets

<table> <table> <thead> </thead> <tbody> <tr> <td>๐Ÿ“„ <strong>Paper</strong></td> <td><a href="https://arxiv.org/pdf/2509.26488">ArXiv-Link</a></td> </tr> <tr> <td>๐Ÿค– <strong>LLaDA Model</strong></td> <td><a href="https://huggingface.co/Zigeng/dParallel-LLaDA-8B-instruct">dParallel-LLaDA-8B-instruct</a></td> </tr> <tr> <td>๐Ÿค– <strong>Dream Model</strong></td> <td><a href="https://huggingface.co/Zigeng/dParallelDream7BInstruct">dParallel-Dream-7B-instruct</a></td> </tr> <tr> <td>๐Ÿ“Š <strong>LLaDA Data</strong></td> <td><a href="https://huggingface.co/datasets/Zigeng/dParallelLLaDADistillData"> dParallel-LLaDA-Distill Dataset</a></td> </tr> <tr> <td>๐Ÿ“Š <strong>Dream Data</strong></td> <td><a href="https://huggingface.co/datasets/Zigeng/dParallelDreamDistill_Data"> dParallel-Dream-Distill Dataset</a></td> </tr> </tbody> </table>

๐Ÿš€ Quick Start:

python
import torch
from transformers import AutoModel, AutoTokenizer
import types

model_path = "Zigeng/dParallel_Dream_7B_Instruct"
model = AutoModel.from_pretrained(model_path, torch_dtype=torch.bfloat16, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
model = model.to("cuda").eval()

from model.generation_utils_semiar import DreamGenerationMixin
model.diffusion_generate = types.MethodType(DreamGenerationMixin.diffusion_generate, model)
model._sample = types.MethodType(DreamGenerationMixin._sample, model)


messages = [
    {"role": "user", "content": "Toulouse has twice as many sheep as Charleston. Charleston has 4 times as many sheep as Seattle. How many sheep do Toulouse, Charleston, and Seattle have together if Seattle has 20 sheep? Let's think step by step."}
]

inputs =  tokenizer.apply_chat_template(
                messages,
                tokenize=False,
                add_generation_prompt=True
            )

inputs = tokenizer.apply_chat_template(
    messages, return_tensors="pt", return_dict=True, add_generation_prompt=True
)
input_ids = inputs.input_ids.to(device="cuda")
attention_mask = inputs.attention_mask.to(device="cuda")

output, nfe = model.diffusion_generate(
        input_ids,
        attention_mask=attention_mask,
        max_new_tokens=256,
        output_history=False,
        return_dict_in_generate=True,
        steps=256,
        temperature=0.,
        top_p=None,
        alg="entropy_threshold",
        alg_temp=0.1,
        top_k=None,
        block_length=32,
        threshold=0.5,
    )

generations = [
    tokenizer.decode(g[0:].tolist())
    for p, g in zip(input_ids, output.sequences)
]

print(generations[0].split(tokenizer.eos_token)[0])
print("NFE:", nfe)

๐Ÿ“– Experimental Results

Results on LLaDA-8B-Instruct:

[image]

Results on Dream-7B-Instruct:

[image]

Better Speed-Accuracy Trade-off:

[image]

โ˜€๏ธ Acknowledgement

Our code builds on LLaDA, Dream, Fast-dLLM, and dKV-Cache, and we acknowledge these great works for laying the groundwork that made our approach possible.

Citation

If our research assists your work, please give us a star โญ or cite us using:

@article{chen2025dparallel,
  title={dParallel: Learnable Parallel Decoding for dLLMs},
  author={Chen, Zigeng and Fang, Gongfan and Ma, Xinyin and Yu, Ruonan and Wang, Xinchao},
  journal={arXiv preprint arXiv:2509.26488},
  year={2025}
}