Speculative Decoding with EAGLE, MTP, and DFlash

Vladimir Lomtev•
Speculative Decoding with EAGLE, MTP, and DFlash

Speculative decoding speeds up generation like this: a fast “draft” proposes several next tokens, and the main model checks them in a single pass and accepts the ones that match. With standard verification, the result is statistically the same as without acceleration, and the gain depends on the share of accepted tokens. The method works best under low to moderate load, when generation is bottlenecked by memory reads rather than compute. In practice, the choice is this: MTP if the model supports it; EAGLE or EAGLE-3 with a ready-made drafter; n-gram if the responses often repeat the prompt text.

Prepared by Vladimir Lomtev’s AI Studio on November 16, 2026, for engineers who want to reduce response latency in a local LLM. We relied on the vLLM documentation on speculative decoding, the SGLang and llama-server argument references, and the November 2026 release notes. We did not run our own benchmarks; the calculation below is illustrative and shows the logic, not an expected result.

Contents

How it works

Regular response generation is a sequence of steps, where the model outputs one token at a time and for that reads all of its weights from memory. Under light load, the GPU spends most of its time waiting on memory, while the compute units sit idle. Speculative decoding uses that idle time.

  1. The draft proposes k next tokens. This can be a small model, a special head on top of the main model, or simply a match with already known text.
  2. The main model verifies all k tokens at once in a single pass.
  3. The longest prefix that matches the main model’s distribution is accepted, plus one token from the main model itself.
  4. If the draft is wrong on the first token, the step still produces one token — just like normal generation, but with overhead.

The idea is described in the papers by Leviathan and co-authors and Chen and co-authors. For more on why decode is memory-bound, see the guide to engines and inference acceleration.

Does quality stay the same

The vLLM documentation has a separate section on guarantees. Speculative sampling theoretically does not change the response distribution beyond floating-point computation error margins, and the implementation is tested for sampler convergence and result matching. These guarantees apply to the standard sampler with rejection.

There are exceptions too. In vLLM 0.33.0, the FLy policy appeared — an optional lossy verification mode that accepts more tokens at the cost of deviating from the original distribution. It is enabled intentionally and only after quality has been checked on your own tasks.

What kinds of drafts there are

Method Where the draft comes from When it fits
MTP Built-in multi-token prediction heads of the main model The model was originally trained with MTP
EAGLE / EAGLE-3 A lightweight head trained on the main model’s hidden states You have a ready-made drafter for your model
Draft model A separate small model from the same family You have a small model with the same tokenizer
N-gram Matches with the prompt text Responses repeat the input: editing, extraction, code
Suffix decoding Matches with the prompt and past responses Repeated template-like responses
DFlash / DSpark / DSpine Block-based drafters that propose tokens in parallel You have a compatible drafter checkpoint

The vLLM documentation includes a useful selection table: EAGLE, MTP, and the draft model deliver strong gains under low load, while n-gram and suffix work from low to moderate load but without an extra model. The documentation emphasizes that the real effect depends on the model family, traffic pattern, hardware, and sampling parameters. The EAGLE method is described in the paper by the EAGLE authors, its evolution is in EAGLE-3.

How much it gives: calculation logic

The main metric is average acceptance length: how many tokens one verification step accepts on average. An illustrative example: the draft proposes 3 tokens, and on average 1.5 of them are accepted plus 1 token from the main model, so 2.5 tokens per step. If the verification step is 10% more expensive than a normal step, the expected generation speedup is about 2.5 / 1.1 ≈ 2.3x.

The same logic shows when there will be no speedup:

  • the draft guesses poorly — acceptance length stays close to 1, while overhead remains;
  • high sampling temperature — responses are more diverse, so they are harder to predict;
  • the server is under heavy parallel load — the GPU is already compute-bound, and extra verification tokens compete with other requests. The vLLM documentation explicitly names medium to low load as the target scenario.

Setup in vLLM

All methods are enabled with one parameter --speculative-config with a JSON object. Draft model:

vllm serve Qwen/Qwen3-8B \
  --host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY" \
  --speculative-config '{"method": "draft_model", "model": "Qwen/Qwen3-0.6B", "num_speculative_tokens": 3}'

N-gram without an extra model:

vllm serve Qwen/Qwen3-8B --host 127.0.0.1 --port 8000 --api-key "$VLLM_API_KEY" \
  --speculative-config '{"method": "ngram", "num_speculative_tokens": 3, "prompt_lookup_min": 1, "prompt_lookup_max": 3}' \
  --per-request-spec-decode-metrics summary

For EAGLE-3, the documentation gives an example with Llama 3.1 8B and the drafter RedHatAI/Llama-3.1-8B-Instruct-speculator.eagle3, "method": "eagle3" and two speculative tokens. For models with MTP, specify "method": "mtp". For DSpine block-based drafters, the documentation recommends setting num_speculative_tokens one less than the checkpoint block size.

