DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Hands-On: Build a Least-Privilege Sandbox for AI Agents on Kubernetes
  • The Agent Returned the Right Answer but Took the Wrong Path
  • Prompt Caching for Multi-Turn Coding Agents: Why Append-Only Transcripts Cut Your Token Bill
  • Should an AI Agent Have Write Access to Your AWS Account?

Trending

  • Solving the Stateful Exception: Database Branching and the Unification of CI/CD
  • What 55 Runs Taught Me About Memory in AI Coding Agents
  • PWA on iOS, Part 6: Performance, Rendering, and Keyboard
  • PWA on iOS, Part 5: Service Worker Updates, Cache, and Push

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. AI/ML
  4. The KV Cache Is Optional Now: What Mercury 3's 1000 tok/s Means for the Inference Serving Stack

The KV Cache Is Optional Now: What Mercury 3's 1000 tok/s Means for the Inference Serving Stack

Inception's Mercury 3 serves 1000+ tokens per second from a 40x larger diffusion model with no per-token KV cache. The serving stack's assumptions — all break.

By 
Khushan Adatiya
·
Nov. 30, 26 · Analysis
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
166 Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

The Announcement That Broke the Serving Team's Week

On October 19, Inception Labs announced Mercury 3: a diffusion language model more than forty times the size of Mercury 1, still generating over 1,000 tokens per second, with a one-million-token context window. Their claim is that it matches or beats frontier speed-optimized autoregressive models — GPT-6 Luna and Claude Haiku 5.5 — across a broad set of benchmarks while running four to eight times faster. Stefano Ermon's framing was blunt: "We're showing that the limits to scaling diffusion models are compute and data, not fundamental algorithmic barriers."

I read that the way I read any infrastructure claim: from the serving side. I spend my days at Google on Apigee Analytics and Monetization, running near-real-time API monitoring at roughly 440k transactions per second against 99.99% availability targets. When someone tells me a model is forty times larger and just as fast, I do not ask about the benchmarks first. I ask what changed in the serving path, because every order-of-magnitude inference claim in the last five years has been a serving story wearing a model costume.

This one genuinely is. A diffusion LLM does not emit tokens left to right. It starts from a fully masked block and refines every position in parallel, over several denoising steps, until the block is done. There is no token-at-a-time decode loop. That single fact invalidates most of what the modern inference stack assumes about a request — and if you run serving infrastructure, Mercury 3 is the moment to rebuild the mental model before the hardware purchase orders do it for you.

How a Diffusion Model Actually Decodes

