Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

Optimize vLLM speculative decoding with FastMTP heads

Speculators 0.6.0: FastMTP-style fine-tuning of native MTP heads

September 8, 2026
Rahul Tuli
Related topics:
AI inferenceArtificial intelligenceDeveloper tools
Related products:
Red Hat AI InferenceRed Hat OpenShift AIRed Hat AI

    Autoregressive decoding makes large language model (LLM) inference memory-bandwidth bound: every token needs 1 full forward pass over billions of parameters, so the hardware spends most of its time moving weights rather than computing. MTP is a training objective: models like the DeepSeek and Qwen families learn to predict several future tokens at each position, which improves their data efficiency and quality. That objective leaves behind extra prediction heads, and at inference, engines can repurpose those heads as a speculator, proposing several future tokens per step for a verifier to accept or reject.

    Reusing native MTP heads avoids adding new parameters, but inference engines execute them differently than they were trained, causing acceptance to drop. Speculators 0.6.0 implements FastMTP-style fine-tuning, a training recipe that adapts a single shipped MTP head for the recursive, multi-step drafting that engines like vLLM perform in production. In their 2025 paper on FastMTP, Cai et al. demonstrated how recursive training adapts a single MTP head for multi-step drafting.

    Key features

    • FastMTP-style MTP fine-tuning: A teacher-forced, multi-step training loop with exponential-decay position weighting adapts 1 MTP head for recursive reuse across several speculative tokens.
    • Native MTP weight extraction: The MTPConverter lifts native mtp.* weights directly out of a verifier checkpoint to initialize fine-tuning, with no training from scratch.
    • Full-vocabulary draft head: The speculator shares the verifier's embed_tokens and lm_head, so there's no vocabulary reduction and no separate output projection to reconcile.
    • vLLM-ready checkpoints: The stitcher emits weights in the exact mtp.* key format vLLM expects, so a fine-tuned head deploys with a standard vllm serve.

    What is multi-token prediction?

    Engineers train and run a standard language model autoregressively: given tokens t₀…tᵢ, it predicts tᵢ₊₁, appends it, and repeats, 1 full forward pass per token. Speculative decoding hides that idle time. A small speculator (or draft head) proposes several tokens cheaply, and the large verifier (or target model) accepts or rejects them in a single forward pass. Any accepted tokens are effectively free, because verification costs 1 pass regardless of how many candidates it checks.

    Multi-token prediction is a training objective, not a serving mode: the model learns to predict several future tokens at each position instead of only the immediate next one, which sharpens its representations and improves data efficiency. It adds D sequential MTP modules, 1 per additional future token, and chains them causally: each module conditions on the previous module's output rather than predicting positions in parallel like independent output heads.

    The module at depth k takes the hidden state from depth k-1 together with the embedding of the ground-truth token tᵢ₊ₖ and predicts tᵢ₊ₖ₊₁. Each module has its own transformer block and input projection but shares the embedding layer and output head with the main model. Two consequences matter:

    • Every MTP module trains on ground-truth context (teacher forcing).
    • Inference engines can repurpose the modules at inference as a ready-made draft head for speculative decoding.

    Most open-weight models don't ship these modules at all; among those that do are DeepSeek-V3 and the Qwen3-Next family.

    Learn more:

    • Multi-token prediction, Gloeckle et al., 2024 (arXiv:2404.19737)
    • DeepSeek-V3 technical report: the sequential, causal-chain MTP variant (arXiv:2412.19437)
    • FastMTP: The recipe this feature is based on
    • vLLM speculative decoding documentation

    Why fine-tune a single MTP head

    In training, DeepSeek-V3 uses D distinct modules, each responsible for 1 specific future position.

    In production, providers rarely ship the full stack. Most ship a single MTP module, and even when several are shipped, inference engines typically keep only the first to avoid memory overhead. To speculate multiple tokens, the engine applies that single module autoregressively: it drafts 1 token, then feeds that token and the module's own output hidden state back in to run it again.

    This is the train/serve mismatch. Creators trained the shipped module to predict the immediate next token from ground-truth input, never to consume its own outputs. Applied recursively, small errors compound, and acceptance drops off for the second and third speculative tokens. FastMTP-style fine-tuning removes this mismatch by training that single module exactly how the server uses it: recursively.

    How FastMTP-style fine-tuning works in Speculators

    The Speculators MTP speculator (MTPDraftModel) is a single transformer layer with an input projection fusing the verifier's last hidden state with the target token's embedding. Training runs a teacher-forced recursive loop that mirrors serving. At step k:

    1. The system fuses the token embedding for input_ids[t+k+1] with the current hidden state.
    2. The MTP layer produces an output hidden state, and lm_head produces logits.
    3. The loss target is input_ids[t+k+2].
    4. The trainer feeds the output hidden state back as the input for step k+1.

    Following FastMTP, Speculators weights per-step losses with normalized exponential decay:

    def compute_step_weights(beta: float = 0.6, num_steps: int = 3) -> list[float]:
        """alpha_k = beta^(k-1) / sum(beta^(j-1) for j=1..K)"""
        raw = [beta**k for k in range(num_steps)]
        total = sum(raw)
        return [w / total for w in raw]
    # beta=0.6, num_steps=3 -> [0.51, 0.31, 0.18]

    The default β = 0.6 over 3 steps helps step 0 carry roughly half the loss, as verifiers accept early speculative tokens more often. A note on the full-vocabulary head. The MTP speculator shares the verifier's complete lm_head, keeping the draft numerically identical to the target's output distribution. Future updates will include Frequency-Ranked Speculation (FR-Spec)-style vocabulary reduction to shrink recursive step costs.

    When to use MTP fine-tuning

    1. Does the verifier already ship an MTP head?

    MTP fine-tuning starts from native mtp.* weights. Speculators 0.6.0 supports Qwen3-Next and Qwen3.5 (including Mixture of Experts, or MoE). If your target doesn't have an MTP head, use EAGLE-3, DFlash, or P-EAGLE instead.

    2. How much memory and compute can you spend?

    MTP is the lightest speculator to train because it reads only the last layer's hidden states. This results in smaller offline datasets and faster online training via vLLM's hidden extraction system.

    3. Are you serving a specialized workload?

    Creators train a shipped MTP head on general data. fine-tuning on domain-specific data (math, code, and so on) sharpens the head's predictions where they matter most.

    Fine-tune, stitch, and serve an MTP head

    The following example fine-tunes Qwen/Qwen3.5-9B on Grade School Math 8K (GSM8K) in about 443 seconds on 2× NVIDIA H200.

    1. Prepare data

    MTP requires training data that the target model itself generates.

    python scripts/prepare_data.py \
      --model Qwen/Qwen3.5-9B \
      --data ./output/dataset/gsm8k.jsonl \
      --max-samples 5000 --seq-length 8192 --output ./output

    2. Serve the verifier

    Online training generates hidden states on the fly from a live vLLM server.

    python scripts/launch_vllm.py Qwen/Qwen3.5-9B --target-layer-ids 32 -- --port 8000

    3. Fine-tune

    The trainer extracts the native MTP head and optimizes it recursively.

    python scripts/train.py \
      --verifier-name-or-path Qwen/Qwen3.5-9B \
      --data-path ./output \
      --vllm-endpoint http://localhost:8000/v1 \
      --save-path ./output/checkpoints \
      --speculator-type mtp \
      --num-speculative-steps 3 \
      --target-layer-ids 32 \
      --step-weight-beta 0.6 \
      --epochs 3 --lr 1e-4 --total-seq-len 8192 \
      --on-missing generate --on-generate delete

    4. Stitch and serve

    The stitcher writes the fine-tuned head back into the verifier checkpoint.

    vllm serve ./output/stitched \
      --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
      --no-enable-chunked-prefill

    Performance and verification metrics

    We measure performance using mean accepted length via GuideLLM. Higher values indicate more tokens emitted per forward pass.

    PositionBaseFine-tuned
    pos 00.8970.912
    pos 10.7190.776
    pos 20.4760.616

    Recursive fine-tuning on the native MTP head of Qwen/Qwen3-Next-80B-A3B-Instruct yields an improvement in acceptance over the shipped head on domain-specific data, as shown in Figure 1. When trained on around 8,000 samples from openai/gsm8k, we measure acceptance rates on the test split of the dataset. Longer training might yield a better speculator.

    Fine-tuning consistently reduces median inter-token latency across requests per second compared to the base model, achieving up to 1.25x speedup.
    Figure 1: Median inter-token latency (ITL) (ms) vs. requests per second (RPS) for Qwen/Qwen3-Next-80B-A3B-Instruct trained and evaluated on GSM8K using GuideLLM==0.16.0 and vLLM==0.24.0.

    What's next?

    • Frequency-ranked draft-vocabulary reduction (FR-Spec-style)
    • Support for verifier families beyond Qwen3-Next and Qwen3.5
    • Benchmarking FastMTP fine-tuning across DeepSeek-V3 and Llama 3 model families

    Get started with Speculators 0.6.0

    Install from the Python Package Index (PyPI) or source:

    uv pip install speculators==0.6.0
    # or from source
    git clone https://github.com/vllm-project/speculators.git
    cd speculators && uv pip install -e .

    Then run the ready-to-use example script:

    bash examples/train/mtp_qwen3_5_9b_gsm8k_online.sh

    Explore the full Speculators documentation to run FastMTP fine-tuning on your custom datasets and share your acceptance rate benchmarks with the vLLM community.

    Accelerate low-latency inference by bringing speculative draft model training to your enterprise workloads. Learn how Red Hat OpenShift AI and the Red Hat AI Inference simplify end-to-end MTP fine-tuning and deployment at scale.

    Learn more:

    • Speculators v0.5.0: DFlash support and online training
    • Fly Eagle(3) fly: Faster inference with vLLM & speculative decoding
    • Speculators: Standardized, production-ready speculative decoding
    • Diving into speculative decoding training with Speculators v0.3.0
    • Speeding up LLM inference with P-EAGLE in vLLM Speculators
    • Cai, Yuxuan, et al. FastMTP: Accelerating LLM Inference with Enhanced Multi-Token Prediction. arXiv preprint arXiv:2509.18362, 2025.
    • Zixuan Zhou, Xuefei Ning, Ke Hong, Tianyu Fu, and Jiaming Xu. A Survey on Efficient Inference for Large Language Models. arXiv preprint arXiv:2404.14294, 2024.

    Related Posts

    • Speeding up LLM inference with P-EAGLE in vLLM Speculators

    • Smarter data generation for faster Speculator training

    • How speculative decoding delivers faster LLM inference

    • Speculators v0.5.0: DFlash support and online training

    • Performance improvements with speculative decoding in vLLM for gpt-oss

    • Fly Eagle(3) fly: Faster inference with vLLM & speculative decoding

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI