Manuscript Offprint
arXiv:2610.34440Speculative Decoding for Mixture-of-Experts Models: Expert Bytes, Kernel Bandwidth and the Best Draft Length
Abstract
Speculative decoding checks several drafted tokens in one verification pass. On a mixture-of-experts (MoE) model, consecutive tokens often select the same experts. A deduplicating engine reads each selected expert once per pass, so it requests fewer bytes than a per-slot engine, which reads it once per token. We write a step's time as the bytes each kernel requests over its effective bandwidth, plus fixed time. Under geometric acceptance, we derive from this step time when speculation is faster than plain decoding. The best draft length is a monotone staircase in the acceptance rate. We bound how a bandwidth error moves each result, and we check the main steps in Lean. Deduplication is faster exactly where its share of the per-slot bytes is below its ratio of the per-slot bandwidth. On llama.cpp Metal, MLX-LM and llama.cpp CUDA, which we modified to deduplicate, the per-slot kernel has the higher effective bandwidth ( to 0.75). Thus deduplication is faster only from 5 to 8 tokens per pass, or never. We fit the bandwidths on one layer's expert operation, run alone, in under an hour per model. Bytes from routing traces over these bandwidths predict the time that deduplication saves. The measured saving lies inside its error bound at every point on CUDA and MLX-LM and at 36 of 48 points on Metal. The crossover is the first pass size at which deduplication is faster. The prediction places it within one pass size in 10 of 12 configurations of engine, model and depth. We computed these predictions after the measurements. On DeepSeek-V2-Lite, operation times measured before its speculative runs give the best draft length on CUDA within one at all 22 acceptance values.
1 Introduction
A mixture-of-experts (MoE) layer replaces one feed-forward block by N experts and a router that sends each token to m of them (Fedus et al., 2022; Shazeer et al., 2017). At batch size one, memory reads limit decoding (Chordiya, 2026; Pope et al., 2023; Zhang, 2026). In speculative decoding (Chen et al., 2023; Leviathan et al., 2023), a small draft model proposes k tokens, and this number is the draft length. The target, the model being decoded, checks these tokens with the current token in one verification pass. The acceptance rate a is the probability that a drafted token survives. On an MoE model, the pass needs the experts of all verified tokens. Published measurements disagree on whether speculation then speeds up decoding (Cao et al., 2026; Saxena et al., 2025). Consecutive tokens often choose the same experts (Suram, 2026; Zhang et al., 2026). An engine is the inference software that runs the model. A kernel is a GPU routine that the engine launches for one operation. The kernel that matters here runs the expert operation. This operation is the set of matrix products (gate, up and down projections) of each token of a verification pass with the weights of its selected experts. A slot is one of a token's m expert selections, so a pass of n tokens has nm slots. A per-slot kernel multiplies each token by each of its selected experts separately, with one expert read per slot. A deduplicating kernel groups the pass's tokens by expert and reads each distinct expert once. We call an engine per-slot or deduplicating by the kernel that it runs on verification passes. So reuse lowers the bytes of a pass only on a deduplicating engine.
Consider an affine step time , with the cost of a drafted token relative to a target step. For this step time, Leviathan et al. (2023) show that some draft length is faster than plain decoding exactly when . They also give the first step point, the acceptance at which the best draft length first exceeds zero. Section 3 extends both results to any step time. It also gives every step point when each further draft adds at least as much time as the one before. The cost of an MoE verification pass is not affine in . Its bytes depend on how many distinct experts the verified tokens select. Its time depends on how fast each kernel moves those bytes.
Prior systems decide whether to speculate either from measurement or from a model of the verification cost. Saxena et al. (2025) disables speculation when a utility measured online falls below one. Among cost models for MoE targets, MoESD (Huang et al., 2025) derived the expected number of distinct experts that n tokens select under uniform routing: with . Li et al. (2026) assumes deduplication and no fixed cost. Its speedup condition is on the ratio of the distinct experts that the tokens of a verification pass select to those of one token. So it is a condition on how often consecutive tokens repeat experts. S2-MoE (Huang et al., 2026) charges a verification the newly introduced experts times a per-expert latency. SpecFit (Cao et al., 2026) predicts cycle time as an intercept plus a coefficient times the per-layer union of experts. Both charge every expert read the same time at every pass size, which is a single bandwidth for every kernel. Neither derives the staircase, the best draft length as a function of acceptance. Neither derives a speedup from reuse together with the bandwidth of each kernel.
Next-token expert reuse has been measured at 44 to 48% on Qwen3-30B-A3B (Zhang et al., 2026) and 0.444 in llama.cpp router traces (Suram, 2026). MonoMoE (Gong et al., 2026) finds that token-major kernels that group tokens by expert underuse memory bandwidth when few tokens reach each expert. It replaces them by a fused kernel that loops over expert weights and applies each to all of its tokens. Opportunistic Expert Activation (Oncescu et al., 2025) re-routes tokens to experts that a batch already loads. Neither models when a deduplicating kernel is faster than a per-slot one. Engine developers tune that switch by hand (pratiknarola-t, 2026). An MLX issue reports that the deduplicating product at one row runs near half its bandwidth at four rows (Haddad, 2026). Both are engineering reports without peer review.
This paper separates the two inputs of a step's time. A speedup is a ratio of step times. A step's time is the bytes that its kernels request over the rate at which they move them, plus fixed time. That rate is the effective bandwidth of each kernel. The bytes follow from routing alone. On CUDA, they match a hardware count of DRAM bytes. The bandwidths depend on the kernel: on every engine and model that we measured, the per-slot kernel has the higher effective bandwidth. On a pass of n tokens, deduplication requests a share of the per-slot bytes, and routing fixes this share. Deduplication moves these bytes at a ratio of the per-slot bandwidth, and the kernels fix this ratio. So deduplication is faster exactly where . Its saving, the time it removes from a pass, is the per-slot expert time times . Section 2 measures the bytes and the bandwidths. Section 3 works in that step time. It gives the condition under which a draft length is faster than plain decoding, and the staircase. On a deduplicating engine, it gives the reuse threshold, the least mean reuse at which a draft length is faster, and the speedup. It also gives bounds on how a bandwidth error moves each prediction. These results are proved in Lean 4 (de Moura and Ullrich, 2021) against Mathlib (The mathlib Community, 2020). Section 4 tests them on deduplicating versions of llama.cpp Metal, MLX-LM and llama.cpp CUDA. We measure the bandwidth on the expert operation, in under an hour per model. Bytes from routing over this bandwidth predict the saving within its stated error on CUDA and MLX-LM. They predict the crossover within one pass size in 10 of 12 configurations. A configuration is an engine, a model and a context depth. On DeepSeek-V2-Lite, we measured operation times before any of its speculative runs. These times predict the best draft length on CUDA within one at every acceptance value. In contrast, the prediction from fits run afterwards misses its CUDA crossover. On Metal, the verify time needs one calibration of the time outside the expert operation.
Routing, union and reuse. A decoder has MoE layers of experts. In layer , the router selects a set of experts, , for the token at position . We call a law on the array a routing process. It is stationary when a window of tokens has the same law wherever it starts. A pass over consecutive tokens needs their distinct experts, with mean , . We define the consecutive-token reuse
the expected share of a token’s experts that one of the tokens before it also selected. At it is the next-token reuse measured by Zhang et al. (2026). Each token therefore adds new experts on average. By linearity of expectation, for every stationary process,
Under independent uniform routing with (Huang et al., 2025).
Bytes. Let be the bytes of one expert of layer , , and the bytes read once per pass whatever the routing. A trace is the recorded expert sets of one token sequence. On every trace, a deduplicating kernel requests expert bytes for a pass of tokens. A per-slot kernel requests , one request per slot. In expectation, the union bytes are , and . So a per-slot kernel requests
more bytes. These are the bytes that reuse would save. They are requested bytes, and on-chip caches can serve some requests.
Speculative decoding. A step drafts tokens, with the largest draft length allowed. It verifies them with the current token in one pass of tokens. The case is plain decoding. With kernel the step requests bytes, with the key-value cache bytes it reads (Pope et al., 2023). Under geometric acceptance at rate the drafts are accepted in order, each with probability , until the first rejection. A step then emits tokens on average (Leviathan et al., 2023). We generalize the walltime analysis of Leviathan et al. (2023). The throughput is tokens per second. Here is the step time, the wall-clock time of one step that drafts tokens and verifies (Section 3.1 gives its form). The best draft length is the smallest maximizer of . So the staircase is . Speculation gives a speedup at when . The -th step point is the infimum of the acceptances at which . It is taken as 1 when there is none. Finally, is the time that the -th draft adds. Appendix A lists every symbol.

Figure 1: Consecutive-token reuse , layer mean, on the WikiText-103 fit documents, against the number of consecutive tokens. Dotted: independent uniform routing, (Huang et al., 2025). In every figure, color marks the model: blue OLMoE, green Qwen3, orange gpt-oss and brown DeepSeek-V2-Lite.
Expert reuse. We record the experts each token selects on the 60 articles of the WikiText-103 test set (Merity et al., 2017). A hash of the document identifier selects 32 of them for fitting. On these, is the estimate of in (1), and Appendix D gives the estimator. Its layer mean is 0.363, 0.480 and 0.492 for OLMoE, Qwen3 and gpt-oss. Uniform routing gives , 0.0625 and 0.125. At n = 9 the layer mean is 0.762, 0.780 and 0.856 (Figure 1). Yet on the short passes of speculation (up to 8 tokens), llama.cpp Metal, MLX-LM and llama.cpp CUDA multiply each token's experts separately (Appendix D.1). So each draft adds the full expert bytes of one more token. With a real draft model on llama.cpp Metal, plain decoding is fastest on 33 of 37 held-out MT-Bench prompts (Zheng et al., 2023) (Appendix D.3).
Effective bandwidth. We write for the effective bandwidth of kernel on a pass of tokens: its requested expert bytes over its time. We measure it in a separate benchmark of the expert operation of one MoE layer. The benchmark runs each engine's own kernels, with no other part of the model. It takes the expert ids of each pass as input, and we give it two kinds of ids. In the first kind, we choose the ids ourselves. For each pass size , we set how many distinct experts the slots of the pass name. The range goes from heavy repetition to none. This lets a fit separate the time of the first read of an expert in a pass from the time of a repeated read. In the second kind, each pass copies its ids from a window of consecutive tokens of recorded routing, here the WikiText-103 traces. So the kernel sees the routing that the model produces. We write for the bandwidth ratio. We write for the share of the per-slot bytes that deduplication requests. A kernel whose repeated reads hit an on-chip cache has a higher effective bandwidth than one that reads every requested byte from memory. The per-slot kernel moves its requested bytes at a higher effective bandwidth than the deduplicating kernel moves its distinct ones (Figure 2). This holds on every engine and model
OLMoE Qwen3 gpt-oss DeepSeek-V2-Lite per-slot, on nmb deduplicating, on Ub