Forget autoregression for a minute. Here is the decode loop that production diffusion LLMs use, pieced together from the published serving research (LLaDA-style block diffusion, the D2F work on diffusion forcing, NVIDIA's Nemotron DLM modes, and the recent "Denoising Surface" paper on diffusion serving cost):

  1. The output is generated in blocks — typically 32 tokens per block, fixed at deployment time — and blocks are produced left to right, so the model supports variable-length generation. Fixed-canvas diffusion (the whole response as one masked canvas) wastes compute on padding; the industry moved to block-autoregressive generation early.
  2. Inside a block, every position starts as a mask token. Each denoising step is one full forward pass over the block, and the model predicts a token distribution for every masked position in parallel.
  3. After each step, positions whose predicted distribution is peaked enough — above a confidence threshold — are committed. The rest stay masked for the next pass. The block is done when every position commits, or a max-step cap is hit.
  4. Once a block is fully denoised, its KV states are refreshed and cached as fixed context for subsequent blocks. (Bidirectional attention inside the block means KV keeps shifting during denoising, so the cache is only valid at block boundaries — a subtlety the FreeCache work handles by approximating prompt KV reuse across steps.)
  5. If an EOS token appears, generation stops; otherwise, a new masked block is appended, and the loop repeats.

How a diffusion model decodes

The hybrids matter too. D2F (discrete diffusion forcing) keeps block-level causality so completed blocks reuse an exact KV cache, while denoising later blocks against partially-denoised predecessors for inter-block parallelism. NVIDIA's Nemotron DLM ships a self-speculation mode where the same model drafts a full block by diffusion and verifies it autoregressively — lossless against AR at temperature zero, with roughly six times the tokens per forward pass. The space is converging on one insight: the forward pass, not the token, is the unit of work.

Five Things the Serving Stack Got for Free

The vLLM-era stack is built on assumptions that felt like physics. Diffusion serving breaks all five.

1. Capacity planning keys on KV cache bytes. In an AR server, memory is the binding constraint: max_num_seqs is derived from free KV cache divided by bytes per token. Admission control, continuous batching, and OOM protection all flow from this one equation. A diffusion decoder does not grow a KV cache per token — it spends a fixed-size block buffer per denoising step and refreshes at block boundaries. Memory stops being the scarce resource; forward passes do.

2. Continuous batching schedules at token granularity. The whole point of continuous batching is that every iteration produces exactly one token per sequence, so the scheduler can insert and evict sequences at token boundaries with uniform per-step cost. A diffusion iteration produces a variable number of committed tokens — sometimes half a block, sometimes zero — and each iteration costs a full forward pass over the block regardless. The scheduler's cost model, which assumes "one step equals one token," is wrong on both axes.

3. Prefill/decode disaggregation assumes memory-bound decode. Disaggregated serving works because decode is memory-bandwidth bound (streaming the KV cache) while prefill is compute bound, so they belong on different instance pools. A denoising step is a full forward pass over the block — compute-heavy, much closer to prefill in character. Put diffusion decode on your memory-optimized decode instances, and you have built the wrong fleet.

4. Speculative decoding's acceptance math assumes a drafter. The entire spec-decode economy — draft cost, acceptance length, the bonus token — is built on a small autoregressive drafter proposing tokens for a large verifier. In a diffusion stack, the draft is the parallel pass; NVIDIA's LinearSpec shows the two paradigms fusing into one loop rather than one accelerating the other. Yesterday's article in this series tore down a spec-decode benchmark for using synthetic acceptance at batch 1; with diffusion models, the honest question is whether your "speculative" path is even measuring a real second model.

5. SLOs and billing count tokens. Time-to-first-token, tokens-per-second, inter-token latency, per-token pricing — the whole observability and billing surface assumes output arrives one token at a time at roughly constant cost per token. Diffusion output arrives in committed chunks of unpredictable size, and cost is incurred per denoising step whether or not anything commits. TTFT has to become time-to-first-committed block; per-token billing silently misprices the stubborn requests that burn steps and commit little.

Autoregressive vs. diffusion serving

What Replaces It: The Forward Pass as the Unit of Work

The honest metric for a diffusion server is tokens per forward pass (TPF) — committed tokens divided by denoising steps — and its evil twin, forward passes per request. Everything downstream follows:

  • Admission control budgets forward passes, not KV bytes. A request's cost is a denoising surface: blocks multiplied by steps per block, where steps per block is a distribution, not a number. The recent "Denoising Surface" paper (arXiv, October 2026) makes exactly this point: diffusion generation cost varies substantially across requests, and a scheduler guided by a predicted surface cuts online latency versus token-count admission. Their DWS-guided scheduler is the first production-shaped answer to this problem.
  • Scheduling happens at step granularity, not token granularity. The batch unit is one denoising step applied across the batch's active blocks. Requests whose blocks finish early free their slots at block boundaries — coarser than token boundaries, which changes the insert/evict dynamics continuous batching was tuned for.
  • KV refresh is a scheduling event. When a block commits, its KV must be refreshed into the cache before the next block's steps can reuse it. That refresh is a synchronization point across the batch — the closest thing diffusion serving has to a barrier, and a new source of tail latency if one request's block drags.
  • The honest benchmark questions change. Yesterday's piece in this series showed how to read a spec-decode benchmark's footnotes. For a diffusion throughput claim, the footnotes are: batch size, block size, max steps per block, confidence threshold, whether commit counts were measured or assumed, and whether the number includes the prefill of a million-token context. Mercury 3's 1,000 tok/s is a real engineering number — the 40x scale claim says the denoising math held up — but as a capacity number it is meaningless until those five parameters are pinned down.


Code 1: The Decode Loop, With Honest Accounting

This is a simulation harness for block-autoregressive diffusion decoding — not a real model, but the accounting is faithful: every denoising step is one forward pass, commits happen by confidence threshold, the block's KV is refreshed at commit, and a per-request step budget is enforced. Run it and watch the metric that matters: tokens per forward pass under different step budgets.

from __future__ import annotations

import math
import random
from dataclasses import dataclass, field
from typing import List, Tuple


@dataclass(frozen=True)
class DenoiseConfig:
    block_size: int = 32
    max_steps_per_block: int = 16
    confidence_threshold: float = 0.90
    step_budget_per_request: int = 512  # hard cap on forward passes

    def __post_init__(self) -> None:
        if self.block_size < 1:
            raise ValueError("block_size must be >= 1")
        if self.max_steps_per_block < 1:
            raise ValueError("max_steps_per_block must be >= 1")
        if not 0.0 < self.confidence_threshold < 1.0:
            raise ValueError("confidence_threshold must be in (0, 1)")
        if self.step_budget_per_request < 1:
            raise ValueError("step_budget_per_request must be >= 1")


class StepBudgetExhausted(Exception):
    """Raised when a request exceeds its forward-pass budget."""


class ConfidenceModel:
    """Test double for a dLLM head: per-position max-probability.

    Confidence rises with denoising steps; a few positions are genuinely
    stubborn, the way ambiguous tokens are in real text. This is a stand-in
    for the model — the accounting around it is the point.
    """

    def __init__(self, block_size: int, seed: int, hard_positions: int = 2) -> None:
        rng = random.Random(seed)
        self._difficulty = [rng.random() for _ in range(block_size)]
        for i in rng.sample(range(block_size), min(hard_positions, block_size)):
            self._difficulty[i] = 0.95 + 0.05 * rng.random()
        self._tau = [0.5 + rng.random() * 2.0 for _ in range(block_size)]

    def confidence(self, step: int) -> List[float]:
        return [
            1.0 - d * math.exp(-(step + 1) / t)
            for d, t in zip(self._difficulty, self._tau)
        ]


@dataclass
class DecodeStats:
    blocks: int = 0
    forward_passes: int = 0
    tokens_committed: int = 0
    steps_per_block: List[int] = field(default_factory=list)

    @property
    def tokens_per_forward_pass(self) -> float:
        return self.tokens_committed / max(self.forward_passes, 1)

    @property
    def mean_steps_per_block(self) -> float:
        return sum(self.steps_per_block) / max(len(self.steps_per_block), 1)


class BlockDecoder:
    """Block-autoregressive dLLM decode loop with step-budget accounting.

    Each denoising step is one full forward pass over the block. Tokens
    above the confidence threshold commit; the rest stay masked. When a
    block finishes, its KV is refreshed and cached for subsequent blocks.
    """

    def __init__(self, config: DenoiseConfig, seed: int = 0) -> None:
        self.config = config
        self.stats = DecodeStats()
        self._seed = seed

    def _decode_block(self, block_index: int) -> Tuple[List[str], int]:
        cfg = self.config
        model = ConfidenceModel(cfg.block_size, seed=self._seed + block_index)
        committed = [False] * cfg.block_size
        tokens = ["<mask>"] * cfg.block_size
        steps = 0

        while not all(committed) and steps < cfg.max_steps_per_block:
            if self.stats.forward_passes >= cfg.step_budget_per_request:
                raise StepBudgetExhausted(
                    f"block {block_index}: exceeded {cfg.step_budget_per_request} forward passes"
                )
            conf = model.confidence(steps)  # one forward pass over the block
            self.stats.forward_passes += 1
            steps += 1
            for i, c in enumerate(conf):
                if not committed[i] and c >= cfg.confidence_threshold:
                    committed[i] = True
                    tokens[i] = f"tok_{i}"  # stand-in for argmax over the head

        # KV refresh: the finished block's KV is now cacheable context.
        # In a real server this is where the block-boundary barrier hits.
        self.on_block_commit(block_index, tokens)
        return tokens, steps

    def on_block_commit(self, block_index: int, tokens: List[str]) -> None:
        """Hook for the KV-refresh / scheduling barrier. Override in prod."""

    def decode(self, num_blocks: int) -> Tuple[List[List[str]], DecodeStats, bool]:
        if num_blocks < 1:
            raise ValueError("num_blocks must be >= 1")
        out: List[List[str]] = []
        truncated = False
        for b in range(num_blocks):
            try:
                tokens, steps = self._decode_block(b)
            except StepBudgetExhausted:
                truncated = True
                break
            out.append(tokens)
            self.stats.blocks += 1
            self.stats.tokens_committed += sum(1 for t in tokens if t != "<mask>")
            self.stats.steps_per_block.append(steps)
        return out, self.stats, truncated


if __name__ == "__main__":
    for budget in (512, 128, 48):
        cfg = DenoiseConfig(
            block_size=32,
            max_steps_per_block=16,
            confidence_threshold=0.90,
            step_budget_per_request=budget,
        )
        _, stats, truncated = BlockDecoder(cfg, seed=7).decode(num_blocks=8)
        print(
            f"budget={budget:4d} tokens={stats.tokens_committed:3d} "
            f"passes={stats.forward_passes:3d} TPF={stats.tokens_per_forward_pass:.2f} "
            f"mean_steps={stats.mean_steps_per_block:.1f} truncated={truncated}"
        )

Sample output tells the story the prose cannot: tightening the step budget barely moves tokens per forward pass until it does, then requests truncate mid-block. The cliff, not the curve, is what your SLOs will hit.

Code 2: Admission Control on a Forward-Pass Budget (Go)

In an AR stack, the admission question is "does this request's KV footprint fit?" In a diffusion stack, the question is "does this request's predicted denoising surface fit this window's forward-pass budget?" This controller costs interactive-tier requests at the P95 of the predicted surface and batch-tier at the P50 — the diffusion equivalent of headroom planning — and reconciles against actuals when the request finishes.

// Package scheduler admits diffusion-LLM requests against a forward-pass
// budget. The scarce resource is no longer KV-cache bytes: it is denoising
// steps, each one a full forward pass over a block.
package scheduler

import (
	"errors"
	"sync"
	"time"
)

var ErrOverBudget = errors.New("scheduler: request exceeds forward-pass budget")

// DenoisePrediction is the scheduler-visible shape of a request's cost.
// It comes from a calibrated predictor (e.g. a Denoising-Surface model);
// the scheduler must never trust the client for it.
type DenoisePrediction struct {
	Blocks           int
	P50StepsPerBlock float64
	P95StepsPerBlock float64
}

// ForwardPasses returns the admission cost of the request. Conservative
// costing (P95) is for latency-sensitive tiers; mean costing (P50) for batch.
func (p DenoisePrediction) ForwardPasses(conservative bool) float64 {
	perBlock := p.P50StepsPerBlock
	if conservative {
		perBlock = p.P95StepsPerBlock
	}
	return float64(p.Blocks) * perBlock
}

type Request struct {
	ID         string
	Tier       string // "interactive" or "batch"
	Prediction DenoisePrediction
	Deadline   time.Time
}

// AdmissionController guards a per-window forward-pass budget.
type AdmissionController struct {
	mu       sync.Mutex
	budget   float64 // forward passes available this scheduling window
	reserved float64
}

func NewAdmissionController(budgetPerWindow float64) (*AdmissionController, error) {
	if budgetPerWindow <= 0 {
		return nil, errors.New("scheduler: budgetPerWindow must be positive")
	}
	return &AdmissionController{budget: budgetPerWindow}, nil
}

// Admit reserves budget for req, or returns ErrOverBudget with the reason
// the caller logs. Interactive requests are costed at P95, batch at P50.
func (a *AdmissionController) Admit(req Request) error {
	if req.Prediction.Blocks < 1 {
		return errors.New("scheduler: predicted blocks must be >= 1")
	}
	if req.ID == "" {
		return errors.New("scheduler: request ID is required")
	}
	cost := req.Prediction.ForwardPasses(req.Tier == "interactive")

	a.mu.Lock()
	defer a.mu.Unlock()
	if a.reserved+cost > a.budget {
		return ErrOverBudget
	}
	a.reserved += cost
	return nil
}

// Release reconciles the reservation against the actual consumed steps when
// the request finishes, so the next window's budget reflects reality rather
// than the prediction. Overruns push reserved above budget; the next window
// starts with Reset regardless.
func (a *AdmissionController) Release(req Request, actualSteps int) {
	if actualSteps < 0 {
		return // defensive: a negative actual is a metrics bug, not a refund
	}
	predicted := req.Prediction.ForwardPasses(req.Tier == "interactive")

	a.mu.Lock()
	defer a.mu.Unlock()
	a.reserved -= predicted - float64(actualSteps)
	if a.reserved < 0 {
		a.reserved = 0
	}
}

// Reset opens a new scheduling window. Call it on your window tick.
func (a *AdmissionController) Reset() {
	a.mu.Lock()
	defer a.mu.Unlock()
	a.reserved = 0
}

The design decision worth arguing about: batch tier at P50 means half your batch requests overrun their prediction, which is fine — batch has no latency SLO, and the window reset absorbs it. Interactive at P95 is the price of a p99 TTFT-style SLO on time-to-first-committed-block. If your predictor cannot produce a calibrated P95, you do not have a scheduler; you have a hope.

Code 3: Observability for a World Without Per-Token Cost (Python)

Your dashboards were built for AR. tokens_per_second, inter-token latency, KV cache utilization — all of them either lie or go silent on a diffusion server. This monitor tracks what actually determines cost and SLOs: forward passes per request, committed tokens per pass, effective throughput, and the drift between per-token billing and per-step compute cost.

from __future__ import annotations

import statistics
import threading
import time
from dataclasses import dataclass, field
from typing import Dict, List


@dataclass
class RequestTrace:
    request_id: str
    blocks: int
    forward_passes: int
    tokens_committed: int
    started_at: float = field(default_factory=time.monotonic)
    ended_at: float = 0.0

    @property
    def latency_s(self) -> float:
        return max(self.ended_at - self.started_at, 1e-9)

    @property
    def effective_tok_per_s(self) -> float:
        """Throughput that actually carries meaning.

        A denoising step that refines but commits nothing is real compute
        with zero visible output. Effective throughput counts only committed
        tokens, which makes it the honest number for SLOs.
        """
        return self.tokens_committed / self.latency_s

    @property
    def tokens_per_forward_pass(self) -> float:
        return self.tokens_committed / max(self.forward_passes, 1)


class DenoiseMonitor:
    """Thread-safe per-request accounting for diffusion serving."""

    def __init__(self, cost_per_forward_pass_usd: float, price_per_mtok_usd: float) -> None:
        if cost_per_forward_pass_usd < 0 or price_per_mtok_usd < 0:
            raise ValueError("cost and price must be non-negative")
        self._lock = threading.Lock()
        self._traces: List[RequestTrace] = []
        self._cost_per_pass = cost_per_forward_pass_usd
        self._price_per_mtok = price_per_mtok_usd

    def record(self, trace: RequestTrace) -> None:
        trace.ended_at = time.monotonic()
        with self._lock:
            self._traces.append(trace)

    def serving_report(self) -> Dict[str, float]:
        """The four numbers that replace your AR dashboard's top row."""
        with self._lock:
            traces = list(self._traces)
        if not traces:
            return {}
        eff = sorted(t.effective_tok_per_s for t in traces)
        tpf = [t.tokens_per_forward_pass for t in traces]
        return {
            "requests": float(len(traces)),
            "p50_effective_tok_per_s": statistics.median(eff),
            "p99_effective_tok_per_s": eff[max(int(len(eff) * 0.99) - 1, 0)],
            "mean_tokens_per_forward_pass": statistics.fmean(tpf),
            "mean_forward_passes_per_request": statistics.fmean(
                t.forward_passes for t in traces
            ),
        }

    def billing_drift(self) -> Dict[str, float]:
        """How far per-token billing drifts from per-step compute cost.

        Bill committed tokens at AR-style per-token prices while your cost is
        forward passes, and the stubborn requests — many steps, few commits —
        silently lose money. Positive drift means you are underpricing compute.
        """
        with self._lock:
            passes = sum(t.forward_passes for t in self._traces)
            tokens = sum(t.tokens_committed for t in self._traces)
        cost = passes * self._cost_per_pass
        revenue = tokens / 1_000_000 * self._price_per_mtok
        return {
            "compute_cost_usd": cost,
            "token_revenue_usd": revenue,
            "drift": (cost - revenue) / max(revenue, 1e-9),
        }

The billing drift function is the one I would deploy first. Inference providers price per token because tokens were the cost unit. The moment your fleet serves a diffusion model, that pricing is a bet that steps-per-token stays constant — and the denoising surface says it does not. Measure the drift before finance does.

The Migration Checklist

If you run a vLLM-style stack and a diffusion model lands on your roadmap, here is the work, in the order I would do it:

  1. Re-instrument first. You cannot schedule what you cannot see. Deploy the per-request accounting from Code 3 — forward passes, committed tokens, tokens per forward pass — on whatever diffusion endpoint you have today, even if it is a single replica. The denoising surface of your actual traffic is the input to every decision below.
  2. Rebuild the admission math. Replace the KV-byte admission check with a forward-pass budget keyed on a predicted denoising surface (Code 2), calibrated per tier. Until you have a calibrated predictor, cost interactive requests at a fixed conservative steps-per-block and measure the overrun — that measurement is the first version of the predictor.
  3. Re-split the fleet. Audit your prefill/decode disaggregation: diffusion decode steps are compute-heavy forward passes, so your memory-optimized decode pool is the wrong shape. Expect the disaggregated topology to collapse back toward homogeneous compute instances, with the split moving to interactive-vs-batch rather than prefill-vs-decode.
  4. Retire spec-decode where the drafter was the point. If your stack leans on speculative decoding for latency, evaluate diffusion-native equivalents (self-speculation loops like LinearSpec) instead of bolting an AR drafter onto a diffusion target. The acceptance math does not transfer.
  5. Rebenchmark everything, with the new footnotes. Batch size, block size, max steps, confidence threshold, measured vs. assumed commits, prefill inclusion. Mercury 3's 1,000 tok/s survived a 40x scale-up of the model, which is genuinely remarkable — it means the denoising dynamics did not degrade with size. But the number you put in a capacity plan is tokens per forward pass at your block size and your confidence threshold, at production batch, with prefill included.

What stays the same is the boring and important part: continuous batching's core idea (never let the GPU idle), request-level isolation, backpressure, and the discipline of reading benchmarks like an adversary. The token stream was never really a stream — it was always a scheduling convenience. Diffusion models just made the convenience visible.

The KV cache had a good run. It was the right data structure for a sequential world. The next world refines in parallel, commits in chunks, and bills by the forward pass. Build for that, and the next forty-times-larger model will be a capacity planning exercise instead of a surprise.

Mercury (crystallography) AI

Opinions expressed by DZone contributors are their own.

Related

  • Hands-On: Build a Least-Privilege Sandbox for AI Agents on Kubernetes
  • The Agent Returned the Right Answer but Took the Wrong Path
  • Prompt Caching for Multi-Turn Coding Agents: Why Append-Only Transcripts Cut Your Token Bill
  • Should an AI Agent Have Write Access to Your AWS Account?

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook