Skip to content

Sparse Features, Sparse Experts: Two Ways to Cut the Attention and Serving Bill

#mixture-of-experts #sparse-attention #rope #inference-optimization #llm-serving #flash-attention

The dot product you don't have to finish ​

Attention has one job that scales badly: score every query against every key. At 128K context on a single request that's about 16 billion query-key pairs before the model produces anything useful. Two recent reports attack the bill from different ends. HiSA (arXiv 2611.26363) makes the query-key dot product itself cheaper by computing only part of it. Beam (arXiv 2611.26358) leaves attention alone and makes each token touch a small fraction of a very large model.

The split matters because the two budgets fail differently. Prefill is bound by FLOPs. Decode is bound by bytes moved out of HBM. HiSA cuts FLOPs. Beam cuts bytes. Neither rescues you on the other axis, and knowing which one your traffic is stuck on decides whether either paper applies to your deployment at all.

HiSA cuts the feature axis, not the token axis ​

Almost every sparse attention method you've read about drops tokens. Sliding windows, block-sparse patterns, learned top-k retrieval: they all decide that query i doesn't need key j and skip the entire dot product for that pair. The feature dimension gets left alone. HiSA flips the axis. Query and key projections stay intact, every query still meets every key, and the saving comes from computing only some of the dimensions inside each dot product. In the paper's from-scratch training runs that works out to about a third of the query-key products, and the model scores better than the dense baseline rather than worse.

The mechanism lives in RoPE. Rotary embeddings rotate each 2D pair of the query and key by an angle proportional to token position, with a different frequency per pair. Low-index pairs spin fast, high-index pairs spin slowly. Because the dot product of two rotated vectors depends only on the relative angle, each frequency band contributes a term that oscillates with distance at its own rate. Fast bands average toward zero for distant tokens and carry mostly local information. Slow bands carry the long-range signal.

HiSA uses that structure to decide, for a given query position and key position, which bands to compute. Nearby pairs keep more slices. Distant pairs keep fewer. The rule is static and parameter-free: no router, no learned predictor, no auxiliary loss. From the report, the mask is a function of relative position and frequency band alone, which means you can precompute the whole bitmap once and hand it to the kernel as a schedule.

That property is why this is easier to ship than most sparsity ideas. Token sparsity needs an index list that changes per query at runtime, which is where irregular memory access eats the gains. Feature sparsity with a positional rule needs nothing at runtime. The authors extended it to FlashAttention-3 for training and inference, so the pattern survives tiling. The catch is that the dropped slices have to be contiguous and aligned to the kernel's dimension tile. A mask that picks scattered individual dimensions saves FLOPs on paper and none on hardware.

What a third of the math is worth at decode time ​

I'd temper expectations here. The QK matmul is one of three big consumers inside a transformer block, and it isn't always the top one.

WorkloadDominant costWhat HiSA buys
Prefill at 32K contextQK and PV matmuls, quadratic in lengthReal savings on the QK term, up to roughly 3x fewer products
Decode, batch 1, 128K contextKV cache bytes streamed from HBMShorter reduction loops, keys still load; smaller win than the FLOP count implies
Short context, 2KMLP weightsClose to nothing, the score matmul is a rounding error
TrainingAttention score memory plus all three matmulsLower activation footprint for scores, which often sets the batch size

The memory claim deserves the same scrutiny. Dropping feature slices reduces the QK score buffer and the reduction loop. The KV cache is a different story: a key slice that a nearby query ignores is still needed by some other query position, so the stored tensor doesn't shrink proportionally. If your decode step is already sitting at 90% HBM utilization on cache reads, HiSA won't rescue you. Grouped-query attention, cache quantization, and paged attention come first, in that order.

Quick Take: HiSA and Beam attack opposite ends of one bill, HiSA trims the math inside each score while Beam trims how many weights each token touches, and neither substitutes for fixing a KV cache that's already your bottleneck.

Beam: frontier behavior at 23.4B active parameters ​

Beam is a sparse mixture-of-experts model: 501.3B parameters total, 23.4B active per token. That's 4.67% of the weights touched on any single forward pass. The rest sit in HBM and get read by other tokens.

