Causal attention must prevent future tokens from influencing earlier predictions, including during parallel training and prompt prefill. Its cost grows quadratically with sequence length, making lower-precision arithmetic an attractive way to accelerate these computations. MXFP8 enables fast eight-bit matrix products on NVIDIA Blackwell GPUs, but sharing quantization scales across tokens can break causality. In Transformer Engine's stock MXFP8 attention, a masked future token can change how an earlier value is rounded and alter an earlier prediction. We demonstrate this dependency in released language models and present a causal attention kernel that removes it. Within value blocks containing both visible and future tokens, our kernel uses token-local scales and folds them into the corresponding attention weights, retaining native MXFP8 for both forward matrix products. We support training with a causal dequantized-input backward and inference with an MXFP8 KV cache. On Qwen3-4B-Base at 32K context, our kernel reduces full-sequence versus prefix disagreement on the most likely next token from 0.416% to 0.021%, close to the BF16 reference of 0.015%. In end-to-end Qwen3-4B training at 32K, our recipe improves throughput by 4.9% and reduces peak memory by 5.2% relative to BF16. For single-request inference, it improves Qwen3-4B decode throughput by 3.8-9.9% over vLLM with FP8 attention and an FP8 KV cache at 4K-32K context, with broadly comparable throughput on Qwen3-14B.
Figures & tables
Figure 1: Shared-scale leakage in MXFP8 attention. (a) The attention matrix, shown for 96 token positions, is partitioned into 32×32 blocks. Blue blocks use fully visible value groups. Red diagonal blocks mark where shared scales can mix visible and future values. Hatching marks masked entries above the dashed causal diagonal, where Pi,j=0 . (b) For query i=47 , the transposed value matrix highlights feature r . Tokens 32–63 share scale s1,r , although only tokens 32–47 are visible to this query. Future values at positions 48–63 can therefore change the dequantized visible values Vj,r and, through them, the output O47,r . Here Vj,r denotes the FP8 payload multiplied by its scale; it need not equal the original value Vj,r . Causal masking blocks future tokens’ direct contribution but not this indirect dependency.
Figure 2: Causal MXFP8 attention for query i=47 . The transposed value matrix shows the scale groups used by the two kernels, which read separate value representations. The completed-block kernel shares each feature’s scale s0,r across visible tokens 0–31. The boundary kernel instead computes a scale sjV across the features of each token at positions 32–47 and folds it into the unnormalized attention weights pi,j . The folded-weight scale siR uses only visible boundary entries; the value operand uses a fixed scale of 1/256 . Masked tokens 48–63 therefore cannot affect these scales. Darker outlines highlight one scale group of each type; feature rows are schematic.
Model
Context
Changed / total at-risk pairs
Median max. ∣Δlogit∣
Mean ∣ΔNLL∣
4B
4K
7,936 / 7,936
0.88
0.054
32K
15,872 / 15,872
1.29
0.075
14B
4K
7,936 / 7,936
1.13
0.041
32K
15,872 / 15,872
1.41
0.052
Table 1: Fixed-shape suffix amplification under stock MXFP8 on Qwen3-Base. Counts are position–cut pairs. The logit column reports the median per-cut maximum absolute change over prefix positions and vocabulary entries, excluding block-aligned cuts. NLL reports the mean absolute change over at-risk positions, in nats. All difference metrics are zero for BF16 and both causal kernels.
4K
32K
Method
Flips
KL
Flips
KL
Qwen3-4B
BF16
97
3.15e-5
25
6.71e-6
Stock MXFP8
634
3.35e-4
681
4.65e-4
BF16 boundary
51
2.81e-5
36
2.30e-5
Ours
58
3.27e-5
34
2.28e-5
Table 2: Full-sequence versus prefix consistency on released Qwen3-Base checkpoints, with 163,840 comparisons per setting. Flips are top-1 disagreement counts; KL is mean KL(pfull∥pprefix) in nats, written in scientific notation. Lower is better. Bold and underline mark the best and second-best MXFP8 variants; BF16 is the reference.
Attention latency (ms)
Full training
Context
Method
Forward
Backward
Whole
Tokens/s/GPU
Peak GiB
4K
BF16
0.461
1.376
2.059
33,398
110.0
Stock MXFP8
0.612
1.769
2.213
33,056
110.3
BF16 boundary
0.760
1.542
2.430
32,258
120.2
Ours
0.744
1.448
2.298
32,702
111.3
32K
BF16
6.625
19.644
26.279
16,805
124.9
Table 3: Qwen3-4B systems evaluation. Attention latencies are measured on one B200, including preparation and backward preprocessing. Forward, backward, and whole attention are timed separately; their measurements need not be additive. Full-training throughput and peak memory are measured on 16 B200 GPUs. Bold and underline mark the best and second-best MXFP8 recipes; BF16 is the reference. BF16 boundary denotes the MatX-style correction. Stock MXFP8 exhibits future-token dependence.
Attention/cache
4K
8K
16K
32K
Qwen3-4B
BF16/BF16
345.7
318.3
301.3
274.8
BF16/FP8
345.7
312.8
298.5
272.1
FP8/FP8
331.0
327.3
315.0
300.7
Ours
363.7
345.5
334.0
312.2
Gain
+9.9%
+5.6%
+6.0%
+3.8%
Table 4: Single-request decode throughput (tokens/s) on one B200, with BF16 weights and projections. Baseline labels give vLLM attention/KV-cache precision. Gain is our throughput increase over FP8/FP8.
4K
32K
Method
Loss
Flips
Loss
Flips
BF16
3.0137
46
3.0756
15
Stock MXFP8
3.0150
123
3.0774
64
BF16 boundary
3.0166
25
3.0682
19
Ours
3.0129
29
3.0722
18
Table 5: Qwen3-4B after 5B training tokens. Loss uses each checkpoint’s training attention variant; flips count full-sequence versus prefix top-1 disagreements across 163,840 comparisons. Lower is better. Bold and underline mark the best and second-best MXFP8 recipes respectively with BF16 as the reference.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Page rows (128 bytes each)
Contents
Layout or scale granularity
0–127
K payloads, E4M3
Token by feature
128–255
V payloads, E4M3
Feature by token
256–259
K scales, E8M0
Four scales per token
260–263
V scales, E8M0
128 scales per 32-token block
Appendix
Table B1: Byte layout of a cache page for one KV head with head dimension 128. Each row contains 128 bytes.
Method
dQ
dK
dV
Stock MXFP8
6.63%
6.58%
4.99%
Ours
5.23%
5.21%
3.37%
Appendix
Table C1: Pooled gradient relative L2 errors against BF16 over 36 synthetic cases.