Sarvam AI fixes a future-token leak in 8-bit GPU attention
In short
- Sarvam AI says the 8-bit attention that NVIDIA's Blackwell GPUs run fast can let a future word quietly change how an earlier word is stored, so a model's earlier predictions can shift. Its new kernel (a GPU program) removes that leak and still trains faster than 16-bit attention at long context.
- The leak comes from a shared scale: in the 8-bit format MXFP8, 32 neighbouring values share one multiplier, and in the value half of attention those 32 values are 32 consecutive tokens.
- On Qwen3-4B at 32K context, Sarvam measured 4.9% higher training throughput and 5.2% lower peak memory than BF16 attention. At 4K context it is 2.1% slower.
- The numbers are the company's own, from a preprint and a blog post. Sarvam did not discover the problem: the chip start-up MatX described it first for a 4-bit format.
0.416% to 0.021% next-token disagreement at 32K, stock vs Sarvam (BF16: 0.015%); +4.9% training throughput vs BF16 at 32K, Qwen3-4B; -5.2% peak memory vs BF16 at 32K (124.9 to 118.4 GiB); -2.1% training throughput vs BF16 at 4K
Can a language model see future words?
It must not. A language model writes text one token at a time, so when it predicts the word after position 47, it may only use positions 0 to 47. During training the model reads a whole passage at once, so it hides the later positions with a causal mask: their attention weight is set to zero.
Sarvam AI, an Indian AI company, says that in MXFP8 attention the mask is not enough. The weights for future tokens are zero, but the values they would multiply still pass through a rounding step first.
What goes wrong in MXFP8 attention?
MXFP8 stores numbers in 8 bits and lets each group of 32 share one power-of-two scale. Attention does two matrix products. In the first, which scores how well each query matches each key, a group is 32 features of one token, so no token is mixed with another. In the second, which blends the value vectors, a group is the same feature across 32 consecutive tokens.
Take query 47. It may read tokens 0 to 47, but the scale for tokens 32 to 63 is picked from all 32 values, including the masked tokens 48 to 63. A large value at position 55 can raise that scale and change how the visible value at position 32 is rounded. Query 47 reads the changed value even though position 55 has zero weight.
Not every scale change matters. Sarvam notes that a power-of-two shift often keeps a normal 8-bit value intact; small values near zero are most at risk, where a shift can round them to zero.

Where the leak sits: the red blocks on the diagonal are the only places where one shared scale covers both visible and future tokens. For query 47, tokens 32 to 63 share a scale although only 32 to 47 are visible. Patel, Jain and Bhalla (Sarvam AI), arXiv 2611.36044, Fig. 1, CC BY 4.0.
What to notice: Blue blocks are fully visible and safe; only the red boundary block per query needs the special handling.
How does the fix work?
Only one 32-token block per query straddles the mask, the "boundary block". Blocks fully before it are safe and stay on the normal fast path. The cost of the correction therefore grows with sequence length, while the main work, which grows with its square, is untouched.
For the boundary block, Sarvam gives every token its own scale, computed from that token alone, and folds the scale into the attention weight, so the product is unchanged before rounding. The hardware's shared scale is then a fixed constant that future tokens cannot move. Future entries are masked before the scales are chosen. The two partial results are merged using the softmax statistics.
The idea of treating the boundary separately comes from MatX, which showed the problem for MXFP4 and computed the boundary without quantization. Sarvam says its change is to keep the boundary product in native MXFP8 too, so both forward products stay 8-bit.
What did Sarvam measure?
The paper first shows the leak in released models. Multiplying future values by 2^10 on purpose, which the authors call a deliberate stress test, changed the final outputs at every at-risk position under stock MXFP8, in both Qwen3-4B-Base and Qwen3-14B-Base at 4K and 32K. The BF16, MatX-style and Sarvam versions gave bitwise-identical outputs.
In a second test the model predicts the next token once from the full text and once from only the prefix. Some disagreement is normal, because the two runs use different matrix shapes. Under stock MXFP8, the top prediction differed in 0.39% to 0.50% of 163,840 comparisons per setting, against 0.013% to 0.059% for BF16 and 0.013% to 0.035% for the two causal versions. At 32K on Qwen3-4B-Base, Sarvam's kernel brings 0.416% down to 0.021%, near BF16's 0.015%.
Training uses a BF16 backward pass on dequantized (expanded back to 16-bit) copies of the saved values, which adds no new scale shared across tokens. The benchmark trained Qwen3-4B on 16 B200 GPUs, changing only the attention:
Against stock MXFP8 the kernel is 1.8% faster at 32K. Against the paper's own implementation of the MatX-style correction (17,111 tokens/s, 136.2 GiB), Sarvam's kernel is 3.0% faster at 32K and uses 13.1% less peak memory; that comparison uses Sarvam's own build of the MatX-style recipe. At 4K, the fixed costs of preparing and merging are not recovered, hence the 2.1% loss.
Does it help inference too?
Sarvam extends vLLM's paged KV cache, the memory of earlier keys and values, to store 8-bit blocks. Prefill, reading the prompt, uses the same kernel. In decoding, the new token is handled in BF16 and merged. If a new value exceeds a block's scale, the stored values in the open block are rescaled.
On one B200 with one request at a time and 128 generated tokens, Qwen3-4B decoded 5.2% to 14.7% faster than BF16 attention with an FP8 cache at 4K to 32K. Against vLLM's FP8 attention with FP8 cache the gain is 3.8% to 9.9%. Qwen3-14B gains 0.5% to 4.2% over that path, and the blog says only the 16K gain exceeds the roughly 3% run-to-run variation.
What is not shown
- All results are Sarvam's, on Qwen3 models, B200 GPUs and C4 training data; training ran about 5 billion tokens. Larger models and long production runs are not tested.
- Training with stock MXFP8 did not cure the leak: after 5 billion tokens it still had 4.2 times as many prediction flips as Sarvam's kernel at 4K and 3.6 times at 32K. The paper does not show how much the leak harms model quality.
- The backward pass is BF16, so the recipe is not 8-bit end to end.
- Sarvam has opened pull requests to NVIDIA's cuDNN frontend and TransformerEngine and to vLLM. We did not check whether they were merged.
Terms in plain English
Official channels of Sarvam AI: Website · LinkedIn · X · YouTube
Sources
- Ensuring Causality in MXFP8 Attention, Sarvam AI blog, 2 Dec 2026
- A Masked Future Is Not a Hidden Future: Keeping MXFP8 Attention Causal, arXiv, 26 Nov 2026 (Patel, Jain, Bhalla)
- Leaky quantization, MatX, 9 Jan 2026 (cited by the paper; not read by us)
Sources
- Ensuring Causality in MXFP8 Attention
- A Masked Future Is Not a Hidden Future: Keeping MXFP8 Attention Causal
- https://matx.com/research/leaky_quantization
Related stories
- Anthropic plans an applied AI lab in India for early 2027
- Gnani AI launches Evon v3.5, an API-only Indian-language LLM
- CoRover releases a gated Kannada speech-to-text model
- Kirandul mine-waste landslide ran 2.5 km, an expert says
- RAPP-8, India's fourth home-built 700 MW reactor, reaches criticality
- India opens a ₹400 crore call for non-lithium grid batteries