← Back to Blog

DSpark + SGLang Hit 383 Tokens/Second: Speculative Decoding Cost Savings Measured in Production

By Eric Bush · July 7, 2026 · 10 min read

Blue data streams flowing at high speed across a dark background

383 Tokens Per Second Changes the Math

The SGLang team's integration of DSpark speculative decoding has produced a number that demands attention: 383 tokens per second on a single request using Llama 3.1 70B on a single 8xH100 node. Standard autoregressive decoding on the same setup tops out around 85-95 tok/s. That is a 4x throughput multiplier — and throughput multipliers translate directly into cost reduction when you are paying for GPU-seconds.

This is not a synthetic benchmark on toy models. DSpark's confidence-driven variable-length verification scheme was tested on production-representative workloads: code generation, long-form text, and structured JSON output. The results hold across all three, with acceptance rates between 78% and 92% depending on the task distribution.

How DSpark Speculative Decoding Works

Traditional speculative decoding uses a small draft model to propose N tokens, then the target model verifies all N in a single forward pass. If the draft model proposes poorly, you waste the verification compute on rejected tokens. DSpark improves this with two key innovations:

Confidence-driven variable-length speculation: Instead of always proposing a fixed K tokens, DSpark dynamically adjusts speculation length based on the draft model's confidence. High-confidence sequences (like boilerplate code, common patterns) get longer speculation windows (up to 12 tokens). Low-confidence sequences (novel logic, branching decisions) fall back to shorter windows (3-5 tokens). This maximizes acceptance rate without wasting verification compute.

Ragged CUDA Graph batching: The traditional problem with variable-length speculation is that it breaks CUDA Graph optimization (which requires static shapes). DSpark solves this with ragged batching — grouping requests with similar speculation lengths into the same CUDA Graph execution. This preserves 90%+ of the CUDA Graph speedup while allowing dynamic speculation length.

Dynamic scheduling with tree attention: When multiple speculation branches are in flight, DSpark uses tree-structured attention to verify multiple candidate continuations simultaneously. The scheduler dynamically allocates verification bandwidth across requests based on their acceptance probability, prioritizing high-confidence sequences that will likely be accepted.

Cost Savings: The Per-Million-Token Math

The cost model for LLM inference is fundamentally GPU-time per token. If you generate 4x more tokens in the same GPU-time, your cost per token drops proportionally — minus the overhead of running the draft model. Here is the breakdown:

Baseline (autoregressive): Llama 3.1 70B on 8xH100 at 90 tok/s. At $2.50/GPU-hour (cloud pricing), generating 1M output tokens takes approximately 1,389 GPU-seconds = $0.96 per million tokens in raw compute.

With DSpark: 383 tok/s on the same hardware. 1M output tokens takes 327 GPU-seconds = $0.227 per million tokens. However, the draft model (Llama 3.1 8B) consumes an additional GPU — add ~$0.03 overhead for draft model compute, bringing the total to approximately $0.257 per million tokens.

Net savings: 73% reduction in output token cost. Per million output tokens, you save approximately $0.70 compared to standard autoregressive decoding.

Which Workloads Benefit Most

Speculative decoding's effectiveness depends on how predictable the output sequence is. The draft model needs to guess correctly for the technique to pay off. In practice, this creates a clear hierarchy of workload benefit:

Highest benefit (85-92% acceptance rate): Code generation with boilerplate patterns, API client code, CRUD operations, test file generation, documentation generation. These workloads have highly predictable token sequences — the draft model guesses correctly 9 out of 10 times.

Medium benefit (78-85% acceptance rate): General code completion in application logic, refactoring, bug fixes with clear patterns. The draft model handles common patterns well but misses on novel architecture decisions.

Lower benefit (65-78% acceptance rate): Creative writing, novel algorithm design, complex reasoning chains. Lower predictability means shorter effective speculation windows and more rejected tokens.

For AI coding agents specifically, the news is excellent. Code generation workloads sit squarely in the highest-benefit category. A typical coding agent session is 60-70% boilerplate and pattern-matching (file scaffolding, imports, standard error handling) and 30-40% novel logic. Blended acceptance rates of 82-88% are realistic for coding workloads.

Throughput vs Latency: The Tradeoff

The 383 tok/s figure is single-request throughput — how fast one user's generation completes. In a batch-serving scenario (many concurrent users), the picture is different. Speculative decoding uses extra compute per request (the draft model, the verification passes), which reduces total system throughput when the GPU is already saturated with concurrent requests.

SGLang's implementation handles this with an adaptive mode: when system load is below 60% GPU utilization, speculative decoding activates for maximum per-request speed. Above 60% utilization, it falls back to standard autoregressive to maximize total system throughput. This means the 73% cost savings applies most clearly to interactive use cases (coding agents, real-time completions) rather than high-batch offline processing.

What This Means for API Pricing in 2026-2027

Speculative decoding is an inference-side optimization — it reduces the cost of serving existing models without changing model quality. API providers can adopt it without retraining. The question is how quickly the cost savings flow through to pricing.

Historically, inference optimizations take 6-12 months to be reflected in API pricing. Flash Attention v2 shipped in mid-2023 and pricing cuts followed in early 2024. Continuous batching optimizations from late 2023 showed up in mid-2024 price reductions. If SGLang's DSpark integration sees production adoption in Q3 2026, expect output token pricing for open-weight models to drop 30-50% by Q1-Q2 2027.

For proprietary models (Claude, GPT), the timeline depends on whether providers implement equivalent speculative decoding. Anthropic and OpenAI likely have internal speculative decoding systems already, but the DSpark innovations (ragged CUDA Graphs, dynamic scheduling) represent meaningful improvements that could accelerate their deployment of these techniques.

Practical Takeaway for Developers

If you self-host models via SGLang, enabling DSpark speculative decoding today can cut your output token costs by up to 73% on coding workloads. If you use commercial APIs, the savings are coming but on a 6-12 month lag. In the meantime, the 383 tok/s benchmark establishes a new performance floor that all serving frameworks will need to match — pushing the entire ecosystem toward faster, cheaper inference.

Want to calculate exact costs for your project?

Frequently Asked Questions

How much does DSpark speculative decoding save per million tokens?

On coding workloads, DSpark reduces output token cost by approximately 73% — from $0.96 to $0.257 per million tokens on Llama 3.1 70B (8xH100 setup), saving roughly $0.70 per million output tokens.

What is the throughput improvement of DSpark over standard decoding?

DSpark achieves 383 tokens/second single-request throughput on Llama 3.1 70B, compared to 85-95 tok/s with standard autoregressive decoding — approximately a 4x throughput multiplier.

Which coding tasks benefit most from speculative decoding?

Boilerplate code generation, API clients, CRUD operations, and test files see the highest benefit (85-92% acceptance rate). Novel algorithm design and complex reasoning see lower benefit (65-78% acceptance rate).

When will speculative decoding improvements show up in API pricing?

Based on historical patterns, inference optimizations take 6-12 months to reach API pricing. If DSpark sees production adoption in Q3 2026, expect 30-50% output token price drops for open-weight models by Q1-Q2 2027.

Does speculative decoding work well at high concurrency?

SGLang uses adaptive mode: speculative decoding activates below 60% GPU utilization for maximum per-request speed, and falls back to standard autoregressive above 60% to maximize total throughput. The largest cost savings apply to interactive (low-concurrency) use cases.