Team Ai
Modelpublic

togethercomputer/Aurora-Spec-Qwen3-Coder-Next-FP8

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
22likes347downloads
Model Card

Aurora-Spec-Qwen3-Coder-Next-FP8

<div align="center">

![Website](https://aurora-spec-ai.github.io) ![Code](#) ![Dataset](https://huggingface.co/datasets/zelc/onlinesd) ![Paper](https://arxiv.org/abs/2602.06932)

</div>

Model Description

This is an EAGLE3 draft model trained from scratch (random initialization) using the Aurora inference-time training framework for speculative decoding. Unlike traditional approaches that fine-tune pre-trained models, this model is built entirely through Aurora's online training process. The model is optimized to generate high-quality draft tokens for the Qwen/Qwen3-Coder-Next-FP8 target model, achieving significant speedups in code generation tasks.

Key Features

  • โ€”Training Approach: Trained from scratch (random initialization) - no pre-training required
  • โ€”Framework: Trained with Aurora - an advanced inference-time training system
  • โ€”Architecture: EAGLE3 speculative decoding draft model
  • โ€”Target Model: Qwen/Qwen3-Coder-Next-FP8
  • โ€”Training Data: OnlineSD Code Dataset
  • โ€”Performance: Achieves 3.1x average accept length for speculative decoding
  • โ€”Training: 10,000 training steps over 80,000 inference requests

Target Model

This draft model is specifically designed to work with:

  • โ€”Model: Qwen/Qwen3-Coder-Next-FP8
  • โ€”Type: Code generation language model
  • โ€”Precision: FP8 quantized
  • โ€”Domain: Programming and code synthesis

The draft model learns to predict the target model's token distribution during inference-time training, enabling efficient speculative decoding.

Architecture

EAGLE3 Speculative Decoding

This model implements the EAGLE3 (Extrapolation Algorithm for Greater Language-model Efficiency) architecture:

  • โ€”Draft Model: Lightweight model that generates candidate tokens
  • โ€”Tree-based Attention: Enables parallel verification of multiple draft tokens
  • โ€”Auto-regressive Generation: Produces speculative token sequences
  • โ€”Dynamic Adaptation: Updates during inference to match target model distribution

Model Structure

  • โ€”Initialization: Trained from scratch (random initialization, no pre-training)
  • โ€”Base Architecture: Single-layer Transformer decoder
  • โ€”Precision: FP8 (8-bit floating point)
  • โ€”Speculative Steps: 5 tokens per iteration
  • โ€”Attention Mechanism: Tree-based for parallel draft verification
  • โ€”Training Paradigm: Online learning during inference (Aurora framework)

Training Details

Aurora Framework

This model was trained from scratch using Aurora, an inference-time training framework that:

  • โ€”No Pre-training Required: Starts from random initialization and learns entirely through online training
  • โ€”Updates the draft model dynamically during inference
  • โ€”Uses reverse KL divergence for distribution matching (minimizing KL(target || draft))
  • โ€”Employs online learning with periodic model updates
  • โ€”Optimizes for both draft quality and speculative acceptance rate
  • โ€”Demonstrates that effective draft models can be built from scratch without expensive pre-training

Training Configuration

  • โ€”Hardware: NVIDIA H200 GPU
  • โ€”Training Steps: 10,000 steps over 80,000 inference requests
  • โ€”Learning Rate: 1e-4
  • โ€”TTT Length: 5 tokens
  • โ€”Speculative Steps: 5
  • โ€”Update Interval: Every 10 requests
  • โ€”Loss Weights:
  • โ€”NTP Loss: 1.0
  • โ€”Prediction Loss: 1.0
  • โ€”KL Divergence: Reverse KL divergence (draft โ†’ target)

Dataset

Trained on the OnlineSD Code Dataset, which contains diverse coding examples suitable for training speculative decoding models.

Benchmarks

End-to-End Throughput Performance

Measured on a holdout dataset from the OnlineSD Code Dataset using the final Aurora checkpoint.

Qwen-Coder-Next: end-to-end throughput under varying batch size and lookahead

We report tokens-per-second (TPS) statistics and speedup relative to the no-speculation baseline.

BSConfigMean TPSP50 TPSP05 TPSP95 TPSSpeedup (Mean)Acc Len
1w/o spec176.4178.0172.3178.4----
lookahead 3252.1254.8208.8291.61.43ร—2.67
lookahead 4263.1264.0211.8312.71.49ร—2.91
lookahead 5265.7264.8208.7320.51.51ร—3.06
8w/o spec119.8121.5104.8134.6----
lookahead 3141.0138.9110.4178.51.18ร—2.67
lookahead 4142.5141.2110.3181.61.19ร—2.91
lookahead 5146.3143.5109.6189.51.23ร—3.07
16w/o spec99.6102.174.5119.2----
lookahead 3104.0100.575.6151.91.04ร—2.67
lookahead 4105.6101.177.5149.71.06ร—2.92
lookahead 5107.6103.775.7156.61.09ร—3.06
32w/o spec85.088.754.5104.5----
lookahead 378.972.853.0122.30.93ร—2.68
lookahead 479.573.752.9124.70.94ร—2.91
lookahead 580.372.652.8130.70.94ร—3.06

Performance Across Different Batch Sizes

Aurora provides the largest gains at small-to-moderate batch sizes, with up to 1.51ร— speedup at batch size 1, demonstrating the effectiveness of speculative decoding for latency-critical scenarios. The benefits diminish as batch size increases:

  • โ€”Batch Size 1 (Best Case): Up to 1.51ร— speedup with lookahead 5 configuration (3.06 average accept length). At low batch sizes, the cost of draft generation and verification is well amortized by reduced target model forward passes.
  • โ€”Batch Size 8 (Moderate): 1.23ร— speedup with lookahead 5 configuration (3.07 average accept length). Speculative decoding still provides meaningful throughput improvements for moderate batching.
  • โ€”Batch Size 16 (Diminishing Returns): 1.09ร— speedup with lookahead 5 configuration (3.06 average accept length). Benefits become marginal as verification overhead increases relative to baseline throughput.
  • โ€”Batch Size 32 (Negative Returns): At large batch sizes, verification overhead dominates and speculative decoding becomes slightly slower than the baseline (0.93-0.94ร—). The target model's batch processing efficiency outweighs the benefits of skipping forward passes.

Metrics Explained:

  • โ€”TPS: Tokens per second (throughput)
  • โ€”Acc Len: Average accept length (number of draft tokens accepted per verification step)
  • โ€”Speedup: Relative to the no-speculation baseline
  • โ€”P05/P95: 5th and 95th percentile throughput values

Notably, this performance is achieved with a model trained from scratch - it learns entirely through Aurora's online training process, demonstrating the effectiveness of inference-time training without expensive pre-training.

Usage

This model is designed to be used as a draft model in EAGLE3 speculative decoding pipelines with Qwen3-Coder as the target model.

Example 1: Python API (Offline Batch Inference)

python
import sglang as sgl

def main():
    # Sample prompts
    prompts = [
        "Write a Python function to compute fibonacci numbers:",
        "Implement a binary search algorithm in Python:",
        "Create a class for a binary tree in Python:",
    ]

    # Create sampling params
    sampling_params = {"temperature": 0.7, "max_new_tokens": 256}

    # Initialize engine with speculative decoding
    llm = sgl.Engine(
        model_path="Qwen/Qwen3-Coder-Next-FP8",
        speculative_draft_model_path="togethercomputer/Aurora-Spec-Qwen3-Coder-Next-FP8",
        speculative_algorithm="EAGLE3",
        speculative_num_steps=5,
        speculative_eagle_topk=1,
        speculative_num_draft_tokens=6,
        trust_remote_code=True,
    )

    # Generate with speculative decoding
    outputs = llm.generate(prompts, sampling_params)

    # Print the outputs
    for prompt, output in zip(prompts, outputs):
        print("=" * 50)
        print(f"Prompt: {prompt}")
        print(f"Generated: {output['text']}")

# The __main__ condition is necessary when using spawn to create subprocesses
if __name__ == "__main__":
    main()

Example 2: Launch Server (Production Use)

Step 1: Start the SGLang server with speculative decoding

bash
python -m sglang.launch_server \
    --model-path Qwen/Qwen3-Coder-Next-FP8 \
    --speculative-draft-model-path togethercomputer/Aurora-Spec-Qwen3-Coder-Next-FP8 \
    --speculative-algorithm EAGLE3 \
    --speculative-num-steps 5 \
    --speculative-eagle-topk 1 \
    --speculative-num-draft-tokens 6 \
    --trust-remote-code \
    --port 30000 \
    --host 0.0.0.0

Step 2: Send requests to the server

python
import requests
import json

# Server endpoint
url = "http://localhost:30000/v1/completions"

# Request payload
payload = {
    "prompt": "Write a Python function to compute fibonacci numbers:",
    "max_tokens": 256,
    "temperature": 0.7,
}

# Send request
response = requests.post(url, json=payload)
result = response.json()

print(result["choices"][0]["text"])

Or using OpenAI-compatible client:

python
from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:30000/v1",
    api_key="EMPTY"
)