Figure 2: Effective bandwidth of each kernel on the expert operation alone. Per-slot kernel: on requested bytes nmb (solid line, filled markers). Deduplicating kernel: on union bytes Ub (dashed line, open markers). Median and interquartile range over all MoE layers and windows of recorded routing; color: model; dotted: nominal DRAM bandwidth. CUDA was measured on OLMoE, gpt-oss and DeepSeek-V2-Lite, and MLX-LM on OLMoE.
measured, at every n from 2 to 8. The ratio is 0.37 to 0.75 at n = 2 and 0.32 to 0.59 at n = 8. It is lower at n = 8 than at n = 2 in all eight engine and model pairs (Table 1). On the passes with chosen ids, U of the nm slots are the first read of their expert in the pass, and nm - U repeat one. We fit the time of the per-slot kernel as
where is the median time, over repetitions, of the expert operation of one layer with the per-slot kernel. Here is the part of that time that does not grow with the bytes, such as kernel launches. The bytes of one expert of the timed layer l are . The constant is the time per byte of a first read, and is the time per byte of a repeated slot. We fit the constants , and per layer by least squares, over the passes with chosen ids at . The re-read cost is 1 when a repeated slot is read again from memory and near 0 when an on-chip cache serves it. On CUDA and MLX-LM, caching explains part of the gap. The re-read cost is 0.18 to 0.34 on CUDA and 0.27 to 0.40 on MLX-LM (Table 1). On CUDA, the median per-slot bandwidth also exceeds the DRAM bandwidth of the card, 672 GB/s, from (Figure 2). On llama.cpp Metal the re-read cost is 0.88 to 1.04, so caching does not explain the gap there. There the gap lies in the deduplicating kernel. At it moves 65 to 147 GB/s, against 131 to 250 GB/s for the per-slot kernel.
Bytes against bandwidth. A deduplicating engine requests the share of the per-slot bytes, at the lower bandwidth. So, with equal fixed work, it is faster exactly where (7). On the four models, is 0.72 to 0.83 (Table 1), above in every engine and model pair. So at two tokens the deduplicating kernel is slower everywhere. The bytes that reuse saves become time saved only from a pass size that the bandwidth ratio sets (Section 4.2). Predicting the speedup needs both inputs: the bytes, which routing fixes, and the bandwidth of each kernel, which the kernels fix.
Table 1: Effective bandwidth of each kernel in GB/s, over all MoE layers and windows of recorded routing, including the fixed work of the operation. The values of and come from bytes and times summed over layers and windows. Re-read cost: of (4), as a range over two layers (: no fit on chosen ids). The deduplicating kernel is faster where (7).
| engine | model | re-read cost | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| lama.cpp CUDA | OLMoE | 0.18-0.22 | 618 | 464 | 0.75 | 0.82 | 933 | 546 | 0.58 | 0.50 |
| lama.cpp CUDA | gpt-oss | 0.34 | 654 | 346 | 0.53 | 0.72 | 1018 | 434 | 0.43 | 0.36 |
| lama.cpp CUDA | DeepSeek-V2-Lite | – | 523 | 355 | 0.68 | 0.83 | 814 | 480 | 0.59 | 0.62 |
| lama.cpp Metal | OLMoE | 0.88-0.90 | 250 | 147 | 0.59 | 0.82 | 428 | 219 | 0.51 | 0.50 |
| lama.cpp Metal | Qwen3 | 0.92-0.98 | 131 | 65 | 0.50 | 0.77 | 280 | 98 | 0.35 | 0.43 |
| lama.cpp Metal | gpt-oss | 0.98-1.04 | 213 | 79 | 0.37 | 0.72 | 339 | 114 | 0.34 | 0.36 |
| lama.cpp Metal | DeepSeek-V2-Lite | – | 196 | 91 | 0.47 | 0.82 | 350 | 148 | 0.42 | 0.62 |
| MLX-LM | OLMoE | 0.27-0.40 | 129 | 75 | 0.58 | 0.82 | 358 | 116 | 0.32 | 0.50 |
Testing the inputs. A bandwidth is bytes over time. So a wrong byte count would be absorbed into a bandwidth fitted on the same passes. For that reason, this paper uses no timing as evidence for a byte count. The fit (4) only locates the source of the higher bandwidth of the per-slot kernel. The bytes come from the routing and from the source code of the kernels. On CUDA, a hardware counter reads the DRAM bytes that each kernel moves, with no timing involved, and confirms them (Section 4.1). The Apple engines expose no such counter, so there the bytes rest on the source reading. The bandwidths come from the benchmark of the expert operation alone. Their stated error is a bound on the relative error of a measured bandwidth, and it comes from a split inside the benchmark. We make the linear fits of operation time to bytes on the passes with chosen ids. These fits are (4) for the per-slot kernel and its counterpart for the deduplicating kernel (Appendix E). We then score them on the windows of recorded routing, which the fits do not see. The test of the two inputs together is prediction. Bytes from routing over bandwidths from the benchmark give whole-model verify times , the time of one verification pass. They also give savings, best draft lengths and crossovers. A crossover is the smallest pass size from which the deduplicating kernel is faster. For a measurement, it is the smallest pass size from which the point estimate of the measured saving stays positive. We compare these predictions with whole-model runs that neither input used (Sections 4 and 4.4).
3 Theory
Section 3.1 writes the time of a step from the bytes each kernel requests and its effective bandwidth. Sections 3.2 and 3.3 state, in that step time, when a draft length is faster than plain decoding. They also state how the best draft length moves with acceptance. Section 3.4 specializes to a deduplicating engine. Section 3.5 bounds how a bandwidth error moves each prediction. Byte counts assume that the verified tokens are routed like consecutive tokens of a stationary process. Generated text that repeats its own earlier phrases violates this assumption (Section 4.1). Appendix B gives the proofs, with the Lean theorems that check them.
3.1 Step time
The verify time of a pass of n tokens on kernel p is
where is time outside the memory reads and counts the bytes read once per pass at the dense bandwidth . The kernel requests the expert bytes : for the per-slot kernel, and times a byte factor for the deduplicating kernel. The factor is the bytes that the deduplicating kernel reads per distinct expert of layer , over . Finally, is fixed work, such as launches. The fit (4) describes the expert part of (5) for one layer of the per-slot kernel. Summed over layers, is , and is that layer's share of . The terms and lie outside the expert operation and have no counterpart in (4). The bandwidths of Table 1 divide the bytes by the whole operation time, so they include . The predictions of Section 4 use those operation times directly. So the split between and does not enter them. A one-token pass runs the same kernel either way. So , and carry no kernel index. The step time is , with the time per step of the draft model and the host. Any measured time has some . So (5) says something only through where the bandwidth comes from (Section 2).
Take and equal fixed work. Then and the dense reads cancel in the saving . Because , the saving is
unequal fixed work subtracts . The deduplicating kernel is faster exactly when
The scale is the expert time of the per-slot kernel. One bandwidth for both kernels, , makes the deduplicating kernel faster at every .
3.2 Speedup condition
Take the step time and throughput of Section 1. A draft of length adds the time . It has higher throughput than plain decoding exactly when this time is less than the expected number of accepted drafts times the time of a plain step,
which with reads (Eq. (B.2)). The speedup is
At the condition reads . So is the acceptance above which one draft is faster than none. The condition holds for any positive step time and assumes no common bandwidth. By (5), carries the bandwidth of a pass of tokens. Likewise, carries the bandwidth of a one-token pass. Each bandwidth is measured at its own pass size.
3.3 Staircase
The best draft length never decreases as acceptance rises, . This holds because is non-decreasing in for . The result does not assume a single peak of in , so the staircase can jump by more than one length. Each step point is exact: , with the least acceptance above which draft length has higher throughput than (Eqs. (B.26) to (B.31)). If the step time is also convex and non-decreasing in ( ), then and alone decide whether reaches ,
and (Eqs. (B.35) and (B.36)). The algebra of this subsection and the previous one uses only . So these results hold for any positive step time, and the Lean statements are proved in that generality.
3.4 Deduplicating engines
The byte-weighted mean reuse of the k drafted tokens is
and by (2) the expert bytes of a pass of tokens on a deduplicating kernel are
a count that involves the routing alone. Take a deduplicating engine with and . Write , and . By (5), a draft of length adds the time
and by (8) it is faster than plain decoding exactly when , with
(Eq. (B.14)). The threshold falls as a grows, since rises with and , (Eq. (B.19)). The bracket is the time that a draft may add outside the expert reads. The bandwidth converts this time into union bytes. The last term asks for more reuse when the deduplicating kernel runs slower on tokens than on one. Substituting (13) into the speedup (9) gives
with the bytes fixed by the routing traces before any deduplicating kernel runs, and the bandwidths and measured. With one bandwidth for every byte and , (14) reduces to the byte form
Table 2: Error bounds for a relative bandwidth error (first three rows) or a relative step-time error (last two).
| prediction | bound |
|---|---|
| verify time | |
| saving | |
| faster kernel | sides of (7) agree if |
| best draft length | : at most of the throughput lost;$\hat{k}^{*}=k^{*}\ \mathrm{if}\ \frac{1+\delta}{1-\delta} T_{a}(i) |
| best speedup |
with the bytes of a plain step (Eq. (B.16)). This is the threshold that a pure byte count would give. When , the threshold (14) also falls as grows, provided the bandwidths and the fixed work do not change with (Eq. (B.19)). More reuse lowers every . So a speedup persists under any routing with at least as much reuse. This holds provided that the bandwidth and the fixed work of the deduplicating kernel at fixed do not depend on which experts repeat. Under the same proviso, routing enters only through . Also, no single rule “” decides for every routing (Appendix B.2).
3.5 Error bounds
Let for each bandwidth in (5), with and the other terms exact. Here is the bandwidth error of Section 2. Write for the memory part of and for its expert part. A hat marks a quantity computed from the estimated bandwidths: , and , the draft length that maximizes . For the best draft length and the best speedup, bounds the relative error of the full predicted step time, . With bandwidth errors alone, . Then a bandwidth error moves the predicted speedup by at most . Table 2 states the five bounds, each proved in Lean (Appendix C). Relative to the saving, the saving bound (18) is times the sum of two expert times over their difference. This factor grows without limit near the crossover. A verify time carries the factor , and a common factor on every leaves . So the saving is the prediction most sensitive to a bandwidth error, and the best draft length is the least sensitive.
4 Experiments
Each engine gets one switch that sends small verification passes to its existing deduplicating expert kernel. With deduplication off, the engine keeps its default kernel choice: the per-slot kernel at , or at on CUDA, which runs the deduplicating kernel at . With deduplication on, it runs the deduplicating kernel from (Appendix E, Table 6). Appendix E gives the change to each engine and the check that both settings produce the same output.
Each configuration has a context depth , the number of prompt tokens before decoding starts. OLMoE, Qwen3 and gpt-oss give twelve configurations. In each configuration we measure two quantities on the same six prompts. These prompts are articles of the WikiText-103 validation set truncated to tokens, disjoint from the test-set documents that give the routing traces. The first quantity is the verify time with deduplication off and on at . The second is the throughput of speculative decoding at draft lengths and 11 acceptance values from 0.2 to 0.98. It uses the oracle draft, which proposes the target's own greedy token and corrupts each draft with probability . So acceptance is geometric at rate (Appendix D). The prediction computes the time of each layer's expert operation from its bytes. We made the fit (4) and its deduplicating counterpart on the passes with chosen ids of Section 2. We then evaluated each fit at the union bytes of every window of recorded routing from the WikiText-103 traces. So the prediction uses nothing from the whole-model runs. Then (22) below sums the layers into a whole-model verify time. Table 3 also gives the prediction with the recorded routing of the text those runs verified. The same sum with measured operation times is the measured-time version. It skips the fit and uses each layer's measured median operation time on each window of recorded routing. It serves where a model has no fit. The gap between the measured-time version and the prediction is the fits' error on recorded routing, which bounds. On OLMoE, Qwen3 and gpt-oss, the prediction and the measured-time version were computed after the whole-model data existed. As first computed, the prediction took the one-token time from the deduplicating kernel's fit. It then placed the crossover wrongly in ten of twelve configurations. We corrected it to the per-slot fit, because the engine runs the per-slot kernel at with deduplication off and on. This was the only change made after a comparison with the measurements. DeepSeek-V2-Lite had no such fit. On it, we wrote down the measured-time version and its scoring rules, the tolerances it had to meet, before any whole-model speculative run (Section 4.4).
The prediction and the measured-time version both take the whole-model verify time from the expert operation,
where is the measured whole-model time of a one-token pass. The term is layer 's operation time with kernel , averaged over the windows of recorded routing. On the Apple engines, is extrapolated. On OLMoE, Qwen3 and gpt-oss, the measured-time version uses the recorded routing of the text the whole-model runs verified. The term is the same layer's one-token time, which the per-slot kernel runs with deduplication off and on. The predicted expert time is . The saving, the crossover, the best draft length and the speedup follow, with and measured. The calibrated version is the measured-time version with one change. It takes the growth with of the time outside the expert operation from the measured verify time with deduplication off. Besides caching and tokens per expert, fixed work separates the two kernels. With deduplication on, CUDA makes 160 kernel launches per OLMoE pass against 64, a difference of about 0.1 ms.
We compute the bandwidth error from the fits of Section 2. Here is the median, over layers and models, of each fit's median relative error on the windows of recorded routing from the WikiText-103 traces. The engine's is the larger of its two kernels' values: 0.054 on llama.cpp CUDA, 0.031 on llama.cpp Metal and 0.148 on MLX-LM. The measurement takes under an hour per model. For DeepSeek-V2-Lite it took 22 minutes on CUDA and 48 on Metal, against 3.8 and about 8 hours of whole-model speculative runs.
4.1 Bytes
We profiled the CUDA expert kernels with Nsight Compute (NVIDIA Corporation, 2026) on passes with chosen ids at , on one layer of OLMoE and gpt-oss. In all 70 profiles, the deduplicating kernel reads the union bytes from DRAM within 0.2 to 2.5%. The per-slot kernel

