A speculative decoding draft head for
meta-llama/Llama-3.1-8B-Instruct, trained using the
EAGLE3 method on Google Cloud TPU with the
SpecJAX framework.
EAGLE3 draft heads accelerate autoregressive generation by proposing multiple tokens per step that a target model then verifies in parallel — typically achieving 2-3x throughput gains with no change in output quality.
Llama-3.1 EAGLE3 is natively supported in SGLang.
1python -m sglang.launch_server \
2 --model meta-llama/Llama-3.1-8B-Instruct \
3 --speculative-algorithm EAGLE3 \
4 --speculative-draft-model-path thoughtworks/Llama-3.1-8B-Instruct-Eagle3 \
5 --speculative-num-steps 5 \
6 --speculative-eagle-topk 4 \
7 --dtype bfloat16
Llama-3.1 EAGLE3 is natively supported in sglang-jax. Note: sglang-jax's EAGLE3 pipeline is functional but not yet performance-optimized.
1python -m sgl_jax.launch_server \
2 --model-path meta-llama/Llama-3.1-8B-Instruct \
3 --speculative-algorithm EAGLE3 \
4 --speculative-draft-model-path thoughtworks/Llama-3.1-8B-Instruct-Eagle3 \
5 --speculative-eagle-topk 1 \
6 --speculative-num-steps 3 \
7 --speculative-num-draft-tokens 4 \
8 --tp-size 4 --dtype bfloat16
1import sglang as sgl
2
3llm = sgl.LLM(
4 model="meta-llama/Llama-3.1-8B-Instruct",
5 speculative_algorithm="EAGLE3",
6 speculative_draft_model_path="thoughtworks/Llama-3.1-8B-Instruct-Eagle3",
7 speculative_num_steps=5,
8 speculative_eagle_topk=4,
9 dtype="bfloat16",
10)
This model uses
EAGLE3's Test-Time Training (TTT) objective with a rollout length of 7. At each training step, the draft head autoregressively proposes 7 tokens; the target model provides ground-truth hidden states and logits for all positions; a geometric loss (0.8^k weighting) trains the draft to match the target at each position.
Token acceptance rates on generic instruction-following data (ShareGPT-style prompts):
The draft head is a single-layer transformer that operates on the target model's hidden states:
This model is released under the
Meta Llama 3.1 Community License. Usage is subject to Meta's acceptable use policy.
1@article{li2025eagle3,
2 title={EAGLE3: Scalable Speculative Decoding with Training-Free Multi-Draft Speculation},
3 author={Li, Yuhui and Wei, Fangyun and Zhang, Chao and Zhang, Hongyang},
4 journal={arXiv preprint arXiv:2503.01840},
5 year={2025}
6}