/ Модель

Характеристики

Контекст
40 960 токенов
Параметры
844 млн
Архитектура
qwen3 · dense
Базовая модель
Qwen3-4B-DFlash-b16
Библиотека
transformers
Опубликована
27 окт 2026

Qwen3-4B-MDraft-b16

Генерация текстаТекст → текст3 профессии
168скачиваний за 30 дней2лайкавеса обновлены27 окт 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Черновая модель DFlash, дообученная методом MDraft для ускорения генерации Qwen3-4B посредством спекулятивного декодирования.

FLAIR-Gatech выпустила Qwen3-4B-MDraft-b16 — черновую модель на архитектуре DFlash для ускорения генерации текста методом спекулятивного декодирования. Она дообучена на основе z-lab/Qwen3-4B-DFlash-b16 методом Multi-Draft On-Policy Distillation. Несмотря на обозначение 4B в названии, сама черновая модель содержит около 537 млн параметров; размер 4B относится к целевой модели Qwen3-4B.

Модель параллельно предлагает несколько следующих токенов, а целевая авторегрессионная модель проверяет их. Для работы нужны отдельная Qwen/Qwen3-4B и её токенизатор, а также совместимый конвейер DFlash. Чекпойнт предназначен для ускорения генерации, а не для самостоятельного использования как обычная языковая модель. В README приведены результаты оценки на математических, программных и чат-бенчмарках; средняя длина принятой последовательности выше, чем у DFlash, на 3,9–11,9% в зависимости от температуры. Обучение использовало данные Nemotron-Post-Training-Dataset-v2 с математическими, программными и чат-примерами. Лицензия в предоставленных данных не указана.

Сценарии применения

  • ускорение генерации ответов целевой моделью Qwen3-4B
  • ускорение генерации кода с проверкой целевой моделью
  • ускорение решения математических задач в DFlash-конвейере

Ограничения

Требует отдельную целевую модель Qwen/Qwen3-4B, её токенизатор и совместимый конвейер DFlash; сама по себе не является полноценной целевой языковой моделью. Лицензия и перечень поддерживаемых естественных языков в предоставленных сведениях не определены.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Qwen3-4B-MDraft-b16

MDraft is a diffusion drafter for speculative decoding with Qwen/Qwen3-4B. It is fine-tuned from z-lab/Qwen3-4B-DFlash-b16 using Multi-Draft On-Policy Distillation (MDraft). The architecture and inference procedure are unchanged from DFlash: replace the DFlash draft checkpoint with this checkpoint in a compatible inference setup.

This repository contains the drafter, which requires the separate Qwen3-4B target model and its tokenizer. The 4B in the name identifies the target model size; the drafter itself has 537,427,200 parameters.

Paper: Multi-Draft On-Policy Distillation for Diffusion Drafters
Authors: Petr Molodyk, Yuchen Zhu, Jaemoo Choi, Molei Tao, and Yongxin Chen, Georgia Institute of Technology

Model details

PropertyValue
RepositoryFLAIR-Gatech/Qwen3-4B-MDraft-b16
Required target and tokenizerQwen/Qwen3-4B
Initializationz-lab/Qwen3-4B-DFlash-b16
ArchitectureDFlash parallel block diffusion drafter; five layers
Block layout16 slots: one committed anchor and 15 drafted positions
Weight precisionFP32; example inference uses BF16

Method

A parallel drafter predicts several positions without conditioning on earlier tokens sampled within the same block. The autoregressive verifier does condition on those tokens, so different sampled prefixes can provide conflicting training targets for the same drafter prediction.

MDraft samples multiple draft blocks from one context, averages the verifier's full-vocabulary conditional distributions across their prefixes, and blends that average with each prefix-specific distribution in log-probability space. It trains the drafter against the resulting targets using reverse KL. Multiple drafts are used during training; MDraft adds no multi-draft requirement at inference.

Usage

MDraft checkpoints are compatible with DFlash pipelines. The Transformers inference example follows the upstream DFlash model card, with only the draft checkpoint ID changed. Both models run on one CUDA GPU.

Installation

pip install transformers==4.57.3 torch==2.9.1 accelerate

The upstream utils.py also imports datasets; if it is not already installed, run pip install datasets==5.0.1.

Inference

from transformers import AutoModel, AutoModelForCausalLM, AutoTokenizer