Figure 3: Bytes. Left: DRAM bytes read by the CUDA expert kernels over the union bytes Ub, against nm/U (Nsight Compute, chosen ids, one layer of OLMoE and gpt-oss). Filled: per-slot kernel; open: deduplicating kernel; color: model. The deduplicating kernel reads Ub (horizontal line). The per-slot kernel reads between Ub and its requested nmb (dotted). Right: the share of a pass's nm slots that name distinct experts, , at n = 2, 4, 6, 8. It is shown on the windows the whole-model runs verified, against WikiText-103 windows of the same model. Both axes lie between 1/n (every token repeats the first token's experts) and 1 (no expert repeats). A point above the dotted line means the verified text repeated experts less often than WikiText-103. Color: model; shape: the engine of the runs (circle: llama.cpp CUDA, triangle: llama.cpp Metal). The labeled gpt-oss points at d = 4096 below the line are its repeating continuations.
requests nmb and reads between Ub and 2.35Ub (Figure 3). Here the L2 cache serves part of the repeated slots, an effect that belongs to the per-slot kernel's effective bandwidth. The union is as good as the routing it is given. On the windows the whole-model runs verified, the share of distinct slots agrees with that of WikiText-103 windows within 0.06. This holds at every n on every model except gpt-oss at d = 4096. There the greedy continuations repeat, and the share lies 0.08 to 0.16 below: 81% of their 4-grams recur, against 48% at d = 512.
4.2 Saving and crossover
The prediction’s largest saving error is 0.23 to 0.52 ms on CUDA and 0.43 to 3.7 ms on the Apple engines (Table 3). The exception is Metal gpt-oss at , with 9.7 ms, whose verified text repeats and routes unlike WikiText-103 (Figure 3). Its crossover is within one of the measured one in 10 of 12 configurations. It equals the measured crossover in all six other Apple configurations and is one pass size early in three of the four CUDA configurations. It misses both Metal gpt-oss configurations. With the recorded routing of the verified text, the saving error is 0.25 to 0.51 ms on CUDA and 0.42 to 3.8 ms on the Apple engines. The crossover is then within one in 11 of 12 configurations. The measured-time version gives saving errors of 0.17 to 0.20 ms on CUDA and 0.8 to 3.9 ms on the Apple engines. Its crossover is within one in 11 of 12 configurations and equal in all four CUDA configurations. The remaining miss is Metal gpt-oss at . Its measured saving at is +0.2 ms, with an interval containing 0, and there the margin of (19) fails.
Figure 4 shows the saving itself at every n. The saving is the difference of two expert times of 2.8 to 40.0 ms each. So the saving bound (18) amplifies a bandwidth error 3.2 to 3.8 times on MLX-LM, 6 to 220 times on CUDA and 3.2 to 340 times on Metal. The amplification is largest at the crossover (Appendix E, Table 7). With each engine's , the measured saving lies inside the band
Table 3: The prediction with WikiText-103 routing (wiki) and with the routing of the verified text (text), and the measured-time version (op. time). All three are compared with the same measurements, one row per configuration. Saving error: largest over ( on CUDA), in ms. Crossover as defined in Section 2 (meas.: measured; -: none). : acceptance values, of 11, at which the predicted best draft length is within one of the measured one. Metal and CUDA are llama.cpp.
| engine | model | d | saving error (ms) | crossover | within one | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki | text | op. time | meas. | wiki | text | op. time | wiki | text | op. time | |||
| Metal | OLMoE | 512 | 0.43 | 0.42 | 0.77 | 7 | 7 | 7 | 8 | 9 | 9 | 9 |
| Metal | OLMoE | 4096 | 0.98 | 0.91 | 2.28 | 7 | 7 | 7 | 8 | 8 | 8 | 8 |
| Metal | Qwen3 | 512 | 1.51 | 0.92 | 2.24 | - | - | - | - | 7 | 8 | 7 |
| Metal | Qwen3 | 4096 | 3.70 | 1.83 | 1.25 | - | - | - | - | 8 | 8 | 8 |
| Metal | gpt-oss | 512 | 2.23 | 3.77 | 3.89 | 8 | - | - | - | 10 | 9 | 10 |
| Metal | gpt-oss | 4096 | 9.72 | 3.46 | 3.89 | 6 | - | 7 | 7 | 10 | 9 | 10 |
| MLX-LM | OLMoE | 512 | 2.60 | 2.86 | 3.29 | - | - | - | - | 8 | 7 | 8 |
| MLX-LM | OLMoE | 4096 | 2.51 | 2.64 | 2.37 | - | - | - | - | 7 | 7 | 9 |
| CUDA | OLMoE | 512 | 0.23 | 0.25 | 0.20 | 5 | 4 | 4 | 5 | 11 | 11 | 11 |
| CUDA | OLMoE | 4096 | 0.26 | 0.26 | 0.17 | 5 | 4 | 4 | 5 | 11 | 11 | 11 |
| CUDA | gpt-oss | 512 | 0.35 | 0.49 | 0.18 | 6 | 5 | 5 | 6 | 10 | 10 | 11 |
| CUDA | gpt-oss | 4096 | 0.52 | 0.51 | 0.19 | 5 | 5 | 4 | 5 | 10 | 11 | 11 |
around the prediction at all 28 CUDA points, all 16 MLX-LM points and 36 of 48 Metal points. Consider the bandwidth error at which the band just covers a configuration's largest saving error. It is 0.022 to 0.033 on CUDA and 0.107 to 0.108 on MLX-LM, below the engines' . On Metal it is 0.014 to 0.126. That is above Metal's 0.031 in three of six configurations, and most above it on gpt-oss at . At , an Apple engine runs the same kernel with deduplication off and on. There the engine with deduplication on measures slower in 6 of 8 configurations. So part of every Apple saving is a run-to-run offset.
4.3 Best draft length and speedup
On CUDA, the predicted is within one of the measured best at 10 or 11 of 11 acceptance values in every configuration. The measured-time version places it within one at all 11 (Table 3). Drafting the measured-time version's loses at most 1.6 to of the best measured throughput. On the Apple engines both place within one at 7 to 10 of 11 values. An error common to every step time leaves unchanged (Section 3.5). On the Apple engines, an error that grows with moves it. Neither the prediction nor the measured-time version contains the growth with of attention and the dense parts. This growth cancels in the saving and stays in the verify time. With deduplication on, the prediction's verify time is within 3 to on CUDA, 6 to on Metal and 38 to on MLX-LM. The measured-time version's is within 4 to on CUDA and 15 to on the Apple engines. The calibrated version's is within 1 to in 8 of 12 configurations (Appendix E, Table 7).
We set of (20) to the largest relative error of each configuration's step time, under the measured-time version and under the calibrated version. This gives 24 pairs of a configuration and a version, plus 6 DeepSeek-V2-Lite pairs. At all 330 acceptance values of these pairs, the throughput lost lies inside its bound (20) and the best speedup inside its bound (21) (Figure 5). Measured speculative runs on CUDA differ from the speedup computed from verify times by a saving bound, per engine measured , 95% interval measured-time version prediction
llama.cpp Metal OLMoE, d = 512 llama.cpp Metal OLMoE, d = 4096 llama.cpp Metal Qwen3, d = 512 llama.cpp Metal Qwen3, d = 4096

