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.
We introduce XFP, a dynamic weight quantizer for LLM inference that inverts the conventional workflow: the operator specifies reconstruction quality floors on per-channel cosine similarity (one strict floor for attention and shared experts, one lazy floor for routed-expert MoE); XFP determines codebook size, outlier budget, and packing per layer automatically -- no Hessian, no calibration data, no manual bit-width selection. Each weight matrix is decomposed into a sparse fp16 outlier residual and a dense sub-byte index tensor into a per-group learned codebook. Two storage modes share one auto-select frontend and one fused decode kernel: V2 (per-channel Lloyd) and V2a (shared library of L=32 codebooks per layer). On Qwen3.5-122B-A10B under V2, XFP reaches 138 tok/s single-stream decode on workstation hardware (RTX PRO 6000 Blackwell, TP=2) at 94.49% GSM8K strict-match (3 seeds, n=3957), and is 49% faster than Marlin INT4 at TP=1. For models that do not fit in the target memory envelope, we present the H-Process: a quality-driven iteration over the two cosine thresholds that finds the operating point at which the model just fits while still producing sensible output. Three constraints define its search space: the operator-set thresholds, an OOM boundary at quantize-on-load, and a garbage boundary in generation (cosine similarity steers; benches verify). On Qwen3.5-397B-A17B (512 routed experts/layer), the H-Process fits the full expert population into 2x96 GB at ~3.4 effective bits and delivers 100.9 tok/s long-output decode at 66.72% GSM8K strict-match on the full 1319-problem set (single seed at submission; multi-seed evaluation in progress), exceeding INT4 with routed-expert pruning on memory, throughput, and accuracy simultaneously.
4-bit quantization enables efficient LLM inference, but suffers from significant accuracy degradation due to outliers. Prior work addresses this problem via data rotation or mixed-precision integer quantization, but often relies on software-managed scaling and frequent dequantization, incurring substantial overhead. Microscaling formats, such as MXINT, eliminate these inefficiencies by encoding scales in hardware, yet remain incompatible with rotation-based methods. Our analysis reveals that outliers vary in severity, from rare extremes to frequent mild deviations, and that quantization sensitivity is unevenly distributed across layers and columns. These insights motivate a fine-grained, sensitivity-guided approach. We introduce MXSens, a training-free method that assigns mixed mantissa bitwidths (4/6/8) based on column- and layer-wise sensitivity, naturally leveraging the block-wise structure of MXINT. MXSens outperforms state-of-the-art quantization methods across a range of models and tasks. Under the W4A4KV4 setting, MXSens achieves perplexities of 3.77 and 7.63 on LLaMA-2-70B and LLaMA-3-8B, respectively, substantially improving over existing baselines on WikiText-2. Our work establishes a new balance between accuracy and resource efficiency for LLM quantization.
Simla Burcu Harma, Danila Mishin, Zhengyuan Su +7
EcoCloud, EPFL · Tsinghua University · MangoBoost Inc. +2
Quantizing large language models (LLMs) to low-precision floating-point representations is central to efficient deployment, yet applying a single bit-width uniformly across all layers is sub-optimal in terms of both performance and accuracy. This work introduces dMX, a differentiable mixed-precision quantization framework for learnable floating-point bit-width assignment. We study its application for the microscaling floating-point (MXFP) family of data types defined by the Open Compute Project (OCP) standard. The per-layer bit-width assignment is formulated as a continuous optimization problem in which each layer's floating-point format format is parameterized by a scalar parameter, folding the multi-variate design space into a single learnable offset. During training this offset takes continuous values, avoiding sudden oscillations between discrete quantization formats. A temperature-based annealing schedule progressively discretizes the learned offsets, ensuring that the final configuration maps to hardware-compatible MXFP formats without abrupt transitions between training and inference behavior. A target-aware regularization term steers the average bit-width toward a user-specified budget, serving as a coarse-grained proxy for inference cost and balancing model quality against deployment efficiency. We performed experiments on different families of LLM, such as Llama, Qwen3, and SmolLM2, evaluating perplexity on WikiText-2 and accuracy on four zero-shot reasoning benchmarks. Across these settings, dMX consistently yields Pareto-dominating models and improves over Kullback-Leibler (KL) divergence-based layer-selection heuristics, efficiently navigating trade-offs between model quality and average bit-width.
Giuseppe Franco, Ian Colbert, Pablo Monteagudo-Lago +2