The flag --per-request-spec-decode-metrics with the value summary or detailed adds per-request acceptance metrics to the response in metrics.speculative_decoding. The documentation marks the format as experimental. Aggregate metrics are available in /metrics.

SGLang setup

In the SGLang argument reference the method is selected with --speculative-algorithm with values EAGLE, EAGLE3, NEXTN, STANDALONE and NGRAM. The draft model path is set with --speculative-draft-model-path, and the draft depth and width are set with --speculative-num-steps, --speculative-eagle-topk and --speculative-num-draft-tokens.

sglang serve meta-llama/Llama-3.1-8B-Instruct --host 127.0.0.1 --port 30000 \
  --speculative-algorithm EAGLE3 \
  --speculative-draft-model-path RedHatAI/Llama-3.1-8B-Instruct-speculator.eagle3 \
  --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4

The values 3, 1, and 4 are a starting point for experimentation. Check the draft model’s compatibility with SGLang in its model card.

llama-server setup

In llama.cpp 1.0.0, the speculative decoding API was moved into the library’s main header. In the llama-server README the type is set with --spec-type: among the values are draft-simple, draft-eagle3, draft-mtp, draft-dflash, ngram-simple , and others; the default is none. The draft model is specified with -md or --spec-draft-model, and the draft length is set with --spec-draft-n-max (default 3).

llama-server -m /srv/models/qwen3-8b-Q4_K_M.gguf \
  --host 127.0.0.1 --port 8080 \
  --spec-type draft-simple \
  -md /srv/models/qwen3-0.6b-Q8_0.gguf \
  --spec-draft-n-max 4

The draft model must use the same tokenizer as the main model. With the --metrics flag, the server exposes the counters llamacpp:spec_decode_num_draft_tokens_total and llamacpp:spec_decode_num_accepted_tokens_total, which are used to calculate the share of accepted tokens.

How to test on your own workload

  1. Baseline. Without speculative decoding, measure inter-token latency, response time, and throughput at 1, 4, and 16 concurrent requests.
  2. Real requests. Use your own prompts and temperature: on synthetic data, the acceptance length can be very different.
  3. One method at a time. Start with what is available without training: MTP, a ready-made EAGLE-3, or n-gram.
  4. Acceptance length. If the average acceptance length is close to 1, the method is not a good fit for this workload.
  5. High parallelism. Make sure that under peak load, throughput does not drop below the baseline.
  6. Quality. With the standard sampler, responses should stay close to the baseline within normal variance. For lossy modes, check quality on your own task set.

The load testing methodology is described in the article “Load Testing a Local LLM”.

Frequently Asked Questions

Do you need to train your own drafter? Not necessarily. First, test your model’s MTP, and the ready-made EAGLE-3 and n-gram drafters. For training your own drafters, vLLM has the speculators project.

How much memory does the draft use? The draft model and its KV cache use additional GPU memory. EAGLE and MTP heads are usually lighter than a separate model, but they still take up space. Take this into account when calculating requirements, as in the article “How Much VRAM Do LLMs Need?”.

Does the method work with structured output? It depends on the engine and version. Check compatibility in the documentation and by testing it with your own schemas.

Why did the speedup disappear as load increased? With a large number of parallel requests, the GPU becomes compute-bound, and checking extra tokens takes resources away from other requests. For these scenarios, vLLM offers dynamic speculative decoding and adaptive verification.

How Vladimir Lomtev’s AI Studio helps speed up LLM responses

Vladimir Lomtev’s AI Studio deploys LLMs on the company’s servers and tunes them for production use cases. For speculative decoding, this means:

  • measure latency and determine whether generation is bottlenecked by memory or compute;
  • choose the right method — MTP, EAGLE-3, a draft model, or n-gram — for your model and request patterns;
  • run side-by-side testing on real prompts with acceptance-length metrics;
  • set up monitoring so the speedup does not turn into a slowdown during peak hours.

The first step is to pick one scenario where response speed matters, record the current inter-token latency, and set the target you need to reach. Discuss your project.

Bottom line: speedup depends on the share of accepted tokens

Speculative decoding is one of the few ways to speed up generation without losing quality under standard verification. But the gain depends on how well the draft predicts your answers and on how busy the server is. Start with MTP, ready-made EAGLE-3, or n-gram, watch the average acceptance length, and check behavior under peak load.

Request an audit

Share your contact details and we will follow up.

← All articles

Comments (0)

Loading comments…

Leave a comment
No registration required

Book a strategy call
for agentic operations

Tell us which workflow you want to improve. We will map feasibility, risks, and the fastest MVP path.

By submitting, you agree to our privacy policy

Contacts

Global Operations

Serving U.S. clients remotely
with private cloud and on-prem options

Strategy calls by request

We respond after reviewing your workflow context.

info@agentsunrise.pro

For partnership inquiries

Have a proposal?

Write to us in messengers

© 2026 AgentSunrise