llama.cpp Metal gpt-oss, d = 512 llama.cpp Metal gpt-oss, d = 4096
MLX-LM OLMoE, d = 512
MLX-LM OLMoE, d = 4096
llama.cpp CUDA OLMoE, d = 512 llama.cpp CUDA OLMoE, d = 4096 llama.cpp CUDA gpt-oss, d = 512 llama.cpp CUDA gpt-oss, d = 4096

tokens per pass n
tokens per pass n

tokens per pass n

tokens per pass n
Figure 4: Saving . Black and grey: measured on the six validation prompts, with its 95% bootstrap interval. Red: the prediction, dotted to an open circle where n = 9 is extrapolated. Shaded red: the band of the saving bound (18) for the engine's . Grey dashed: the measured-time version. The number in each panel counts the measured points inside the band. Positive: the deduplicating kernel is faster. CUDA is shown to n = 8, since it runs the deduplicating kernel at n = 9 with deduplication off and on.
median factor of 0.93 to 1.04 per configuration. Part of the reason is that the oracle draft emits 2 to 5% fewer tokens per step than (Appendix E).
4.4 DeepSeek-V2-Lite
We use DeepSeek-V2-Lite-Chat in the 4-bit llama.cpp format Q4_K_M (DeepSeek-AI, 2024). It has 64 routed experts (6 per token), two shared experts that every token uses, multi-head latent attention and a dense first layer. The other three models have none of these. On llama.cpp CUDA and Metal, the measured-time version follows from (22). Its inputs are runs of the expert operation of all 26 MoE layers on WikiText-103 windows, and three whole-model numbers at k = 0. We wrote the measured-time version, six scoring rules and the scoring script before the first speculative run on each engine. The script then scored the runs unchanged.
On CUDA, the deduplicating kernel is predicted and measured slower at every n from 2 to 8. The saving lies inside its band at all 14 points, and the best draft length is within one at all 22 acceptance values. The verify time is within 10.1% (Table 4). On Metal, the sign of the saving is right at every n, but the verify time is predicted up to 34% too low. The reason is the growth with n of attention, the shared experts and the dense layer. This growth is large on this model and lies outside the expert operation. The error grows with n, so drafting loses up to 22.5% of the best throughput. The calibrated version was written down beforehand as a second prediction.
OLMoE
Qwen3
gpt-oss
DeepSeek-V2-Lite
llama.cpp CUDA
llama.cpp Metal
MLX-LM
measured-time version
calibrated version


Figure 5: Best draft length and the bounds (20) and (21). Each configuration has one point under the measured-time version (filled) and one under the calibrated version (open), with as in Section 4.3. Color: model; shape: engine (circle: llama.cpp CUDA, triangle: llama.cpp Metal, square: MLX-LM). Left: predicted against measured , measured-time version; area grows with the number of acceptance values; dotted: exact prediction; shaded: within one. Middle: largest share of throughput lost by drafting , against its bound (20). Right: largest relative error of the predicted best speedup, against its bound (21). In the middle and right panels the solid line is where the error equals its bound. The theory requires every point to lie in the shaded region on or below it, and every point does.
Table 4: DeepSeek-V2-Lite-Chat: the measured-time version and the calibrated version, written before its speculative runs. Crossover: predicted / measured (-: none), over on CUDA. Sign: values of with the measured sign of , of those whose interval excludes 0. Saving error in ms. : acceptance values, of 11, with within one of the measured best. Loss: largest share of the best throughput lost at . error: largest relative error of the predicted verify time, over both kernels and . as in Section 4.3. The best speedup lies inside its bound (21) in every row.
| engine | version | d | crossover | sign | saving error | k* within 1 | loss | τ error / δ |
|---|---|---|---|---|---|---|---|---|
| llama.cpp CUDA | measured-time | 512 | - / - | 7 of 7 | 0.23 | 11 | 2.9% | 9.9% / 0.072 |
| measured-time | 4096 | - / - | 7 of 7 | 0.28 | 11 | 4.1% | 10.1% / 0.077 | |
| llama.cpp Metal | measured-time | 512 | - / - | 8 of 8 | 1.6 | 9 | 20.1% | 34.0% / 0.27 |
| measured-time | 4096 | - / - | 8 of 8 | 4.4 | 6 | 22.5% | 28.4% / 0.25 | |
| calibrated | 512 | - / - | 8 of 8 | 1.5 | 11 | 6.4% | 4.3% / 0.036 | |
| calibrated | 4096 | - / - | 8 of 8 | 4.4 | 9 | 8.3% | 10.5% / 0.098 |
It brings the verify time within and , and the best draft length within one at 20 of 22 values. The Metal saving requires a bandwidth error of up to 0.075, 2.4 times Metal's of 0.031. Of the six scoring rules (Appendix E, Table 8), the CUDA measured-time version meets all six at both depths. The Metal measured-time version meets the crossover, sign and speedup rules. It fails the rules on the best draft length, the throughput lost and the verify time. On CUDA, the measured throughput speedup lies 1 to below the predicted one. This is the gap of the oracle draft (Section 4.3), which (21) does not cover.
The prediction needs fits on chosen ids. We ran them on DeepSeek-V2-Lite afterwards, on layers 1 and 13, with the protocol of the other models. We then applied the chain unchanged to saving bound, per engine measured , 95% interval measured-time version prediction

