Memory capacity and bandwidth are major bottlenecks in LLM inference, motivating weight compression beyond conventional 4-bit quantization. Vector quantization (VQ) enables approximately 2-bit weight storage but often relies on codebooks incompatible with native FP4 computation. We introduce MXCode (MX-Native Codebook Quantization), a framework bridging ultra-low-bit VQ compression with MicroXcaling (MX)-native FP4 computation. MXCode proposes three strategies: PostScale, which quantizes learned codebooks to MXFP4; PreScale, which extracts MX scales before codebook learning; and PreScale+, which further compresses these scales using VQ. These strategies explore tradeoffs among quantization quality, scale overhead, and codebook granularity. All reconstruct MX-native W4A4 operands without materializing intermediate high-precision weights. We evaluate MXCode on Qwen3 (235B), DeepSeek-R1 (671B), and GLM-5.2 (753B) using the Microsoft MX Emulation Library. MXCode achieves approximately 2 bits per weight with competitive, workload-dependent model quality. On GB300 hardware, experiments with Qwen3 (235B) show approximately 50% lower model-load memory than Native FP4 while maintaining near-Native-FP4 serving throughput. Under memory-constrained prefix reuse, P90 TTFT improves by up to 94.5%. These results demonstrate software-based reconstruction on existing FP4 hardware and inform the development of future MX-native inference systems.
Figures & tables
Format
Block size
Scale
Min. positive scale
Max. finite scale
Optional tensor scale
BPE
E8M0-B32-FP4
32
E8M0
2−127
1.70×1038
–
4.25
E4M3-B16-FP4
16
E4M3
2−9
448
FP32
4.50
E5M3-B16-FP4
16
UE5M3
2−17
114688
FP32
4.50
Table 1: Block-scaled FP4 formats compared in this work. All use E2M1 elements and 8-bit block scales. The reported ranges refer to block scales, and BPE excludes tensor-level scaling overhead.
Figure 2: Aggregate weight SQNR as a function of effective codebook size for different VQ dimensions d . Each point corresponds to a different effective BPE and number of centroids K , indicated by its numeric label. BPE calculation only includes VQ indices. The shaded upper-left region denotes configurations that satisfy both design constraints: SQNR ≥10 dB and LUT size ≤1 KB.
Figure 3: Ablation of FP4 codebook quantization. Each color shows the QBlock-size sweep from full tensor to 64×64 for a VQ/MXCode scheme and datatype. The BF16-centroid baseline is independent of the MX scale format and is shown in gray across all three plots. From left to right, charts shows (a) QBlock-size sweep for E4M3-B16-FP4 and E8M0-B32-FP4. (b) QBlock-size sweep at various scale compression ratios for E4M3-B16-FP4 MXCode-PreScale+ . (c) QBlock-size sweep at various scale compression ratios for E8M0-B32-FP4 MXCode-PreScale+ . Effective storage includes the VQ indices, FP4 codebooks, MX scales, and scale-VQ metadata.
Compute format
E4M3-B16-FP4
E8M0-B32-FP4
Method
Native FP4
MXCode PostScale
MXCode PreScale
MXCode PreScale+
Native FP4
MXCode PostScale
MXCode PreScale
MXCode PreScale+
Weight (BPE)
4.50
2.06
2.56
2.13
4.25
2.25
2.50
2.28
Qwen3 (235B)
MMLU-Pro
82.41 ±0.34
79.18 ±0.36
80.34 ±0.35
80.54 ±0.35
82.02 ±0.34
79.67 ±0.35
79.09 ±0.36
79.00 ±0.36
RULER
95.05 ±0.14
94.16 ±0.15
95.01 ±0.14
95.00 ±0.14
95.13 ±0.13
94.69 ±0.14
94.73 ±0.14
94.83 ±0.14
DROP
88.56 ±0.33
86.98 ±0.34
86.54 ±0.35
87.69 ±0.34
87.96 ±0.33
85.55 ±0.36
87.52 ±0.34
86.35 ±0.35
GSM8K
96.89 ±0.48
96.66 ±0.49
97.12 ±0.46
96.36 ±0.52
96.89 ±0.48
96.82 ±0.48
96.44 ±0.51
96.21 ±0.53
Table 2: W4A4 evaluation across three models. Accuracy and standard errors are reported as percentages. Native FP4 uses W4A4 computation with either the E4M3-B16-FP4 or E8M0-B32-FP4 format; without any VQ or MXCode. Weight storage, measured in BPE, includes VQ indices, FP4 codebooks, and scales, as applicable. Average accuracy weights the ten benchmarks equally.
Figure 4: Per-GPU model-load memory for Qwen3 (235B). MXCode denotes the shared Pre/PostScale FP4 projection backend; the plotted footprint uses PostScale-style codebook. Percentages in black indicate free HBM that can be used by KV-cache. MXCode (E8M0-B32-FP4) & Vanilla VQ (BF16) has similiar footprint to MXCode.
Figure 5: Serving throughput vs. P90 interactivity for 32K-input/1K-output requests on Qwen3 (235B) using single GB300 GPU. Point labels indicate client concurrency, including queued requests. MXCode denotes the shared Pre/PostScale FP4 projection backend.
Method
P90 TTFT (s)
P90 TPOT (ms)
P90 E2E (s)
Native FP4 E4M3-B16-FP4
8.688
27.24
32.52
MXCode E4M3-B16-FP4
0.486 (-94.4%)
20.99 (-23.0%)
21.87 (-32.8%)
MXCode E8M0-B32-FP4
0.477 (-94.5%)
20.56 (-24.5%)
21.43 (-34.1%)
Table 3: 32K/1K prefix-reuse latency using one GB300 per method on Qwen3 (235B) model. Values are means of per-run 90th percentiles after post-warmup repetitions; parentheses show latency reductions relative to Native FP4. MXCode denotes the shared PreScale/PostScale FP4 projection backend.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Scale compression versus coarser scales for E4M3-B16 (top) and E8M0-B32 (bottom). Diamonds use coarser shared scales; triangles use scale VQ at matched compression ratios. Points vary QBlock size, with all representation metadata included in BPE.
Method
MXCode PostScale
MXCode PreScale
MXCode PreScale+
Qblock size
E5M3
E4M3
Δ
E5M3
E4M3
Δ
E5M3
E4M3
Δ
Qwen3 (235B)
Full tensor
7.035
7.046
−0.011
10.349
10.359
−0.010
10.049
10.047
+0.002
2048×2048
7.795
7.798
−0.003
10.363
10.361
+0.002
10.051
10.052
−0.001
1024×1024
8.795
8.784
+0.011
10.384
10.380
+0.004
10.079
10.078
+0.001
512×512
9.342
9.317
+0.025
10.429
10.424
+0.005
10.145
10.142
+0.003
256×256
9.802
9.796
+0.006
10.572
10.571
+0.001
10.327
10.326
+0.001
Appendix
Table 4: Weight SQNR (dB; higher is better) across Qblock sizes for 300 sampled Qwen3-235B expert tensors. VQ uses the input-channel axis with K=256 , d=4 . PreScale+ compresses scales using Ks=256 , ds=8 . E5M3 values are estimates and E4M3 values are proxies. Δ=SQNRE5M3−SQNRE4M3 , computed from displayed values; positive values favor E5M3.
Method
Native FP4
MXCode PostScale
MXCode PreScale
MXCode PreScale+
Benchmark
E5M3
E4M3
Δ
E5M3
E4M3
Δ
E5M3
E4M3
Δ
E5M3
E4M3
Δ
Weight (BPE)
4.50
4.50
–
2.06
2.06
–
2.56
2.56
–
2.13
2.13
–
MMLU-Pro
82.45 ±0.34
82.41 ±0.34
+0.04
79.04 ±0.36
79.18 ±0.36
−0.14
79.75 ±0.35
80.34 ±0.35
−0.59
80.54 ±0.35
80.54 ±0.35
0.00
RULER
95.11 ±0.13
95.05 ±0.14
+0.06
94.31 ±0.14
94.16 ±0.15
+0.15
94.89 ±0.14
95.01 ±0.14
−0.12
94.97 ±0.14
95.00 ±0.14
−0.03
DROP
88.49 ±0.33
88.56 ±0.33
−0.07
86.69 ±0.35
86.98 ±0.34
−0.29
87.71 ±0.34
86.54 ±0.35
+1.17
87.56 ±0.34
87.69 ±0.34
−0.13
GSM8K
97.35 ±0.44
96.89 ±0.48
+0.46
96.59 ±0.50
96.66 ±0.49
−0.07
97.12 ±0.46
97.12 ±0.46
0.00
96.97 ±0.47
96.36 ±0.52
+0.61
Appendix
Table 5: W4A4 evaluation on Qwen3 (235B), comparing E5M3-B16-FP4 and E4M3-B16-FP4. Accuracy and standard errors are percentages. Δ denotes E5M3 minus E4M3 accuracy in percentage points; positive values favor E5M3. Weight storage includes indices, codebooks, and scales, as applicable. Average accuracy weights the ten benchmarks equally.