MoE math is simple to state and annoying to serve. Swap the FFN for N experts, route each token to the top few, and total parameters grow while per-token cost stays flat. Pretraining scales with total parameters. Inference scales with active ones. You pay in memory (all 501.3B has to be resident) and in the router plus the all-to-all shuffle that moves tokens between experts, latency a dense model never pays.

SpecValueWhat it means in practice
Total parameters501.3BAround 500 GB of weights at FP8, so multi-node or an 8-accelerator box before you cache anything
Active per token23.4B (4.67%)Weight reads per token drop by roughly 20x against a dense model of the same size
Pretraining tokens23.8T47 tokens per parameter, well past compute-optimal, the shape you pick when serving cost dominates
Context window1M tokens via two-stage midtraining on verifiable dataLong enough to drop in a repo; the KV cache becomes the memory problem, not the weights
RL post-training10.5K GB300 GPUs, 100M+ rollouts, 4 weeksScores kept climbing with RL compute and the report shows no plateau
Draft modelDFlash 2, 1.93B parametersAbout 8% of active cost per speculative step, cheap enough to speculate aggressively
QuantizationFP8 and NVFP4Halves weight bytes again versus FP8 once you go to 4-bit
Safety88.9% refuse or pivot on harmful, 81.5% comply on harmlessTwo ends of one dial, raising refusal lowers compliance

Forty-seven tokens per parameter is the number to underline. Chinchilla-style scaling says roughly 20 tokens per parameter to reach a given loss. Beam trains past twice that ratio. It's a rational trade when you serve the model a few billion times and pay for training once, and it's why MoE plus heavy overtraining has become the default recipe at the frontier.

The safety figures follow the same logic. An 88.9% refusal or pivot rate on harmful requests is the headline, and the report notes it's the highest among open-weight models on the Pareto frontier. The cost shows up in the other number: 81.5% compliance on harmless requests means roughly one in six benign prompts gets pushed back on. In an agentic loop, a blocked benign tool call doesn't degrade the answer, it breaks the run.

Router, drafter, and the two ways to speed up decode ​

Speculative decoding is where Beam's numbers get interesting. A four-token proposal from a 1.93B drafter costs about 0.33 of a target step, because four forwards at roughly 8% of the active parameter cost each. The verify pass costs one full step. So a cycle spends 1.33 target steps to emit 1 + a tokens, where a is the average accepted count.

Accept one token per cycle and you're at 1.5x. Accept two and you're near 2.3x. Accept none and you're paying a 33% tax for nothing. On coding and agentic rollouts, the data the drafter was tuned on, acceptance should be high. On a prompt distribution it never saw, the break-even point is one accepted token in four, which is a low bar but not a zero bar.

The bandwidth bill for 23.4B active parameters ​

Here's the arithmetic that explains the "3-4x less inference compute" claim. At batch 1, decode speed is set by how many bytes of weights you read per token. Assume 8 TB/s of HBM bandwidth on a B200 or GB300 class part, perfect overlap, no batching gains.

ConfigurationWeight bytes per tokenms per token at 8 TB/sTokens per second, one stream
Beam, FP8, 23.4B active23.4 GB2.9342
Beam, NVFP4, 23.4B active11.7 GB1.5684
Dense 70B, FP870 GB8.8114
All 501.3B active, FP8501.3 GB62.716

That last row is the point. If Beam were dense at its total parameter count, a single token would take 62.7 ms of pure weight streaming. Sparsity turns that into 2.9 ms, a 21x gap. Batching amortizes weight reads across sequences and shrinks the gap toward compute limits, which is why the report's measured advantage is 3-4x and not 20x. Throughput gains from sparsity always look biggest at low batch.

Key numbers

  • 2.9 ms per token: weight-read time at 23.4B active in FP8
  • 342 tokens per second: single-stream ceiling implied by that read
  • 62.7 ms per token: the same math with all 501.3B parameters active
  • 1.33 target steps: cost of a four-token speculative cycle with a 1.93B drafter
  • 1 token in 4: average acceptance needed for speculation to break even

Where the numbers come from ​

Every figure above traces to one of three places, and none of them are my measurements.

