Baturalp Güvenç · Wiener Labs · Istanbul, Türkiye · baturalp@wienerlabs.com
Abstract
Autoregressive large language model (LLM) inference at low batch size is memory-bandwidth bound: each generated token requires streaming the entire parameter set from high-bandwidth memory (HBM) to the compute cores, and the physical bandwidth is fixed by the silicon. We argue that the relevant quantity to optimize is not but the information carried per byte moved, and we formalize this as a software-defined effective bandwidth . We give an interference-aware composition law for that supersedes the naive product of per-mechanism speedups, and we show, both by a roofline argument and by a bit-exact kernel reference, that three software mechanisms (grouped low-bit weight streaming with on-chip dequantization, execution-guided block sparsity, and multi-token speculative reuse) compose sub-multiplicatively, and that block sparsity is net-negative unless it shares a memory layout co-designed with the dequantization path. Anchored on a training-free 4-bit post-training quantization (PTQ) configuration that runs on any existing checkpoint, the calculus predicts a wall-clock speedup with median (10-90 percentile -) at batch one on a 70B model. It also predicts a negative result: at the optimal draft depth, execution-guided sparsity adds essentially nothing on top of speculation unless the sharing of skip decisions across drafted positions is measured to be high. All layout and correctness claims are verified in exact arithmetic on CPU; the GPU kernel skeleton maps line-for-line onto the verified reference.
Index Terms: LLM inference, memory bandwidth, quantization, dynamic sparsity, speculative decoding, GPU kernels, roofline model.
I. Introduction
The dominant cost of serving an autoregressive LLM at interactive latency, i.e. at batch size one, is not arithmetic but memory movement. To produce each token the decoder reads every weight of the model from HBM into on-chip SRAM exactly once; for a 70B model in FP16 this is GB per token, and on an accelerator delivering TB/s the read alone floors the step time near ms regardless of how fast the tensor cores are. The arithmetic intensity of a matrix-vector product is FLOP per byte, so the operating point sits deep in the memory-bound region of the roofline; the compute units are largely idle.
The physical remedy (wider buses, more stacks, faster HBM) is bounded by packaging and by economics, and improves slowly. This paper takes the software view: if the HBMSRAM path cannot be physically widened, then the objective is to maximize the useful information transported per byte that crosses it. We name this target the software-defined effective bandwidth
an operational, measurable quantity: is the bandwidth a hypothetical unoptimized engine would need in order to match the token/s that the optimized engine actually attains. A method that doubles tokens per second at fixed hardware doubles by definition, whether it did so by moving fewer bytes, by extracting more tokens per byte, or both.
A. The multiplicative fallacy
It is tempting to model the gain as a product of independent factors (compression sparsity speculation) and to report, for example, , hence . This is the central error we correct. The three mechanisms are not independent: they contend for the same bytes and the same memory-layout budget. A wider speculative tree enlarges the union of neurons that any token in the tree activates, which erodes the sparsity of the batched read; and skipping weights by a data-dependent predictor scatters the surviving accesses, which collapses coalescing and can leave the sparse path slower than the dense one. The true gain is therefore a constrained composition, not a product. Both couplings have been observed in isolation in prior work; what is missing, and what we supply, is the joint form in which all three mechanisms and the memory layout appear as one expression.
B. Contributions
-
An interference-aware calculus (Section II) that expresses the step time as a single roofline maximum over an effective byte count in which compression, sparsity, and speculation appear together with their mutual couplings. Each pairwise interaction has been observed separately in prior work; the contribution here is the closed-form three-way composition and the common currency in which the mechanisms can be compared and combined.
-
A layout co-design contract: we show, by a coalescing and bank-conflict simulation and by a bit-exact fused-kernel reference, that block-dynamic sparsity is net-positive only when packed low-bit weights and the sparsity mask share a neuron-contiguous, tile-transposed layout; the same simulation exhibits a configuration in which adding sparsity to a naive layout reduces throughput.
-
A PTQ-anchored, QAT-ceiling evaluation frame (Section III) that reports a reproducible, training-free operating point as the headline and a clearly labeled conditional ceiling for the training-based regime, so that the headline speedup claim is falsifiable and checkpoint-agnostic.
We emphasize scope. The regime of interest is low-batch, long-context, single-user or edge inference, where the read of weights and KV cache dominates. At large batch the operating point crosses into the compute-bound region and the compression gains amortize away; the calculus below makes that crossover explicit rather than hiding it.
II. The Effective-Bandwidth Model
A. Baseline step time
Let be the parameter count, the bits per stored weight, the achieved fraction of (memory efficiency), the peak compute rate, the context length in tokens, and the bytes per token of KV cache. For dense FP16 greedy decoding the per-token step time is the roofline maximum
and at batch one the first argument dominates for all current accelerators.
B. The three mechanisms and their couplings
We introduce four software controls and, crucially, the terms that couple them.
(i) Low-bit streaming. Weights are stored at bits in groups of with an FP16 scale (and optional zero) per group, giving a true cost of bits per weight; they are dequantized in registers after the load, so the HBM traffic scales as relative to FP16 but the arithmetic acquires a dequantization factor .
(ii) Execution-guided block sparsity. A lightweight router marks a fraction of the feed-forward blocks inactive for the current token; only the active blocks are fetched. Let be the per-token skip fraction and the share of parameters in the feed-forward sublayers.
(iii) Multi-token speculative reuse. A tree of candidate positions is drafted and verified against one read of the weights, yielding accepted tokens per step; the effective work per step scales with while the read is amortized across outputs.
The coupling. The sparsity seen by a batched, tree-shaped read is not but the complement of the union of active blocks over the tree. Writing for the fraction of the skip decision shared across sibling positions, the effective tree width for the union is , and the retained-weight fraction is
where is the fraction of weight bytes actually streamed. Equation (3) is the quantitative form of the multiplicative fallacy: as grows, so speculation eats sparsity.
C. Composed step time and
The optimized per-token step time is
where is the KV compression factor, the memory efficiency under sparsity, the router parameters and the draft parameters. The second term of is the sequential draft passes, which are latency and do not amortize across the tree. The attention and router terms are small at short context and are not at long context. Equation (5) is exactly (1): FP16-dense bytes per token divided by wall-clock time per token.
Crucially is not a free input. For per-token acceptance and draft depth the expected accepted tokens per verified step follow
so the model solves for the depth that maximizes rather than assuming a tree width.
D. The layout contract: why is the crux
The single most consequential term in (4) is . Sparsity reduces but, if the surviving accesses are scattered, it also reduces , and the two effects can cancel. Concretely, a data-dependent skip that indexes weights in a neuron-interleaved layout forces a warp to gather one word per active neuron across a large stride; in a 128-byte segment model this drops attained bandwidth from to under (Section IV, and the simulation in the companion code). The break-even condition follows directly from (4): sparsity is net-positive only when
i.e. the sparse layout must retain at least a -fraction of the dense efficiency. Since (3) makes at wide trees, at , , one needs : almost no coalescing may be lost. This is achievable only by co-design: packing the low-bit weights and the block mask into a single neuron-contiguous, tile-transposed layout so that the words a warp reads at a fixed column-group are unit-stride even after tiles are skipped. Under that layout the fused kernel attains full coalescing (verified bit-exactly against a dense reference), and (6) holds with margin at all tree widths. Absent it, the sparse path is slower than the dense one, and the of the "all mechanisms" configuration falls below that of compression-plus-speculation alone.
E. The context wall
As weights shrink under (i), the KV read becomes the binding term in the memory numerator of (4). Setting weight bytes equal to KV bytes gives a crossover context
for a 2-bit 70B model with FP16 KV this is on the order of tokens, beyond which the KV cache dominates the read and further weight compression yields diminishing returns. KV compression () shifts proportionally and is therefore a first-class mechanism, not an afterthought, in the long-context regime.
III. PTQ Anchor and QAT Ceiling
A. Why bit-width is an axis, not a constant
The compression factor trades throughput against model quality, and the trade is sharply nonlinear. Plain post-training quantization of an existing 70B checkpoint is essentially lossless at 4 bits (perplexity change below ), degrades noticeably at 3 bits, and is unusable at 2 bits (perplexity inflation of several points) unless one applies incoherence-processing or fine-tuning that is training-adjacent in cost. Weight formats that reach bits at full quality require pretraining from scratch and are not drop-in replacements for released weights. Reporting a single ambitious bit-width therefore conflates a reproducible engineering result with a research aspiration.
B. The evaluation frame
We treat as a measured axis and separate two operating points.
Anchor (reproducible, training-free). Grouped 4-bit PTQ, applicable to any released checkpoint with no retraining, combined with the co-designed layout of Section II, FP8 KV, and a speculative tree (, ) at a conservative skip . This is the headline configuration; the calculus of (4) predicts a wall-clock speedup with median at batch one on a 70B model and a 10-90 percentile interval of - propagated over plausible ranges of acceptance, sharing and attained bandwidth. We report the interval rather than a point estimate.
Ceiling (projected, training-based). The same calculus evaluated at 2-bit quality-preserving quantization with a higher skip projects toward ; we report it as a conditional upper envelope, explicitly labeled, to indicate how the method scales when a quantization-aware training budget is available. No claim of reproducibility is attached to this point.
C. A negative result: sparsity and speculation are near-exclusive
Solving (4) for the optimal depth exposes a consequence the multiplicative view hides. Standalone, execution-guided sparsity is worth about at the anchor configuration. Its marginal value collapses as the tree deepens: at , at , at , and it turns negative beyond, because (3) drives while the router still costs bytes and arithmetic. Since the optimum sits at large , the two mechanisms are close to mutually exclusive: sparsity is not a multiplier on speculation but an alternative to it, and speculation wins at every acceptance rate we tested, down to .
The exception is sharp and measurable. At high skip sharing the union grows slowly enough for sparsity to survive inside a shallow tree: at its marginal value is at and at , against at . The question therefore reduces to the measured value of , which is why it is the first quantity in the calibration protocol and why the headline configuration is quantization plus speculation, with sparsity admitted only if is measured high or no draft model is available.
This framing keeps the headline falsifiable and checkpoint-agnostic while making the ceiling and its precondition (training) transparent. Table and kernel-level validation of the anchor point, and the calibration of and on hardware, are the subject of the following sections.
IV. Kernel Design and the Layout Contract
This section specifies the artifact that makes large enough to satisfy (6), and reports the correctness and traffic properties we have verified for it.
A. Storage format
Weights are quantized in groups of columns with an FP16 scale and an optional FP16 zero point, and packed into 32-bit words, weights per word. The true storage cost is bits per weight for the symmetric variant and for the asymmetric one; at this is bits for the anchor configuration. Bit widths that do not divide 32 waste the residue: costs effective bits rather than , which is why the design admits only. The codec is idempotent on its own lattice, i.e. re-quantizing a dequantized tensor produces the same code words exactly, which we use as a correctness invariant.
B. Layout
Two constraints act in opposite directions. Dequantization wants the words a lane consumes to be adjacent in the direction; the router wants whole neurons to be addressable so that inactive ones are never fetched. We resolve them by storing weights neuron-contiguous and then tile-transposing: the packed array has logical shape , where is the number of output rows per program and . A warp that reads the words belonging to a fixed column-group index therefore issues unit-stride loads, and a skipped tile is simply absent from the launch list.
This is the operative difference from a layout that indexes surviving neurons in the original row-major array. In a 128-byte segment model with a keep fraction at , , the tile-transposed layout attains of the fetched segments useful, an unaligned variant attains , and a neuron-interleaved layout attains : the scattered variant wastes the bandwidth it saves. Substituting these into (6) reproduces the qualitative report in the literature that a naive sparse path in the original weight layout is slower than a layout-aware one, and gives the quantitative threshold at which the sign flips.
On the SRAM side, a FP32 tile loaded by column induces a 32-way bank conflict at stride 32; padding the row stride to 33, or applying an XOR swizzle to the column index, reduces the worst-case conflict degree to 1. Both are compatible with the tile-transposed global layout, since they act only on the staging buffer.
C. Fused kernel
One program instance owns one active tile and performs the whole chain in a single pass over HBM: load packed words, unpack lanes in registers, apply the group scale and zero, and accumulate the product with the activation vector. Dequantized weights never touch memory. Execution-guided sparsity is realized as a smaller launch grid rather than a masked load, so an inactive tile generates no weight traffic at all, which is the strongest available form of the mechanism and the one assumed by in (4).
We validated the kernel logic against a dense dequantize-then-multiply reference on identical inputs, obtaining agreement to relative error, i.e. exact up to FP16 rounding, and confirmed that the number of words touched equals exactly. In a representative configuration (, , , , 6 of 16 tiles active) the kernel moves fewer bytes than an FP16 dense pass, decomposing into from packing and from tile skipping, less the scale and zero overhead. The GPU port maps line for line onto this reference, so the port carries the same correctness argument and the same traffic ledger.
D. What is not yet optimized
The reference establishes correctness, traffic, and coalescing, not peak throughput. Two known inefficiencies remain: the per-lane unpacking loop is scalar and must be vectorized onto tensor-core fragments, and group scales are currently reloaded per lane rather than once per word. Both are local transformations that do not affect the layout contract, and both are scheduled for the hardware phase, where is measured directly rather than inferred.
V. Related Work and Position
Each mechanism in Section II, and each pairwise interaction between them, has prior art; we state this explicitly because it determines what remains to be shown.
Low-bit streaming. Weight-only PTQ at 4 bits is mature and essentially lossless, and dedicated mixed-precision GEMM kernels realize the bandwidth saving. Quality-preserving 2-bit PTQ requires incoherence processing or a fine-tuning-adjacent stage, and sub-2-bit formats at full quality require pretraining from scratch; this is the basis of the frame in Section III.
Execution-guided sparsity. Predictor-driven skipping of feed-forward neurons is established, as are its GPU-side difficulties: fine-grained branching and scattered access dominate unless the layout is restructured. Systems that combine grouped quantization with dynamic activation sparsity report that a naive sparse path in the original weight layout is markedly slower than a layout-aware one, which is the empirical counterpart of the break-even condition (6).
Union growth. That the union of active neurons grows when several positions are served from one weight read is known from the batched setting, where union sparsity is observed to diminish as batch size increases. Conversely, work on activation sparsity reports substantial reuse of already-activated neurons across speculatively drafted positions, i.e. a high value of in (3); the sign of this effect is therefore favourable and must be measured, not assumed.
Speculation meets quantization. It has been reported that the extra arithmetic of tree-shaped draft verification erodes the memory-side benefit of 4-bit quantization, limiting the compatibility of the two techniques. Equation (4) is the closed form of exactly that observation: the compute argument scales with while the memory argument scales with , so the roofline maximum switches arguments at a tree width that the calculus predicts.
Roofline systematizations. Roofline analyses of LLM decoding, of sparsity-accuracy trade-offs, and amortization models for speculative decoding with offloading all treat one or two levers at a time.
Position. Against this background we do not claim any individual mechanism, nor the existence of pairwise interference. What is unclaimed, to our knowledge, is the single three-way composition of low-bit streaming, execution-guided sparsity and speculative reuse in one calculus, together with the explicit layout break-even condition (6) and the use of as a common currency across mechanisms. A first consistency check is encouraging: at , and the calculus predicts a sparsity gain over a dense 4-bit baseline, against published measurements clustering near , implying once router overhead is absorbed, comfortably above the break-even value .
Reproducibility
The composition model (2)-(4), the layout coalescing and bank-conflict simulations, the grouped-quantization codec, and the fused dequantize-sparsify-multiply kernel (checked bit-for-bit against a dense reference, with the GPU port mapping line-for-line onto the verified CPU code) are provided as a companion code repository in exact, dependency-light form.