# Optimizing Large Language Model Training Using FP4 Quantization

- **ID:** 565
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2501.17116
- **Authors:** Ruizhe Wang, Yeyun Gong, Xiao Liu, Guoshuai Zhao, Ziyue Yang, Baining Guo, Zhengjun Zha, Peng Cheng
- **Venue:** arXiv / Microsoft Research Asia / University of Science and Technology of China
- **Published:** 2025
- **Tags:** fp4, quantization, dge, occ, mixed-precision, llama2, dclm, icml, microsoft, e2m1
- **Topics:** quantization, FP4 training, mixed precision
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/565

## Summary

First from-scratch FP4 LLM pretraining: Differentiable Gradient Estimator (DGE, k=5) corrects E2M1 weight grads vs STE, and Outlier Clamping and Compensation (OCC, α=0.99 plus a ~2% sparse residual) keeps activations from collapsing. Mixed-precision W4A4 GeMM simulated on H100 FP8 cores with token-wise activation and channel-wise weight scaling. LLaMA-2 1.3B/7B/13B on 100B DCLM tokens: train loss 2.55/2.17/1.97 vs BF16 2.49/2.07/1.88; zero-shot avg 53.13/54.42/54.95 vs 53.23/53.87/54.44. Direct W4A4 diverges. ICML 2025. Framework https://aka.ms/MS.AMP (Azure/MS-AMP).

## Attributes

- **Purpose:** Train LLMs in FP4 (E2M1) GeMM with a differentiable weight estimator and activation outlier compensation
- **Scale:** LLaMA-2 1.3B/7B/13B on 100B DCLM tokens; seq 2048, batch 2048 (~4M tokens); k=5, α=0.99; zero-shot PiQA/HellaSwag/ObQA/ARC/BoolQ/LogiQA/SciQ/Lambada; FP4 simulated on H100 FP8
- **Time period:** 2025-01-28 (arXiv 2501.17116 v1); last revised 2025-05-23 (v2). ICML 2025 (PMLR 267:62937-62957). HF paper publishedAt 2025-01-28.

## From the source (fetched 2026-10-03)

- **Published:** Jan 28, 2025 (arXiv)
- **Last revised:** May 23, 2025 (arXiv)
- **arXiv categories:** cs.LG, cs.CL (arXiv)
- **Journal reference:** Proceedings of the 42nd International Conference on Machine Learning, PMLR 267:62937-62957, 2025 (arXiv)
- **Citations:** 62 (7 influential) (Semantic Scholar)
- **References:** 63 (Semantic Scholar)
- **Published in:** International Conference on Machine Learning (Semantic Scholar)

## Abstract

The growing computational demands of training large language models (LLMs) necessitate more efficient methods. Quantized training presents a promising solution by enabling low-bit arithmetic operations to reduce these costs. While FP8 precision has demonstrated feasibility, leveraging FP4 remains a challenge due to significant quantization errors and limited representational capacity. This work introduces the first FP4 training framework for LLMs, addressing these challenges with two key innovations: a differentiable quantization estimator for precise weight updates and an outlier clamping and compensation strategy to prevent activation collapse. To ensure stability, the framework integrates a mixed-precision training scheme and vector-wise quantization. Experimental results demonstrate that our FP4 framework achieves accuracy comparable to BF16 and FP8, with minimal degradation, scaling effectively to 13B-parameter LLMs trained on up to 100B tokens. With the emergence of next-generation hardware supporting FP4, our framework sets a foundation for efficient ultra-low precision training.

## Research notes

- Primary: arxiv abs (cs.LG; also cs.CL). License: arXiv.org perpetual non-exclusive on HTML at check. Comment: ICML 2025; PMLR 267:62937-62957. Wang USTC/Microsoft SIGMA; Gong/Liu/Zhao/Yang/Cheng Microsoft Research Asia / SIGMA; Guo MSRA; Zha USTC. Correspondence yegong@microsoft.com, pengc@microsoft.com. Framework https://aka.ms/MS.AMP → https://github.com/Azure/MS-AMP (637 stars at check; MIT). HF paper page 36 upvotes; unofficial linked model w-hy21/lcqat_qwen3_1.7B not copied into hf_* fields. Discord posted abs. Trains on public DCLM rather than a new hosted corpus, so no datasets_local row. License field left blank per catalog convention.

## Cites, within this collection

- [GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers](https://papers.projxon.ai/entries/962) (paper 2022, #962)
- [AWQ: Activation-aware Weight Quantization for LLM Compression and Acceleration](https://papers.projxon.ai/entries/963) (paper 2023, #963)

## Cited by, within this collection

- [Pretraining Large Language Models with NVFP4](https://papers.projxon.ai/entries/946) (paper 2025, #946)

## Similar entries

- [Sharpness-Aware Pretraining Mitigates Catastrophic Forgetting](https://papers.projxon.ai/entries/527) (paper, #527)
- [BitNet a4.8: 4-bit Activations for 1-bit LLMs](https://papers.projxon.ai/entries/556) (paper, #556)
- [Why are models trained in FP16 and not lower precision? (LocalLLaMA thread)](https://papers.projxon.ai/entries/1009) (idea, #1009)
- [NVIDIA Model Optimizer (ModelOpt)](https://papers.projxon.ai/entries/763) (code, #763)
- [OPUS: Towards Efficient and Principled Data Selection in Large Language Model Pre-training in Every Iteration](https://papers.projxon.ai/entries/515) (paper, #515)
- [Matryoshka Quantization](https://papers.projxon.ai/entries/924) (paper, #924)
