Views
No views yet
1import torch
2from transformers import AutoModelForCausalLM, AutoProcessor
3
4MODEL = "Efficient-Large-Model/Fast_dDrive_3B" # or your local clone
5
6processor = AutoProcessor.from_pretrained(MODEL, trust_remote_code=True)
7model = AutoModelForCausalLM.from_pretrained(
8 MODEL,
9 trust_remote_code=True,
10 dtype=torch.bfloat16,
11).cuda().eval()
12
13# Scaffold Spec (paper canonical, threshold = 0.0)
14output_ids = model.scaffold_speculative_sample(
15 input_ids=input_ids,
16 attention_mask=attention_mask,
17 pixel_values=pixel_values,
18 image_grid_thw=image_grid_thw,
19 confidence_threshold=0.0,
20 block_size=32,
21 max_new_tokens=512,
22)| Method | Description | Threshold |
|---|---|---|
mdm_sample_deep_scaffold | Section Diffusion (SD) — iterative MDM denoising over a pre-filled JSON scaffold | 0.9 |
scaffold_speculative_sample | Scaffold Spec (SS) — scaffold-aware self-speculative decoding (MDM draft + AR verify per block). Paper canonical. | 0.0 |
scaffold_spec_with_ss_multi_traj | SS multi-rollout — shared-prefix N-rollout inference scaling on the trajectory section | 0.0 |
Important:scaffold_speculative_sampleand its multi-traj variant must be run withconfidence_threshold=0.0to reproduce the paper numbers. Running at0.9silently degrades both ADE and throughput.
| Mode | RFS ↑ | ADE@3s ↓ | ADE@5s ↓ | TPS ↑ | Tok/Step ↑ |
|---|---|---|---|---|---|
| Scaffold Spec | 7.823 | 1.254 | 2.907 | 210.4 | 4.90 |
| + Inference scaling (N=4) | 7.827 | 1.240 | 2.821 | 114.7 | 2.76 |
modeling.py — model definition (Fast_dDriveForConditionalGeneration)configuration.py — config classessection_utils.py — scaffold construction + section-aligned block index utilitiesgeneration_utils.py — the three inference paths, attached to the model class on importconfig.json, generation_config.json, preprocessor_config.json, chat_template.jinja, tokenizer files — standard HF artifactsmodel-0000{1..4}-of-00004.safetensors — model weights (4 shards)1@misc{zhang2026fastddriveefficientblockdiffusionvlm,
2 title={Fast-dDrive: Efficient Block-Diffusion VLM for Autonomous Driving},
3 author={Kewei Zhang and Jin Wang and Sensen Gao and Chengyue Wu and Yulong Cao and Songyang Han and Boris Ivanovic and Langechuan Liu and Marco Pavone and Song Han and Daquan Zhou and Enze Xie},
4 year={2026},
5 eprint={2605.23163},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2605.23163},
9}