Qwen3.5-4B-MMFlash / README.md
FSCCS's picture
Claude Opus 5.5
Add the citation
9998e9e verified
|
Raw History Blame Contribute Delete
9.75 kB
---
base_model:
- Qwen/Qwen3.5-4B
license: apache-2.0
pipeline_tag: image-text-to-text
tags:
- mmflash
- dflash
- speculative-decoding
- speculative-decoding-draft
- block-diffusion
- draft-model
- multimodal
- sglang
- qwen
- qwen3.5
inference: false
---
<div align="center">
<svg xmlns="http://www.w3.org/2000/svg" width="440" height="99" viewBox="0 0 532 120" role="img" aria-label="MMFlash"><defs><linearGradient id="mmflash-logo-mm" x1="142.0" y1="0" x2="298.3" y2="0" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6366F1"/><stop offset="1" stop-color="#8B5CF6"/></linearGradient></defs><g transform="translate(4 4) scale(0.875000)"><defs><linearGradient id="mmflash-logo-bg" x1="0" y1="0" x2="128" y2="128" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#4F46E5"/><stop offset="1" stop-color="#7C3AED"/></linearGradient><linearGradient id="mmflash-logo-bolt" x1="64" y1="25.0" x2="64" y2="103.0" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#FDE047"/><stop offset="0.5" stop-color="#FBBF24"/><stop offset="1" stop-color="#F97316"/></linearGradient></defs><path d="M40 0 H88 C120.8 0 128 7.2 128 40 V88 C128 120.8 120.8 128 88 128 H40 C7.2 128 0 120.8 0 88 V40 C0 7.2 7.2 0 40 0 Z" fill="url(#mmflash-logo-bg)"/><g fill="none" stroke="#FFFFFF" stroke-opacity="0.94" stroke-width="6.5" stroke-linecap="round" stroke-linejoin="round"><path d="M22 42 V30 Q22 22 30 22 H42"/><path d="M86 22 H98 Q106 22 106 30 V42"/><path d="M106 86 V98 Q106 106 98 106 H86"/><path d="M42 106 H30 Q22 106 22 98 V86"/></g><path d="M77.06 28.50 L41.31 74.00 L62.44 74.00 L54.31 106.50 L91.69 57.75 L70.56 57.75 Z" fill="#1E1B4B" fill-opacity="0.32" stroke="#1E1B4B" stroke-opacity="0.32" stroke-width="3" stroke-linejoin="round"/><path d="M74.56 25.00 L38.81 70.50 L59.94 70.50 L51.81 103.00 L89.19 54.25 L68.06 54.25 Z" fill="url(#mmflash-logo-bolt)" stroke="url(#mmflash-logo-bolt)" stroke-width="3" stroke-linejoin="round"/></g><path fill="url(#mmflash-logo-mm)" d="M142 90.62V27.84H164.19L177.09 60.95H178.81L191.62 27.84H214.24V90.62H198.42V37.04L200.91 37.21L184.74 77.97H170.21L153.95 37.21L156.62 37.04V90.62H142ZM226.11 90.62V27.84H248.3L261.2 60.95H262.92L275.73 27.84H298.35V90.62H282.52V37.04L285.02 37.21L268.85 77.97H254.32L238.06 37.21L240.73 37.04V90.62H226.11Z"/><path fill="currentColor" d="M310.22 90.62V27.84H326.21V90.62H310.22ZM324.49 66.28V53.21H347.8V66.28H324.49ZM324.49 40.91V27.84H348.74V40.91H324.49ZM358.03 90.62V27.84H373.68V90.62H358.03ZM352.7 39.19V27.84H373.68V39.19H352.7ZM413.07 90.62V76.68H410.49V61.81Q410.49 58.54 408.99 56.95Q407.48 55.36 404.04 55.36Q402.41 55.36 399.23 55.44Q396.04 55.53 392.52 55.7Q388.99 55.87 386.07 56.04V42.97Q388.13 42.8 390.97 42.63Q393.81 42.46 396.86 42.37Q399.91 42.28 402.49 42.28Q409.8 42.28 414.92 44.43Q420.04 46.58 422.75 50.88Q425.46 55.18 425.46 61.81V90.62H413.07ZM398.02 91.82Q393.03 91.82 389.16 90.01Q385.29 88.21 383.1 84.81Q380.91 81.41 380.91 76.68Q380.91 71.35 383.75 68.04Q386.58 64.73 391.57 63.18Q396.56 61.63 403.01 61.63H412.21V69.72H403.01Q399.83 69.72 398.11 71.31Q396.39 72.9 396.39 75.57Q396.39 78.15 398.11 79.74Q399.83 81.33 403.01 81.33Q405.07 81.33 406.66 80.6Q408.26 79.87 409.29 78.06Q410.32 76.25 410.49 73.07L414.1 76.51Q413.67 81.41 411.74 84.81Q409.8 88.21 406.41 90.01Q403.01 91.82 398.02 91.82ZM453.92 92.16Q443.6 92.16 437.67 87.91Q431.73 83.65 431.3 75.91H445.06Q445.41 78.06 447.73 79.61Q450.05 81.16 454.27 81.16Q457.28 81.16 459.47 80.25Q461.66 79.35 461.66 77.29Q461.66 75.48 459.94 74.32Q458.22 73.16 453.66 72.73L450.4 72.38Q441.28 71.44 436.98 67.4Q432.68 63.35 432.68 57.25Q432.68 52 435.26 48.61Q437.84 45.21 442.4 43.49Q446.96 41.77 452.8 41.77Q462.35 41.77 468.2 45.94Q474.05 50.11 474.39 57.94H460.63Q460.29 55.79 458.31 54.28Q456.33 52.78 452.63 52.78Q449.97 52.78 448.29 53.72Q446.61 54.67 446.61 56.39Q446.61 58.19 448.2 59.05Q449.79 59.91 453.32 60.34L456.59 60.69Q465.7 61.63 470.65 65.72Q475.59 69.8 475.59 76.43Q475.59 81.33 472.97 84.85Q470.35 88.38 465.49 90.27Q460.63 92.16 453.92 92.16ZM482.56 90.62V27.84H498.21V63.61H496.15Q496.15 56.39 497.95 51.49Q499.76 46.58 503.24 44.09Q506.73 41.6 511.89 41.6H512.57Q520.31 41.6 524.4 47.19Q528.48 52.78 528.48 63.61V90.62H512.83V63.01Q512.83 59.74 510.85 57.64Q508.88 55.53 505.61 55.53Q502.34 55.53 500.28 57.64Q498.21 59.74 498.21 63.18V90.62H482.56Z"/></svg>
<br>
</div>
# Qwen3.5-4B-MMFlash
MMFlash draft model for speculative decoding of [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) on image and text inputs. It is not a standalone language model; it is paired with the target model in a speculative-decoding server (SGLang `DFLASH`).
This repository contains the model introduced in [MMFlash: Faster Speculative Decoding for Vision-Language Models](https://huggingface.co/papers/2611.18482).
Project page: https://fscdc.github.io/MMFlash/ — Code: https://github.com/fscdc/MMFlash
MMFlash builds on [DFlash](https://github.com/z-lab/dflash) block-diffusion drafting: the draft reads hidden states from five layers of the target and proposes a block of 16 tokens in one forward pass, and the target verifies the block in one forward pass. MMFlash keeps the DFlash architecture and is trained on multimodal data with a loss weighted by per-token visual-grounding (visual-KL) scores.
<div align="center">
<video autoplay muted loop playsinline controls width="100%">
<source src="https://huggingface.co/FSCCS/Qwen3.5-4B-MMFlash/resolve/main/assets/demo.mp4" type="video/mp4">
</video>
</div>
<p align="center"><sub>Qwen3.5-9B on a MathVista question, recorded in real time on one NVIDIA H200 with SGLang (greedy decoding).</sub></p>
> [!TIP]
> Need a drafter for another model? Email us at [fscnkucs@gmail.com](mailto:fscnkucs@gmail.com) and we can help train one. We will keep updating these releases, and a Qwen4 checkpoint is planned.
## Model details
| | |
|---|---|
| Target model | [`Qwen/Qwen3.5-4B`](https://huggingface.co/Qwen/Qwen3.5-4B) |
| Parameters | 537M (bf16) |
| Block size | 16 |
| Target hidden states | layers 1, 8, 15, 22, 29 (of 32) |
## Usage
### SGLang
```bash
SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1 python -m sglang.launch_server \
--model-path Qwen/Qwen3.5-4B \
--speculative-algorithm DFLASH \
--speculative-draft-model-path FSCCS/Qwen3.5-4B-MMFlash \
--speculative-dflash-block-size 16 \
--attention-backend fa3 \
--mm-attention-backend sdpa \
--disable-radix-cache \
--reasoning-parser qwen3 \
--trust-remote-code
```
### vLLM
```bash
vllm serve Qwen/Qwen3.5-4B \
--dtype bfloat16 \
--max-model-len 32768 \
--attention-backend FLASH_ATTN \
--reasoning-parser qwen3 \
--speculative-config '{"method": "dflash", "model": "FSCCS/Qwen3.5-4B-MMFlash", "num_speculative_tokens": 15}'
```
Tested with vLLM 0.32.0, which serves DFlash drafts natively. `num_speculative_tokens` is the block size minus one.
## Results
Each cell is **τ / speedup**: τ is the average acceptance length (tokens accepted per verification step), and the speedup is the decoding throughput over Qwen3.5-4B without speculative decoding.
### Temperature 0
| Method | ChartQA | CharXiv | MMStar | MMBench | DynaMath | MathVista | MathVerse | Avg. |
|---|---|---|---|---|---|---|---|---|
| MTP (3) | 3.18 / 1.69× | 3.27 / 1.76× | 2.95 / 1.61× | 2.43 / 1.40× | 3.27 / 1.69× | 3.18 / 1.68× | 3.17 / 1.69× | 3.06 / 1.64× |
| MTP (7) | 4.26 / 1.68× | 4.64 / 1.87× | 3.75 / 1.57× | 2.58 / 1.24× | 4.42 / 1.69× | 4.29 / 1.67× | 4.27 / 1.69× | 4.03 / 1.63× |
| MTP (15) | 4.67 / 1.26× | 5.37 / 1.43× | 3.99 / 1.14× | 2.60 / 0.87× | 4.76 / 1.23× | 4.65 / 1.21× | 4.61 / 1.22× | 4.38 / 1.19× |
| EAGLE-3 (16) | 4.31 / 1.74× | 4.38 / 1.86× | 3.49 / 1.49× | 2.61 / 1.08× | 4.29 / 1.67× | 4.02 / 1.56× | 3.95 / 1.68× | 3.86 / 1.58× |
| DFlash-z (16) | 4.92 / 2.76× | 5.63 / 3.10× | 3.81 / 2.35× | 5.01 / 2.62× | 4.82 / 2.56× | 4.43 / 2.45× | 4.34 / 2.50× | 4.71 / 2.62× |
| DFlash (16) | 5.43 / 2.97× | 5.60 / 3.13× | 4.05 / 2.31× | 5.17 / 2.93× | 5.57 / 2.57× | 5.16 / 2.53× | 4.84 / 2.62× | 5.12 / 2.72× |
| **MMFlash (16)** | **5.97 / 3.28×** | **6.17 / 3.46×** | **4.49 / 2.55×** | **5.68 / 3.19×** | **6.26 / 2.87×** | **6.00 / 2.78×** | **5.35 / 2.88×** | **5.70 / 3.00×** |
Values in parentheses are the number of draft steps for MTP, the draft tree size for EAGLE-3, and the block size for DFlash and MMFlash. MTP is Qwen3.5-4B's built-in multi-token-prediction head. DFlash-z is the public [`z-lab/Qwen3.5-4B-DFlash`](https://huggingface.co/z-lab/Qwen3.5-4B-DFlash) draft. DFlash is our DFlash draft trained on the same data without the visual-KL weighting.
### Concurrency (temperature 0)
MMFlash at 1, 8 and 32 requests in flight, on a single NVIDIA H200. Each cell is the decode throughput in tokens/s, with the speedup over Qwen3.5-4B alone at the same concurrency in parentheses.
| Concurrency | ChartQA | CharXiv | MMStar | MMBench | DynaMath | MathVista | MathVerse | Avg. |
|---|---|---|---|---|---|---|---|---|
| 1 | 783 (3.28×) | 826 (3.46×) | 607 (2.55×) | 772 (3.19×) | 685 (2.87×) | 664 (2.78×) | 686 (2.88×) | 718 (3.00×) |
| 8 | 2,937 (2.23×) | 3,102 (2.37×) | 2,347 (1.73×) | 1,451 (2.16×) | 3,081 (2.12×) | 1,963 (1.60×) | 2,956 (2.02×) | 2,548 (2.03×) |
| 32 | 3,799 (1.59×) | 4,395 (1.61×) | 3,296 (1.19×) | 2,364 (1.35×) | 4,643 (1.35×) | 2,654 (1.16×) | 4,237 (1.30×) | 3,627 (1.37×) |
## Citation
```bibtex
@article{feng2026mmflash,
title = {MMFlash: Faster Speculative Decoding for Vision-Language Models},
author = {Feng, Sicheng and Chen, Zigeng and Wang, Song and Fang, Gongfan and Wang, Xinchao},
journal = {arXiv preprint arXiv:2611.18482},
year = {2026}
}
```