Figure 6: Saving on DeepSeek-V2-Lite, as in Figure 4. Black and grey: measured, with its 95% interval. Red: the prediction from fits run after the whole-model runs, with the band of the saving bound (18) for the engine's . Grey dashed: the measured-time version, written before its speculative runs. The number in each panel counts the measured points inside the band.
the same WikiText-103 windows. The whole-model results were known by then, and we adjusted nothing in the chain. The fits' errors on recorded routing are 0.021 to 0.049 on Metal and 0.027 to 0.129 on CUDA. On Metal, the prediction matches or improves on the measured-time version at both depths. Its saving error is 1.1 and 3.7 ms, against 1.6 and 4.4. No crossover is predicted or measured. Both place the best draft length within one at 9 and 6 of 11 values. The prediction's verify time is within 31.6% and 26.4%, against 34.0% and 28.4%, over both kernels and as in Table 4. On CUDA, the prediction keeps the verify time within 8.0% and 8.3%, and the best draft length within one at all 22 values. But the per-slot fit predicts the windows of recorded routing 5 to 13% slower than they run. That adds about 0.9 ms of per-slot time at , against a measured saving of about -0.5 ms. So the prediction places a crossover at where none is measured. Its saving errors are 0.95 and 1.1 ms, against 0.23 and 0.28 ms for the measured-time version (Figure 6). With the engines' from Section 4, the measured saving lies inside the band around the prediction at 13 of 14 CUDA points and 11 of 16 Metal points.
5 Limits
The theory assumes geometric acceptance, verified tokens routed like consecutive tokens of a stationary process, and no cost for the draft model. The theory does not predict the bandwidth of any kernel. We measure each kernel's bandwidth on each model's expert shapes. Bandwidth fitted on the other models of an engine misses a held-out model by 9 to 206% (Appendix E). The prediction on OLMoE, Qwen3 and gpt-oss was computed after their whole-model data existed. On DeepSeek-V2-Lite, the prediction used fits run after the whole-model runs. Only the measured-time and calibrated versions on DeepSeek-V2-Lite were written before its speculative runs. On OLMoE, Qwen3 and gpt-oss, the measured-time version uses the recorded routing of the verified continuations, which approximates that of verify windows containing drafts. On Metal, the times of the expert operation alone miss part of each kernel's growth inside the whole model. The sign of this miss depends on the model. From n = 7, the per-slot kernel exceeds its growth on the expert operation alone on gpt-oss and OLMoE. On DeepSeek-V2-Lite the deduplicating kernel does, by
1.1 to 4.4 ms. The Metal runs of DeepSeek-V2-Lite at show a recurring slow GPU state with no thermal warning logged. The scoring rules include these runs. The measurements use one machine per platform, at batch one, with four models of 7B to 30B total parameters. DRAM byte counts exist only on CUDA.
6 Conclusion
A speedup is a ratio of step times, and a step's time is its bytes over the effective bandwidth of the kernel that reads them. In that step time, the theory states exactly when speculation is faster, at which draft length and by how much. These results are proved in Lean. On a deduplicating engine the bytes follow from routing, and the CUDA deduplicating kernel reads them within 2.5%. The per-slot kernel has the higher effective bandwidth on every engine and model measured. So the deduplicating kernel is faster only where . Its saving is the per-slot expert time times (6). The bandwidth's error carries through the proved bounds as stated on CUDA and MLX-LM. It moves the best draft length and the speedup little on CUDA, and the saving amplifies it. On DeepSeek-V2-Lite, operation times measured before any of its speculative runs give the CUDA best draft length within one at every acceptance value. The prediction from fits run afterwards misses its CUDA crossover.
The results change how a cost model for MoE speculation should charge expert reads. Models with one bandwidth for every byte, such as S2-MoE (Huang et al., 2026) and SpecFit (Cao et al., 2026), imply that deduplication with equal fixed work is faster wherever . That is every pass size with reuse. On every engine and model that we measured, the deduplicating kernel is slower at two tokens (Section 2). A cost model must therefore compare the byte share with the bandwidth ratio . The bytes alone do not decide the sign of the saving.
For engine developers, the switch between the two kernels can follow from measurement. Engines currently tune it by hand (pratiknarola-t, 2026). Routing traces give , and the benchmark of the expert operation gives in under an hour per model. Together with the fixed work, they give the predicted crossover, and the deduplicating kernel should run from there. The ratio is also the lever for kernel work. With equal fixed work, a deduplicating kernel at is faster at every pass size with reuse. A higher bandwidth at small n can move the crossover to fewer tokens.
Four extensions follow from the limits above. First, the bandwidth needs a model from kernel structure, since a bandwidth fitted on other models misses a held-out model. Second, a real draft model and acceptance that is not geometric would test the staircase under the conditions of deployment. Third, batches larger than one change both the routing union and the kernels' bandwidths. Fourth, hardware with lower bandwidth or weaker compute, such as edge devices, would test whether the step time stays limited by memory reads.
Code and data availability
The modified engines, the benchmark of the expert operation, the chosen ids, the routing traces, the timing files and the Lean formalization are available from the author on request.
Use of AI
AI agents directed by the author produced the code that ran the experiments, generated the figures and tables and consolidated the statistics. They also produced the Lean formalization, the initial literature review and the initial draft of the manuscript. The author chose the research direction, designed the experiments, reviewed the results and findings, and is responsible for the paper.
References
Apple Inc. (2024). MacBook Pro (14-inch, 2024) technical specifications. https://support.apple.com. Memory bandwidth of the M4 Max with 40-core GPU: 546 GB/s.
Cao, H., Li, X., Wang, S., Wang, Z., Zhu, J., & Yang, H. (2026). SpecFit: Not all draft tokens cost the same in offloaded MoE inference. arXiv preprint arXiv:2610.15417.
Chen, C., Borgeaud, S., Irving, G., Lespiau, J.-B., Sifre, L., & Jumper, J. (2023). Accelerating large language model decoding with speculative sampling. arXiv preprint arXiv:2302.01318.
Chordiya, P. (2026). Lossless but not free: An empirical anatomy of speculative decoding on consumer hardware. arXiv preprint arXiv:2607.17283.
de Moura, L. & Ullrich, S. (2021). The Lean 4 theorem prover and programming language. In Automated Deduction – CADE 28, volume 12699 of Lecture Notes in Computer Science, pages 625–635. Springer.
DeepSeek-AI (2024). DeepSeek-V2: A strong, economical, and efficient mixture-of-experts language model. arXiv preprint arXiv:2405.04434.
Fedus, W., Zoph, B., & Shazeer, N. (2022). Switch Transformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research, 23(120):1–39.
Gerganov, G. & llama.cpp contributors (2026). llama.cpp. https://github.com/ggml-org/llama.cpp. Release b11617.
Gong, Y., Budhathoki, K., Kim, T., Li, H., & Khetan, A. (2026). MonoMoE: An efficient fused mega-kernel for quantized MoE decoding. arXiv preprint arXiv:2609.04244.
Haddad, F. (2026). [Performance] gather_qmm at M=1 streams 4-bit expert weights at about half the bandwidth of M=4 (MoE decode). https://github.com/ml-explore/mlx/issues/4509. MLX issue 4509; not peer reviewed.
Huang, H., Qiu, S., & Li, M. (2026). S2-MoE: Enabling efficient self-speculative decoding for mixture-of-experts on edge devices. arXiv preprint arXiv:2608.15018.
Huang, Z., Zhu, L., Zhan, Z., Hu, T., Mao, W., Yu, X., et al. (2025). MoESD: Unveil speculative decoding's potential for accelerating sparse MoE. arXiv preprint arXiv:2505.19645.
Leviathan, Y., Kalman, M., & Matias, Y. (2023). Fast inference from Transformers via speculative decoding. In Proceedings of the 40th International Conference on Machine Learning (ICML), volume 202 of Proceedings of Machine Learning Research, pages 19274–19286.
Li, S., Lin, J., Ge, D., & Ye, Y. (2026). MoE-SpAc: Efficient MoE inference based on speculative activation utility in heterogeneous edge scenarios. arXiv preprint arXiv:2603.09983.
Merity, S., Xiong, C., Bradbury, J., & Socher, R. (2017). Pointer sentinel mixture models. In International Conference on Learning Representations (ICLR).
Muennighoff, N., Soldaini, L., Groeneveld, D., Lo, K., Morrison, J., Min, S., et al. (2025). OLMoE: Open mixture-of-experts language models. In International Conference on Learning Representations (ICLR).
NVIDIA Corporation (2026). Nsight Compute. https://developer.nvidia.com/nsight-compute.
Oncescu, C.-A., Wu, Q., Chung, W. T., Wu, R., Gopal, B., Wang, J., et al. (2025). Opportunistic expert activation: Batch-aware expert routing for faster decode without retraining. arXiv preprint arXiv:2511.02237.
OpenAI (2025). gpt-oss-120b and gpt-oss-20b model card. arXiv preprint arXiv:2508.10925.
Pope, R., Douglas, S., Chowdhery, A., Devlin, J., Bradbury, J., Levskaya, A., Heek, J., Xiao, K., Agrawal, S., & Dean, J. (2023). Efficiently scaling Transformer inference. In Proceedings of Machine Learning and Systems (MLSys), volume 5.
pratiknarola-t (2026). metal : few-row MMA kernels for MUL_MAT_ID and more src0 types. https://github.com/ggml-org/llama.cpp/pull/30047. llama.cpp pull request 30047, open as of October 2026; not peer reviewed.
Saxena, A., Tsai, P.-A., Taneja, H., Jaleel, A., & Qureshi, M. (2025). Utility-driven speculative decoding for mixture-of-experts. arXiv preprint arXiv:2506.20675.
Shazeer, N., Mirhoseini, A., Maziarz, K., Davis, A., Le, Q., Hinton, G., & Dean, J. (2017). Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In International Conference on Learning Representations (ICLR).
Suram, S. R. (2026). Cacheable by design? Training mixture-of-experts routers for locality against the edge memory-bandwidth wall: A pre-registered negative result with a systems measurement study. arXiv preprint arXiv:2608.18261.
The mathlib Community (2020). The Lean mathematical library. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP), pages 367–381. ACM.
Yang, A., Li, A., Yang, B., Zhang, B., Hui, B., Zheng, B., et al. (2025). Qwen3 technical report. arXiv preprint arXiv:2505.09388.
Zhang, H. (2026). Budgeting bytes: A windowed storage roofline and dual-budget architecture ablations for storage-bound LLM decoding. arXiv preprint arXiv:2609.04238.
Zhang, J., Wu, L., Darbari, M., & Hong, L. (2026). WiSP: A working-set view of mixture-of-experts serving on extremely low-resource hardware. arXiv preprint arXiv:2606.21868.
Zheng, L., Chiang, W.-L., Sheng, Y., Zhuang, S., Wu, Z., Zhuang, Y., et al. (2023). Judging LLM-as-a-judge with MT-Bench and Chatbot Arena. In Advances in Neural Information Processing Systems 36 (NeurIPS), Datasets and Benchmarks Track.
A Notations
| Symbol | Meaning |
| acceptance rate (geometric acceptance) | |
| , the acceptance above which one draft is faster than none | |
| -th step point | |
| bytes of one expert of the timed layer, | |
| , the time the -th draft adds | |
| per-slot fit (4): time per byte of a first read and of a repeated slot | |
| deduplicating fit (E.1): time per union byte and per token | |
| context depth in tokens | |
| bytes read once per forward pass whatever the routing | |
| bytes read once per pass of tokens, | |
| relative bandwidth error (Section 3.5) | |
| expectation | |
| expert bytes kernel requests on a pass of tokens | |
| expected expert bytes of a pass of tokens with the per-slot and the deduplicating kernel; are the union bytes | |
| bytes the deduplicating kernel reads per distinct expert of layer , over | |
| , expected tokens emitted per step | |
| draft model's and host's time per step | |
| (Appendix B) | |
| draft length; its maximum | |
| best draft length, the smallest maximizer of | |
| key-value cache bytes read by a step verifying tokens | |
| number of MoE layers; layer index | |
| experts selected per token | |
| memory part of | |
| expert part of | |
| number of consecutive tokens, or tokens verified in one pass | |
| experts per layer | |
| expert kernel of a pass: slot (per-slot) or dedup (deduplicating) | |
| (Appendix B) | |
| bandwidth ratio | |
| saving of deduplication, (6) | |
| routing set: the experts layer selects for the token at position | |
| token position | |
| time outside the pass's memory reads | |
| fixed time of a fit on chosen ids | |
| operation time of layer with kernel , averaged over windows of recorded routing: the fit at each window's bytes in the prediction, the measured median in the measured-time version (22) |
| Symbol | Meaning |
| throughput, tokens per second | |
| trace length | |
| distinct experts of a pass in the benchmark | |
| mean number of distinct experts that consecutive tokens select in layer | |
| , the share of the per-slot bytes that deduplication requests | |
| step time of a step drafting tokens | |
| bytes of a step with each kernel, the one-bandwidth case (Appendix B) | |
| bytes of one expert of layer ; | |
| number of distinct experts that consecutive tokens select in layer , from position | |
| infimum of the acceptances at which draft length is faster than , 1 if none (Appendix B) | |
| bandwidth of the bytes read once per pass | |
| effective bandwidth of kernel : its requested expert bytes over its time | |
| bound on the relative error of the predicted step time | |
| bound on the relative bandwidth error, measured per engine (Section 4) | |
| reuse of consecutive tokens (1); its estimate on traces | |
| byte-weighted mean reuse of the drafted tokens (11) | |
| reuse threshold: the least at which draft length is faster than plain decoding (14) | |
| verify time of a pass of tokens with kernel (5) | |
| fixed work per pass with kernel | |
| cost of a drafted token relative to a target step, in the affine cost of Leviathan et al. (2023) | |
| a quantity computed from the estimated bandwidths, such as , , and |
B Proofs
This appendix derives each result of Section 3 under its exact conditions. Each paragraph starts from its assumptions, and its heading names the equation of Section 3 it derives. A result with no equation there gets a numbered display here. Acceptance is geometric at rate , and a step with draft length costs . A result that names no kernel holds for every positive cost, measured times included. The results for a deduplicating engine (Appendix B.2) assume that the verified tokens are routed like consecutive tokens of a stationary routing process. They are derived in the step time (5), with the bandwidth of each kernel at each pass size. The byte cost , with one bandwidth for every byte, is their special case of Appendix B.2. Notation is that of Section 1 and Section 3. Throughout, , so for , and every cost is positive. For each result proved in Lean, we name the module of the accompanying Lean package MoESpec and its theorems at the step they prove. We also say which steps, if any, Lean does not cover. The package builds with Lean 4.34.1 against a pinned Mathlib. Every cited theorem uses only the axioms propext, Classical.choice and Quot.sound. The probability models fix the start of the window and live on a finite probability space. The other Lean statements have been compared line by line with the paper's statements. Two groups have not yet been compared in this way: the reuse threshold in time (module MoESpec.TimeThreshold) and the error bounds (17) to (21) (module MoESpec.ErrBounds). Where the only Lean proof of a result for a deduplicating engine is stated for the byte cost, we say so. In that case the step from the byte cost to the step time is by hand. Exact-arithmetic brute-force checks on small cases, which we do not list, also cover four groups of results. These are the speedup condition, the one-bandwidth (byte) forms of the results for a deduplicating engine, the staircase, and the step points under an increment condition. The time forms of the results for a deduplicating engine and the error bounds have no such checks. The Lean models fix the start of the window of positions, and stationarity enters only to drop it. They work on a finite probability space of traces. This space covers every routing process on traces of length , since the set of such traces is finite.
B.1 Speedup condition
Speedup condition (8). Here , is any cost, and . No property of V beyond positivity is used. The geometric sum gives
Since , multiplying by turns the comparison of throughputs into one of costs,
which by (B.1) is (8) (Lean: MoESpec.SpeedupCond, faster_at_k). Speculation gives a speedup at a when , and
If , then is a maximizer and 0 is not, because the smallest maximizer is positive. So . Conversely, if some has , then 0 is not a maximizer and . With (B.2), speculation therefore gives a speedup at a if and only if for some . In Lean this is MoESpec.SpeedupCondIff, faster_iff, whose “faster” is the right side of (B.3). The equivalence (B.3) is by hand. For , , so (B.2) reads . We divide by and repeat the computation with equality for the second case. This gives
(Lean: MoESpec.FirstTokenThreshold, thresh and thresh_eq).
B.2 Deduplicating engines
Union bytes (2), (12). Here the routing process is stationary, with sets of experts and . Nothing about a kernel or a bandwidth enters. Fix , and , and let , which is empty for . Since ,
We take expectations with both windows starting at . Stationarity makes the result independent of . Using by (1), we get
(Lean: MoESpec.ReuseUnion, increment). Summing from gives (2) (telescope). Multiplying by and summing over gives (3) and
(MoESpec.ClassGap, union_eq and gap). At the term is , since . By the definition (11) of , the remaining terms give
which is (12). This step is by hand. In Lean it appears only inside the byte cost (MoESpec.SpeedupCond, lemma Vu_diff). The union of sets contains the first set's experts, so . With , this gives
(Lean: MoESpec.Positivity, positivity, whose second and third parts are (B.9)).
Step time (13). Here the engine deduplicates with , the draft model's and the host's time is zero, and the routing process is as in the previous paragraph. By (5), , , and . The fixed work and is non-negative. The bandwidths and are positive, and each is a function of the pass size alone. A one-token pass reads expert bytes. So with (12), the step times are, for ,
(B.10)
When we subtract, cancels. With and as in Section 3.4, the difference is (13). Every term of (B.10) is non-negative. By (B.9), the expert term of is at least , so
The byte inequality (B.9) is in Lean. The step from it to (B.11) is by hand, and the Lean theorems in time take positivity of V as a hypothesis. For the byte cost, MoESpec.Positivity, Vu_pos and U1_holds prove from the setting and discharge that hypothesis. A non-negative h would enter (B.10) as extra fixed work, in and in . It would leave every step below unchanged.
Reuse threshold (14). Here the step times are (B.10) under the assumptions of the previous paragraph. Also , and is (14). Write
for the bracket of (14). By (13),
where the last equality expands (Lean: MoESpec.TimeThreshold, gap_identity). That theorem needs only and . Since by (B.11), (B.2) applies. So if and only if the left side of (B.13) is negative. Since , this gives
(faster_time, with positivity of V as a hypothesis). By (B.3), speculation gives a speedup at a if and only if for some . Each has its own , and . This union over is by hand in time form, and in Lean only for the byte cost (MoESpec.SpeedupCondIff, faster_iff_reuse). Now fix , , , and . Then only the expert term of in (B.10) depends on . Its numerator falls as rises. Since , is non-increasing in , and does not depend on it:
(tauk_mono). Suppose moreover that and . Then , and . Substituting into (14) gives
(byte_form). This is the one-bandwidth case of Appendix B.2. Finally, for any positive cost, and , so
(speedup_ratio). Substituting (13) for gives (15). The substitution is by hand.
One draft. Here the assumptions are those of the previous paragraph with . Then , by (11), and by (12). We substitute these into (14). We also substitute them, with (13) and , into of (B.4). This gives
By (B.14) and (B.4), one draft is faster than none exactly when , equivalently when . Both equivalences are in Lean in time form. The first is MoESpec.TimeThreshold, faster_time at . The second is MoESpec.FirstTokenThreshold, thresh, for any positive cost. The explicit forms (B.18) are substitutions by hand. Lean states the explicit only for the byte cost (MoESpec.SpeedupCond, a0_union).
Threshold movement. Here the assumptions are those of the reuse threshold in time, with fixed. Moving a changes only in (14), because no other quantity in it depends on . The bandwidths and the fixed work are functions of the pass size alone. Moving to changes only , by , since does not involve . This holds provided the bandwidths and the fixed work do not change with . So, for ,
For , every term of is at most the matching term at , and the first is smaller. So . With by (B.11), is strictly decreasing in on . For , and , so is strictly decreasing in . At it does not depend on . These steps are by hand. Lean proves the same three statements only for the byte form (16) (MoESpec.ThresholdMonotone, rhoStar_lt and U2_holds).
More reuse. Here two stationary routing processes, a prime marking the second, have reuses for every and . They have the same , , , , , and . Their step times are (B.10) under the assumptions of the step-time paragraph. They have the same , , and and, for every , the same and . That is, the deduplicating bandwidth and fixed work at a fixed pass size do not depend on which experts repeat. Since , the definition (11) gives the second relation below. The first holds because involves no reuse:
so by (B.15), for every (MoESpec.TimeThreshold, tauk_mono). The comparison of is by hand. Every input of in (14) is shared by the two processes. Suppose that speculation gives a speedup at under the first process. Then by (B.14), some has , and by (B.20)
and by (B.14) for the second process ( by (B.11)), speculation gives a speedup at under the second. Each use of (B.14) is faster_time. The chaining is by hand. With and , (B.17) also shows that the speedup does not fall. This step is by hand. The one-bandwidth case is in Lean for the byte cost (MoESpec.MoreReuse, cost_zero, cost_le and faster_mono). If or changes with the routing at fixed pass size, then may change too. In that case the argument above does not apply.
One bandwidth (16). Here for every and . This is an admissible instance of (B.10). With , (B.10) becomes with . So every throughput is multiplied by , and no comparison of throughputs changes. With and , (B.16) is (16), with (MoESpec.TimeThreshold, byte_form). At , (B.18) becomes
using . In this case, Lean also proves the results of the previous paragraphs directly from the routing process, in the byte cost. These results are the threshold and the speedup at some (MoESpec.SpeedupCond, faster_reuse; MoESpec.SpeedupCondIff, faster_iff_reuse; MoESpec.Positivity, U1_holds, which also discharges positivity). They also include the explicit (MoESpec.SpeedupCond, a0_union), the movement in and (MoESpec.ThresholdMonotone) and more reuse (MoESpec.MoreReuse).
No single threshold. Here two stationary routing processes share every quantity that the paragraph on more reuse holds fixed, with no order between their reuses. Then is the same for both. So by (B.14), two routing processes with equal both give a speedup or neither does. This step is by hand from faster_time. Lean proves it for the byte cost (MoESpec.NoSingleThreshold, U3a_holds). With , no single suffices. The example below uses one bandwidth with . This is an admissible instance of the time model (Appendix B.2), so the example shows the same for the step time. Take , , , , , , and . Then and by (16). Each process below repeats one pattern of experts, started at a uniformly random phase, so it is stationary.
| Pattern | Period | Speedup | ||
|---|---|---|---|---|
| 01 | 2 | 0 | 1/2 | yes (k=2) |
| 00012 | 5 | 2/5 | 2/5 | yes (k=1) |
| 00102 | 5 | 1/5 | 2/5 | no |
For , pattern 01 gives a speedup with a lower than 00102, which does not. For , 00012 gives a speedup with the same as 00102. So no rule “” or “” decides for either . Lean: MoESpec.NoSingleThreshold, U3b_holds and U3_holds, for the byte cost. The example has ; we built none with .
B.3 Staircase
Monotonicity and step points. Here , is any cost and . For , let , and let be its infimum, taken as 1 when the set is empty.
The ratio rises with . For ,
For , termwise, since for ,
and . Hence, by (B.23) at x and at y,
that is, for and ,
(Lean: MoESpec.Staircase, ratio_mono). Since
the set contains, with any , every . That is, it is closed upward in (upset). So it contains and misses .
The best draft length rises with . Let in and , so no maximizes . Take and a maximizer of . Then and , so . Hence , that is, , and does not maximize . So . As this holds for every ,
(kstar_mono).
The step points are exact. For and ,
“If”: each has lower throughput than some . So no is a maximizer, and the smallest maximizer is at least . “Only if”: the maximizer has higher throughput than each , since none of them is a maximizer. In Lean this is ge_iff, which states as “no maximizes ”. The equivalence of that statement with for the smallest maximizer is by hand. By (B.29),
A union of upward-closed sets is upward closed, with infimum the least infimum. A finite intersection of them is upward closed, with infimum the largest. So the set (B.30) contains every above and none below it. This number is its infimum, the step point:
that is, for every and for every (Lean: MoESpec.StepPoints, step_maxmin, ge_of_gt_maxmin and not_ge_of_lt_maxmin). For only occurs, so (step_one). So speculation gives a speedup at every and at no .
Jumps. The statement of Section 3.3 that the staircase can jump by more than one length rests on a two-expert example. Take , , , , , and . Tokens that alternate between the two experts with a uniformly random phase then give . This is the step time (5) with one bandwidth and , an admissible instance of the time model. Then and , so this staircase jumps from 0 to 2 (MoESpec.UnionJump, union_half; MoESpec.UnionJump2, union_half_U and alt_stair_U). That for every is checked by hand.
Convex step time (10). Here , is any cost, and , and
The first part assumes for every . The second part assumes , that is, convex and non-decreasing.
Once stops rising it never rises again. Write . Since and ,
If , then by (B.33), , and the hypothesis ,
which is by (B.33) at (Lean: MoESpec.Staircase, propagate). “If”: suppose . Then rose at every step before , because a fall would propagate to the step from to . So every has , and . “Only if”: suppose . Then for every , and a maximizer over is a global maximizer below (uni_iff). Negating (B.33) at shows that if and only if , that is, (step_form). So under for every ,
Under gives . So the hypothesis of (B.35) holds at every , and (B.35) is (10). Dividing its last inequality by gives the first statement below. For , termwise, since each term satisfies for , strictly at . So is strictly increasing on (h_strict), and is upward closed with infimum . For , , and the infimum of is (Lean: MoESpec.StepPoints, a1_uni). So
and is when . The theorem MoESpec.StaircaseInfimum, t5, proves (B.35) and (B.36) whole. This includes that the hypothesis of (B.36) implies that of (B.35), and the reading of as the infimum of an upward-closed set.
C Error-bound proofs
This appendix derives the bounds of Table 2. Each paragraph starts from its assumptions, and its heading names the bound it derives. Throughout, the step time is (5). Each bandwidth in it is estimated as with , one per bandwidth. Every other term of (5) is exact and non-negative. Each bound is proved in the module MoESpec.ErrBounds of the accompanying Lean package. The proofs use Mathlib at the pinned version and only the standard axioms. We name the theorems at the step they prove. The other Lean results of Appendix B have been compared line by line with the statements they formalize. These Lean statements have not yet been compared in this way with the statements below. The same holds for the reuse threshold in time (Eqs. (B.14) to (B.17)).
Verify time (17). Here is the bytes of one memory term of (5) and its bandwidth. The estimate moves the term by
Since , cross-multiplying turns into . This inequality follows from and . So each memory term moves by at most of itself (time_err). By the triangle inequality, the memory part also moves by at most of itself (time_err2). The other terms of are exact, so . They are also non-negative, so . Together these give (17).
Saving (18). Here both kernels read the same bytes once per pass at the same dense bandwidth , with the same estimate. By the previous paragraph, for each kernel. The dense term is the same for both kernels, so
Each bracket is one memory term of (C.1). So the triangle inequality and the bound of the previous paragraph on each bracket give (18) (saving_err).
Faster kernel (19). Here are the true expert times of the two kernels and their fixed work. The estimates multiply and by factors . Each factor lies in , with . If
then . Also . So the predicted and the true times order the kernels alike (decision_agree_f). The theorem decision_agree proves the case separately, for . Now take and equal fixed work, so that . This fixed work cancels from (C.3). Take and , so that . The margin (C.3) is then , that is, . The same argument with the kernels exchanged gives the other sign. The two cases together are (19).
Best draft length (20). Here , the true step time is and the predicted one is . They satisfy for every , with . Over , the draft length maximizes and maximizes . Dividing by the bounds on gives
(T_bounds). Since maximizes ,
(regret). So the throughput lost, , is at most . If , (C.5) gives . The separation condition of (20) is for every . For , this condition forbids the previous inequality. So under the separation condition, (argmax_agree, whose hypothesis is this condition). A common factor on every step time leaves the maximizer unchanged. The reason is that exactly when (common_factor).
Best speedup (21). Here the assumptions are those of the previous paragraph. By (C.4), . Also , so
Dividing the first pair by the second, in the direction that keeps each inequality, gives (21) (speedup_bounds).
From to . Here the bandwidths are the only errors of the predicted step time, and . By (17), the verify part of is off by at most of itself. An exact draft and host time only lowers the relative error of the sum. So satisfies the assumption of (20). Then and , so
which for is the factor 1.25 of Section 3.5. This step is not in Lean.
D Engines and runs
D.1 Kernel dispatch
We follow each expert’s matrix product, for each model and pass size n, to the GPU kernel that runs it, at pinned releases. We then count the requested bytes. The kernel fixes which bandwidth of (5) a pass of n tokens runs at. On llama.cpp Metal, an expert product goes to a tiled matrix-matrix kernel only at 32 rows or more. Below that, a matrix-vector kernel multiplies each token’s selected experts separately. MLX-LM switches to a tiled kernel only on passes of at least 4N/m tokens. The llama.cpp CUDA tiled kernel loads each selected expert once per tile on passes of 9 to 128 tokens. For Metal and MLX-LM, the step from each request pattern to its byte count is proved in Lean (MoESpec.MetalClass and MoESpec.MlxClass). The reading of the kernels from source is by hand. Table 5 gives the result.
D.2 Models and prompts
On llama.cpp, the models run as OLMoE-1B-7B-0125 in Q8_0, Qwen3-30B-A3B in Q4_K_M and gpt-oss-20b in MXFP4 (Gerganov and llama.cpp contributors, 2026). On MLX-LM, OLMoE-1B-7B-0125 runs in 4-bit quantization. The oracle draft of Section 4 marks the positions it corrupts by a seeded draw, and it costs essentially nothing. On the Apple engines, the realized acceptance is within 0.04 of a. On CUDA, where it was not logged per run, steps emit 2 to 5% fewer tokens than (Appendix E). Each draft length is run with each acceptance a in an 11-value grid from 0.2 to 0.98. Each run generates 256 tokens on the six validation-set prompts of Section 4, at context depth and 4096. Each combination is run three times on the Apple engines and four times on CUDA. A run was discarded and redone if the machine was throttled, swapping, off AC power or running another inference process. Session load was not a discard reason. Other work on the M4 Max overlapped some whole-model runs. The run logs list these runs and are available on request. The DeepSeek-V2-Lite runs have no discard rule (Appendix E). Reuse is computed over every window of n consecutive tokens in a fit document. For each window, it counts the last token's experts that an earlier token of the window also selected. The sum over windows is divided by m times the number of windows. Its intervals come from 2000 bootstrap resamples of fit documents.
D.3 Real draft model
Qwen3-30B-A3B (Q4_K_M) runs on llama.cpp Metal, drafted by Qwen3-0.6B (Q8_0), with both models greedy. This engine runs the per-slot kernel on every pass of speculation (Table 5). So each draft adds the expert bytes mW of one more token. The runs use the 80 first-turn MT-Bench prompts (Zheng et al., 2023) and generate 256 tokens at . The run at uses the same program with a drafter that never drafts. The prompts were split into 42 for fitting an earlier time model and 38 held out from it. That earlier model is linear in the per-slot bytes, and this paper does not use it. We report the held-out prompts, of which 37 have a run at every draft length. Plain decoding is fastest on 33 of the 37. The median speedup over plain decoding is 0.877 at and 0.517 at .
Table 5: Kernel that runs the expert products, read from source. is the number of tokens verified in one pass, and the tests verify tokens per step. “Neither”: the requested bytes equal neither the union nor the per-slot count on every trace. Bytes are requested bytes. The source does not determine how many requests on-chip caches serve. The CUDA row at is the source reading of the matrix-vector kernel, which requests each slot’s expert once. Profiled L2 requests of this kernel fall below when repeated experts sit in the same slot of every token. They fall as far as 0.14 of , at and . Two causes would both produce this: L1 hits under per-slot requests, and a pattern that requests each expert once per slot position. The hardware counters do not decide between them, so the row rests on the source. For gpt-oss, the factor 16/15 counts the loads of the tiled kernel in the source reading. The factor of Table 6 instead counts the padded rows of each weight tensor, the byte unit of Appendix E.
| engine | tested sizes | other sizes | where the source decides |
| llama.cppMetal b11617 | per-slot | per-slot for ; tiled (32 tokens per tile) for , deduplicating only at for two models | dispatch test “batch rows” in ggml-metal-common.cpp; matrix-vector kernel in mul_mv.metal, one grid slice per token-slot pair |
| MLX-LM0.32.0 | per-slot | per-slot for (32 or 64); tiled (16 per tile), neither, above | dispatch branch on rows per expert in mlx/backend/metal/quantized.cpp; MoE call in mlx_lm/models/switch_layers.py |
| llama.cppCUDA b11617 | upstream; run in Sec. 4 | both at ; per-slot for ; deduplicating for (OLMoE, Qwen3), 16/15 times union (gpt-oss) | batch limit 8 for the matrix-vector kernel in ggml-cuda/mmvq.cuh; dispatch in ggml_cuda_mul_mat_id (ggml-cuda.cu); tiles in ggml-cuda/mmq.cu |
E Deduplication evidence
Engine changes. The kernel each setting runs, its byte count and its factor are read from source at pinned commits. These are commits of the modified llama.cpp Metal and MLX-LM and of the unmodified CUDA build. On llama.cpp Metal, the minimum batch of the deduplicating kernel drops from 32 to 2. MLX-LM sorts rows by expert. On llama.cpp CUDA, an environment variable lowers the per-slot batch cap from 8 to 1. We checked each modified engine for equal output with deduplication off and on. On Metal, both settings give the same greedy tokens on OLMoE and gpt-oss, and Qwen3 diverges on one of three prompts at position 12. On CUDA, both settings give identical greedy tokens on both models and three prompts. There the verify argmax agrees on 132 of 132 rows (OLMoE) and 128 of 132 (gpt-oss, four near ties). On CUDA, the bytes read once per pass are the same with deduplication off and on, on OLMoE.
Routing. We measured reuse by teacher forcing on each modified engine’s own greedy sequence. On OLMoE and Qwen3, it differs from the WikiText-103 values by -0.018 to +0.004 in . For gpt-oss, the RTX 4070 Ti SUPER routes the same expert set as the M4 Max on 0.947 of 11845 (row, layer) pairs. Its layer-mean is within 0.00083 at . Neither measurement covers the greedy continuations at (Section 4.1).
Deduplicating fit. Here, as for (4), U is the number of distinct experts that a pass with chosen ids names. As there, b is the bytes of one expert of the timed layer. We fit the median operation time of the deduplicating kernel per layer, by least squares over the passes with chosen ids at , as
with its own fixed time , the time per union byte and the time per token. The benchmark of Section 2 times one layer's expert operation through each engine's library (llama.cpp's ggml with the Metal or CUDA backend; MLX). It runs on the same model files, after the same 256 MiB cache flush. Its output was checked against a CPU reference on DeepSeek-V2-Lite (layers 1, 13 and 26, , 4 and 9). The relative error is to on CUDA, where the GPU kernels quantize activations differently from the CPU. It is to on Metal. The chosen ids, the windows of recorded routing and every timing file are available on request. The prediction and the measured-time version read them through one script. This script also makes Figures 2 to 6 and 7 and Tables 1, 3, 4 and 7. It also computes the bandwidth error of Section 4 from the fits on chosen ids.
Speculative runs. The measured speculative runs on CUDA differ from with the measured and . Per configuration, the median factor between them is 0.93 to 1.04, over a range of 0.74 to 1.18. Two terms make up this difference. First, steps emit 2 to 5% fewer tokens than . On steps that run to their full length, the shortfall is 1.6 to 2.7%. This part comes from the sampling of the seeded flags that mark drafts wrong. The rest comes from steps cut short where the argmax of the batched verify pass differs from the batch-one greedy token that the oracle draft proposes. This happens on up to 25.8% of steps, at , on gpt-oss at . That term belongs to the oracle draft, and a real draft model checked against the batched pass has none. Second, the time per step beyond the verify pass is 0.58 to 0.61 of the measured . The verify time departs from its fit by -7 to +9%. Against the speedups of the measured speculative runs, the speedup bound (21) therefore holds at 9 of 11 acceptance values on
Table 6: The deduplicating engines. The kernel each setting runs is read from source at verified tokens. At , an engine runs the same kernel with deduplication off and on. : bytes the deduplicating kernel reads per distinct expert, over the expert's bytes. On Qwen3 Q4_K_M, the tiled kernel reads each K-quant expert more than once. MMVQ and MMQ: llama.cpp CUDA's quantized matrix-vector and matrix-matrix kernels.
| engine | switch | deduplication off | deduplication on | , deduplicating |
|---|---|---|---|---|
| llama.cppMetal, modified | deduplicating kernel from 2 rows (32 upstream) | mul_mv_id, per-slot, | mul_mm_id, deduplicating, | 1 (OLMoE Q8_0, gpt-oss MXFP4)2.14 or 2.33 (Qwen3 Q4_K_M, K-quant reload) |
| MLX-LM, modified | sort rows by expert, gather_qmm RHS | gather_qmv, per-slot, | sorted rows, deduplicating, | 10/9 (16-row tile) |
| llama.cppCUDA, modified | per-slot batch cap 8 to 1 | MMVQ, per-slot, ; MMQ at | MMQ, deduplicating, | 1 (OLMoE)500/459 (gpt-oss, padded unit) |
Table 7: Per configuration, three quantities. Amplification: the factor by which the saving bound (18) turns a relative bandwidth error into a relative saving error. It is given as its range over ( on CUDA; floored at 0.05 ms), and it is largest where crosses 0. Implied : the bandwidth error that the prediction's largest saving error requires under (18), against the engine's . Verify-time error: the largest relative error of the verify time with deduplication on over , for the prediction, the measured-time version and the calibrated version. Metal and CUDA are llama.cpp.
| engine | model | amplification | verify-time error | |||||
|---|---|---|---|---|---|---|---|---|
| implied | engine | prediction | measured-time | calibrated | ||||
| Metal | OLMoE | 512 | 6.0 to 79 | 0.014 | 0.031 | 19% | 20% | 6% |
| Metal | OLMoE | 4096 | 6.2 to 86 | 0.028 | 0.031 | 24% | 24% | 6% |
| Metal | Qwen3 | 512 | 3.9 to 7.8 | 0.020 | 0.031 | 21% | 22% | 6% |
| Metal | Qwen3 | 4096 | 4.2 to 19 | 0.047 | 0.031 | 25% | 31% | 4% |
| Metal | gpt-oss | 512 | 3.3 to 343 | 0.033 | 0.031 | 20% | 15% | 9% |
| Metal | gpt-oss | 4096 | 3.8 to 87 | 0.126 | 0.031 | 6% | 18% | 8% |
| MLX-LM | OLMoE | 512 | 3.2 to 3.8 | 0.108 | 0.148 | 38% | 30% | 26% |
| MLX-LM | OLMoE | 4096 | 3.3 to 3.8 | 0.107 | 0.148 | 41% | 31% | 17% |
| CUDA | OLMoE | 512 | 15.4 to 139 | 0.030 | 0.054 | 3% | 9% | 3% |
| CUDA | OLMoE | 4096 | 15.2 to 146 | 0.032 | 0.054 | 5% | 5% | 2% |
| CUDA | gpt-oss | 512 | 7.5 to 223 | 0.022 | 0.054 | 9% | 16% | 6% |
| CUDA | gpt-oss | 4096 | 6.0 to 43 | 0.033 | 0.054 | 21% | 4% | 1% |
CUDA gpt-oss at . It holds at all values elsewhere. The two misses come from these two terms.
Scoring rules. Table 8 lists the six scoring rules written before the whole-model runs of Section 4.4, with the value each measurement gives. The scoring script decides each rule at each depth.
Table 8: Scoring rules for DeepSeek-V2-Lite and the measured values, measured-time version. The speedup rule uses , the largest relative error of the predicted step time. The crossover rule is scored over , and a measured crossover at counts as within one of none. On CUDA, the deduplicating kernel runs at with deduplication off and on. So Table 4, like Table 3, reads the CUDA crossover over .
| rule | CUDA 512 | CUDA 4096 | Metal 512 | Metal 4096 |
|---|---|---|---|---|
| crossover within one | , holds | , holds | , holds | , holds |
| within one at of 11 values | 11, holds | 11, holds | 9, holds | 6, fails |
| loss at most 6% at every value | 2.9%, holds | 4.1%, holds | 20.1%, fails | 22.5%, fails |
| sign of where the interval excludes 0 | 7 of 7, holds | 7 of 7, holds | 8 of 8, holds | 8 of 8, holds |
| verify time within 15%, both kernels | 9.9%, holds | 10.1%, holds | 34.0%, fails | 28.4%, fails |
| best speedup inside (21) | , holds | 0.077, holds | 0.27, holds | 0.25, holds |
The measured-time version meets the rules only if all six hold at both depths. The same script, byte for byte, scored both engines. On Metal, the whole-model runs at show a slow GPU state in some runs. In each of the four whole-model runs at , the first prompt runs at 6.7 to 7.1 ms per step and the others at 7.5 to 9.4 ms. With a 90 s rest after every 10 minutes of runs, the state persists. The system reports no thermal warning at any of the 37 rests. At , the ratio of the slowest to the fastest prompt's median step time has a median of 1.03. It exceeds 1.08 in 2 of 94 runs at acceptance 1. The rules exclude no runs, so these runs are scored.
Transfer. Characterizing the bandwidth once per engine, instead of measuring it per model, fails (Figure 7). We hold out one model at a time on CUDA (three models) and Metal (four). We fit on the other models as linear in and the log of the expert bytes, a form fixed before any held-out prediction. This fit misses the held-out bandwidth by 9 to 206% (median 23% on CUDA, 47% on Metal). It misses the ratio by 2 to 30% on OLMoE and DeepSeek-V2-Lite and by 33 to 86% on gpt-oss and Qwen3. The expert sizes of gpt-oss and Qwen3 lie outside the range of the other models. Near the crossover, this error exceeds the margin of (19). The transferred bandwidth places the crossover within one in 1 of 6 CUDA configurations and 2 of 8 Metal configurations. With each model's own measurement, the counts are 6 of 6 and 7 of 8. The quantization format (Q8_0, Q4_K_M, MXFP4) and the model are confounded, and MLX-LM has one model.

Figure 7: Bandwidth of a held-out model, predicted from the other models of the same engine. It is plotted against the bandwidth measured on the expert operation of the held-out model, at n = 2, 4, 6, 8. Left: each kernel's bandwidth (filled: per-slot; open: deduplicating), log scale. Right: the ratio . Color: the held-out model; shape: engine (circle: llama.cpp CUDA, triangle: llama.cpp Metal). Dotted: equal.