HiFloat4 Format for End-To-End Reinforcement Learning Post-Training of Large Language Models

Hei Yi Mak, Shadan Golestan, Hoang Le, Mehran Taghian Jazi, Yunke Peng, Yaoyuan Wang, Junsong Wang, Tianchi Hu, Fengchen He, Guipeng Hu, Tanzila Rahman, Anandharaju Durai Raju

TL;DR

Training Large Language Models to reason via Reinforcement Learning (RL) is notoriously expensive, and shrinking the math down to ultra-fast 4-bit precision (FP4) usually breaks the learning process. This paper achieves the first end-to-end 4-bit RL post-training—meaning no 16-bit safety nets anywhere—by pinpointing a surprising culprit: activation outliers during text generation squash normal values to zero. With a lightweight sparse correction trick and a hierarchical 4-bit format (HiFloat4), the authors get 4-bit RL performing nearly identically to 16-bit precision at a fraction of the theoretical compute cost.

What Problem Does This Paper Address?

Teaching LLMs to solve complex math or write code relies heavily on Reinforcement Learning (like GRPO, a popular policy-gradient algorithm). Each RL step is a two-act play: a rollout phase, where the model generates long chains of thought, and a training phase, where the model scores those thoughts and updates its weights. Autoregressively generating all that text makes the rollout phase a massive computational bottleneck.

Quantization—shrinking numbers from 16-bit (BF16) down to 8-bit or 4-bit floating point (FP4)—speeds up matrix multiplications and slashes memory use. While prior work managed 8-bit RL, or 4-bit rollouts propped up by high-precision gradient adapters (like LoRA), true end-to-end FP4 RL—where forward and backward passes in both rollout and training run in 4-bit—has remained elusive because extreme quantization destabilizes optimization. Furthermore, standard offline quantization fixes fail here: as the RL policy updates, its activation statistics constantly drift, rendering static calibrations stale almost immediately.

Methods

Instead of relying on offline calibration, the authors combine a specialized number format with an on-the-fly error-catching mechanism applied strictly where it matters most.

  • Format Foundations (Standard): They test two block-scaled 4-bit formats: open-standard MXFP4 (which shares one scale factor per 32 elements) and HiFloat4 (HiF4), which uses a three-level hierarchical scaling scheme over 64-element blocks to preserve both dynamic range and fine resolution.
  • Rollout Residual Quantization / Rollout-ResQ (Novel): During the rollout forward pass, extreme outlier values in activation tensors stretch the quantization scale, causing smaller values to underflow to zero. Rollout-ResQ catches this lost information:
  • It quantizes the activation tensor $X_\ell$ into $Q(X_\ell)$ and calculates the leftover quantization error, or residual: $\Delta X_\ell = X_\ell - Q(X_\ell)$.
  • It quantizes that residual into FP4 as well: $Q(\Delta X_\ell)$.
  • To avoid doubling the matrix multiplication cost, it applies a hardware-friendly 2:4 semi-structured sparsity pattern ($S_{2:4}$), keeping only the 2 largest values out of every 4 elements in the residual.
  • The final layer output adds the standard dense FP4 multiplication to this lightweight sparse residual multiplication, while the training phase runs in standard, unassisted FP4.
Figure 3: Rollout-ResQ overview.

Datasets

No new benchmarks are introduced; the authors use established mathematical reasoning datasets:

  • Training: Qwen2.5-3B is trained on GSM8K, while Qwen2.5-Math-7B is trained on the more challenging DAPO-Math-17K dataset.
  • Evaluation: Models are evaluated on GSM8K-test, Math-500, AIME-2024, AIME-2025, and AMC-2023.

Key Insights and Ideas

  • The bottleneck is rollout generation, not gradient updates: Intuitively, you might expect 4-bit backward passes to ruin weight updates. Instead, keeping rollouts in BF16 while running training in FP4 recovers almost 100% of full-precision accuracy (86.88% vs. 86.96% on GSM8K). The degradation comes almost entirely from quantizing activations during the rollout phase.
  • "Zero collapse" from outliers: Because block-scaled FP4 sets its scale based on the largest number in a block, a single massive activation outlier forces the scale to become huge, squashing the rest of the block's numbers to zero. In early transformer layers, post-quantization sparsity spikes above 80%!