# 1. Load the DFlash Draft Model
# Note: trust_remote_code=True is required for DFlash. We recommend run on one GPU currently.
model = AutoModel.from_pretrained(
    "FLAIR-Gatech/Qwen3-4B-MDraft-b16", 
    trust_remote_code=True, 
    dtype="auto", 
    device_map="cuda:0"
).eval()

# 2. Load the Target Model
target = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen3-4B", 
    dtype="auto", 
    device_map="cuda:0"
).eval()

# 3. Load Tokenizer and Prepare Input
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B")
prompt = "How many positive whole-number divisors does 196 have?"
messages = [
    {"role": "user", "content": prompt}
]
# Note: this draft model is used for thinking mode disabled
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
    enable_thinking=False
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

# 4. Run Speculative Decoding
# The 'spec_generate' function is a custom method provided by the DFlash model
generate_ids = model.spec_generate(
    input_ids=model_inputs["input_ids"], 
    max_new_tokens=2048, 
    temperature=0.0, 
    target=target, 
    stop_token_ids=[tokenizer.eos_token_id]
)

print(tokenizer.decode(generate_ids[0], skip_special_tokens=True))

To load a local checkpoint, replace FLAIR-Gatech/Qwen3-4B-MDraft-b16 in the first from_pretrained call with the absolute path of its model directory.

trust_remote_code=True loads the DFlash architecture included with the checkpoint. The drafter requires the corresponding Qwen target model.

For an existing DFlash deployment in vLLM or SGLang, use this repository as the draft model and keep Qwen/Qwen3-4B as the target model. Use a backend version with DFlash support.

Training

The paper's Qwen3-4B configuration uses eight proposals per context (K=8), blending coefficient alpha=0.9, and survival-based position weights.

Post-training data

The post-training corpus combines math, code, and chat prompts from Nemotron-Post-Training-Dataset-v2, with completions generated by Qwen3-4B. Samples are prompt-completion pairs, not unique questions; multiple samples can share the same prompt.

Data typePrepared training samplesTraining share
Math410,44861.52%
Code128,37219.24%
Chat128,37219.24%
Total667,192100%

These counts describe the prepared mix before block-length filtering, which leaves 665,156 usable pairs.

Evaluation

The tables report results from the MDraft paper. Values are mean acceptance lengths, including one correction/bonus token per verifier pass. Mean is the unweighted average across the six benchmarks; higher is better. Bold marks the highest value within each temperature and column.

Temperature 0

MethodGSM8KMATH500AIME25MBPPHumanEvalMT-BenchMean
DFlash6.4698.0237.3796.0236.5814.1196.432
AdaFlash6.7938.3397.7096.1416.7134.3296.671
Draft-OPD6.6047.8447.1135.8826.4384.1986.347
RKL6.6887.8997.1085.9406.5134.2476.399
MDraft6.9078.3227.6406.1876.7404.3176.685

Temperature 0.6

MethodGSM8KMATH500AIME25MBPPHumanEvalMT-BenchMean
DFlash6.1687.3656.0445.5996.2143.9645.892
AdaFlash6.4877.7476.4135.7926.4694.1016.168
Draft-OPD6.3977.4466.4485.6166.2734.0656.041
RKL6.5187.5646.3855.7116.3844.1096.112
MDraft6.7397.9056.4806.0016.5934.2056.321

Temperature 1

MethodGSM8KMATH500AIME25MBPPHumanEvalMT-BenchMean
DFlash5.6556.4894.9535.1455.6843.7205.274
AdaFlash5.9886.9145.2645.2855.9803.8435.546
Draft-OPD6.0676.8545.2145.3435.9163.9195.552
RKL6.3007.0415.3745.5416.0394.0625.726
MDraft6.4247.2585.6495.6726.3304.0875.903

Compared with DFlash, MDraft increases the overall mean acceptance length by 3.9%, 7.3%, and 11.9% at temperatures 0, 0.6, and 1, respectively.

Citation

@misc{molodyk2026mdraft,
  title = {Multi-Draft On-Policy Distillation for Diffusion Drafters},
  author = {Molodyk, Petr and Zhu, Yuchen and Choi, Jaemoo and Tao, Molei and Chen, Yongxin},
  year = {2026}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
DFlashDraftModel
Ревизия весов
237a284

0 моделей