response = client.completions.create(
    model="Qwen/Qwen3-Coder-Next-FP8",
    prompt="Write a Python function to compute fibonacci numbers:",
    max_tokens=256,
    temperature=0.7,
)

print(response.choices[0].text)

Local Model Paths

If you have downloaded the models locally, replace the HuggingFace model paths with local paths:

bash
python -m sglang.launch_server \
    --model-path /path/to/Qwen3-Coder-Next-FP8 \
    --speculative-draft-model-path /path/to/Aurora-Spec-Qwen3-Coder-Next-FP8 \
    --speculative-algorithm EAGLE3 \
    --speculative-num-steps 5 \
    --speculative-eagle-topk 1 \
    --speculative-num-draft-tokens 6 \
    --trust-remote-code \
    --port 30000

Limitations

  • โ€”Optimized specifically for code generation tasks
  • โ€”Performance may vary on non-coding domains
  • โ€”Requires compatible EAGLE3 inference framework
  • โ€”Best performance achieved with Qwen/Qwen3-Coder-Next-FP8 as target model

Citation

If you use this model, please cite:

bibtex
@article{aurora2026,
  title={When RL Meets Adaptive Speculative Training: A Unified Training-Serving System},
  author={Wang, Junxiong and Bie, Fengxiang and Li, Jisen and Zhou, Zhongzhu and Shao, Zelei and Wang, Yubo and Liu, Yinghui and Wu, Qingyang and May, Avner and Yanamandra, Sri and Zhang, Yineng and Zhang, Ce and Dao, Tri and Liang, Percy and Athiwaratkun, Ben and Song, Shuaiwen Leon and Xu, Chenfeng and Wu, Xiaoxia},
  journal={arXiv preprint arXiv:2602.06932},
  year={2026},
  url={https://arxiv.org/abs/2602.06932}
}

Acknowledgments

License

Apache 2.0