Figure 1: Percentage of zero values in activa- tion tensors of each layer before quantization (BF16) and after quantization (HiF4, MXFP4) with GSM8K and Qwen2.5-3B.
  • Upgrading training precision alone makes things worse: If you run rollouts in FP4 but "help" the model by keeping the training policy in crisp BF16, GSM8K accuracy plunges from 82.03% (all-HiF4) down to 78.01%—and crashes to 50.57% under MXFP4! Mixing precisions creates a severe numerical mismatch (high KL divergence) between the policy generating text and the policy learning from it.
  • Residuals love sparsity: Quantized residuals are much more uniform and robust to 2:4 pruning than primary activations, incurring minimal error while unlocking sparse tensor core acceleration.

Key Results

  • Closing the BF16 Gap (3B Model): Across 3-seed runs on Qwen2.5-3B (GSM8K-test), naive HiF4 drops accuracy by 3.59% below BF16 (82.97% vs. 86.56%). Adding Rollout-ResQ-S2:4 shrinks that gap to just 1.39% (85.17%), and cuts the Math500 gap roughly in half (from -13.87% to -6.94%).
  • Format Ceiling Matters: On single-seed GSM8K runs, Rollout-ResQ-S2:4 narrows MXFP4's gap to BF16 from 13.65% down to 5.31%—a massive rescue, yet still trailing HiF4's 1.06% gap. HiF4's hierarchical scaling sets a fundamentally higher ceiling for extreme-precision RL.
  • Scaling to Harder Math (7B Model): On Qwen2.5-Math-7B (DAPO-Math-17K), Rollout-ResQ-S2:4 with HiF4 stabilizes training and outperforms all outlier-mitigation baselines, boosting AIME24 accuracy from 16.15% (naive HiF4) to 20.73% (vs. 27.29% BF16) and Math500 from 59.40% to 68.95% (vs. 74.59% BF16).
  • Theoretical Speedup: Assuming hardware where FP4 runs $4\times$ faster than FP16, Rollout-ResQ-S2:4 achieves a theoretical $2.67\times$ compute speedup over 16-bit GEMMs (compared to $2\times$ for a dense residual fallback).

Limitations and Future Work

  • Simulated Hardware: Because native HiF4 hardware wasn't available to the authors, all experiments used software-simulated FP4 quantization. The simulation overhead prevented measuring real-world wall-clock speedups and limited experiments to 3B and 7B models.
  • Fixed Sparsity: The study exclusively tests a 50% sparsity ratio (such as 2:4 semi-structured sparsity) to align with existing hardware kernels; exploring dynamic or varied sparsity levels to map out the broader accuracy-efficiency Pareto frontier is left for future work.

Summary updated

Abstract

We present, to our knowledge, the first end-to-end FP4 RL post-training, in which both the rollout and training policies, including their forward and backward passes, operate at 4-bit precision. A systematic study reveals that the dominant source of degradation in FP4 RL is not training-side quantization error but rollout activation quantization: outliers stretch the dynamic range so far that a large number of activation values underflow to zero under FP4. Counterintuitively, restoring the training policy to higher precision while keeping the rollout in FP4 makes accuracy worse than full FP4 baseline, exposing rollout–training mismatch as the principal failure mode and ruling out standard pretraining-style fixes. We address this with Rollout Residual Quantization (Rollout-ResQ): a single residual correction term constrained to a hardware-friendly sparsity pattern, added only to the FP4 rollout matmul — a lightweight correction that recovers most of the precision lost to outlier-driven underflow without inflating the rollout’s compute footprint. On Qwen2.5-3B, Rollout-ResQ paired with the HiFloat4 (HiF4) format — whose three-level hierarchical scaling preserves resolution under FP4’s tight 4-bit budget — closes the accuracy gap to BF16 from 3.59% to 1.39%. bringing fully quantized FP4 RL within close reach of full precision. Applied to the open-standard MXFP4, the same recipe narrows the gap from 13.6% to 5.3%, revealing that FP4 format choice is a key factor that determines the ceiling on recoverable accuracy. The experimental results on Qwen2.5-Math-7B further confirm the recovery benefits of Rollout-ResQ with HiF4. Together, these results establish HiF4 as the enabling format for end-to-end FP4 RL post-training, and Rollout-ResQ as the activation- side mechanism that makes the gap to BF16 closable.
BibTeX
@inproceedings{mak2026hifloat,
  author = {Hei Yi Mak and Shadan Golestan and Hoang Le and Mehran Taghian Jazi and Yunke Peng and Yaoyuan Wang and Yao Wang and JUNSONG WANG and Tianchi Hu and Fengchen He and Guipeng Hu and Tanzila Rahman and Anandharaju Durai Raju},
  title = {{HiFloat4 Format for End-To-End Reinforcement Learning Post-Training of Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=BDwmB9cg99},
}
Figure