The HiSA results (partial dot product at about one third of the query-key products, better than dense baseline, FlashAttention-3 extension, smaller decode memory footprint) come from arXiv 2611.26363v1, with code at github.com/ambroise-b/hisa. The Beam specs (501.3B total, 23.4B active, 23.8T tokens, 1M context, 10.5K GB300s, 100M+ rollouts, DFlash 2 at 1.93B, FP8 and NVFP4, the 88.9%/81.5% safety split) come from the Beam technical report. The millisecond and tokens-per-second columns are arithmetic on the active parameter counts with a stated 8 TB/s bandwidth assumption, not benchmark results, so treat them as ceilings.

What tripped me up ​

I cloned the HiSA repo expecting the published speedups to show up on a workstation. They didn't, and the reasons were instructive. The FlashAttention-3 path wants Hopper, so on anything older you fall back to the reference implementation and the kernel-level wins disappear. The masked dimension slices also have to line up with the kernel's tile width. When I let the mask pick arbitrary dimensions, the profiler showed the same number of executed tiles, just with more of them zeroed out. Aligning the sparsity granularity to the tile granularity was the whole difference between a win and a wash.

The other thing I ran into is that most of HiSA's benefit lives where you'd expect: long context, large batch, prefill-heavy traffic. On a 2K-token chat workload my timing noise was bigger than the effect.

Beam is a different kind of hard to evaluate. The 10.5K GB300 RL campaign is not something anyone outside a hyperscaler will reproduce, so the artifacts that matter for practitioners are the checkpoint, the quantization recipe, and the drafter. What I'd actually want to test is the drafter's acceptance rate on my own traffic, because that single number decides whether speculative decoding is free or a tax.

Common Pitfalls ​

Measuring QK FLOPs and calling it latency. A 3x cut in query-key products shows up as a 3x cut in one matmul, and that matmul might be a fifth of your prefill and less of your decode. Profile at your real context length and batch size before you budget a training run.

Assuming the KV cache shrinks with the score buffer. The positional rule drops feature slices per query-key pair, and a slice ignored by one query is still needed by another. Cache work stays on the critical path.

Treating active parameters as the whole cost. 23.4B active is a compute and bandwidth number. It says nothing about the 500 GB of weights you have to keep resident, the router imbalance that idles hot experts, or the all-to-all that dominates at small batch. Size the cluster for total parameters and the network for expert parallelism.

Turning on the drafter without checking acceptance on your domain. DFlash 2 was tuned on coding and agentic rollouts. At a 1.93B cost against 23.4B active, a four-token cycle only needs one accepted token to break even, but a drafter that mostly misses still adds 33% to every step.

Reading the safety number in isolation. 88.9% refusal and 81.5% compliance are two settings of one dial. If you tune toward the refusal figure, agentic workloads pay for it in broken loops, and the report's own Pareto claim is about balance, not a free win.

One Thing to Remember ​

Sparsity only pays when the pattern matches the hardware. HiSA's value isn't the one-third number, it's that a positional mask can be precomputed and tiled, so the kernel actually skips work instead of multiplying by zero. Beam's value isn't the 4.67% activation ratio, it's that 23.4B active parameters fit a weight-read budget while 501.3B of capacity sits in memory. Get the granularity wrong on either one and you've built an expensive way to compute the same thing.

The Bottom Line ​

If your serving profile says QK matmuls dominate at long context, HiSA is worth a from-scratch training run, but only if your kernel tile width matches the sparsity granularity. If the profile says KV cache reads dominate, skip it and fix the cache with GQA, quantization, and paging first, because HiSA won't reduce the bytes you stream.

If you're picking a model for coding or agentic loops and you can afford a node with roughly 500 GB of FP8 weights resident, Beam gives you dense-70B-class weight-read costs with capacity 7x larger, plus a drafter that pays for itself above one accepted token in four. Budget for the total parameter count, not the active one.

One thing to watch: the 1M context window and the 1.93B drafter are coupled. If DFlash 2 gets retrained for general-domain traffic, speculative decoding becomes close to free at small batch, and short-context agentic serving turns into a bandwidth problem with a solved compute side.