# FP4 与 NVFP4 推理

FP4 推理是指以 4 位浮点格式存储权重和激活值来运行基础模型的做法，这类量化由 NVIDIA 的 Blackwell GPU 架构于 2025 年引入主流服务。焦点在两种格式：MXFP4，即 2023 年通过开放计算项目发布的开放标准微缩放格式；以及 NVFP4，NVIDIA 于 2025 年推出的变体，以 16 值块和更高精度的缩放因子为核心。两者都将模型内存相对 FP16 基线压缩约 3.5 倍（厂商报告数据）；到 2026 年，OpenAI 和 DeepSeek 的前沿模型开始直接以 4 位专家权重出厂，且权重从训练之初就采用该精度。<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup>

## 关键事实

| 事实 | 详情 |
|---|---|
| 格式 | FP4 元素为 E2M1（1 位符号、2 位指数、1 位尾数）；NVFP4 每 16 个值附加一个 FP8 E4M3 缩放因子，外加一个逐张量的 FP32 缩放因子；MXFP4 每 32 个值使用一个 2 的幂次 E8M0 缩放因子<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[3](https://arxiv.org/html/2509.23202v3)</sup> |
| 存储成本 | NVFP4 每值约 4.5 位，MXFP4 为 4.25 位<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[3](https://arxiv.org/html/2509.23202v3)</sup> |
| 内存节省 | 比 FP16 小约 3.5 倍，比 FP8 小约 1.8 倍（厂商报告数据）<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup> |
| 吞吐量 | 在 Blackwell 上算术吞吐量比 FP8 高 2-3 倍（厂商报告数据）；在 B200 上独立测得端到端加速比 FP16 最高达 2.2 倍<sup>[4](https://arxiv.org/html/2601.20088v3)</sup><sup> • </sup><sup>[3](https://arxiv.org/html/2509.23202v3)</sup> |
| 精度 | 大模型（70B-235B）恢复约 99% 的 BF16 精度；7B-14B 模型恢复 95-98%（Red Hat，2026 年 2 月）<sup>[5](https://developers.redhat.com/articles/2026/02/04/accelerating-large-language-models-nvfp4-quantization)</sup> |
| 硬件要求 | FP4 张量核心加速需要 Blackwell 级硬件；在 A100 上，独立测试中 BF16 基线仍然领先<sup>[6](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)</sup> |
| 前沿采用 | gpt-oss（2025 年 8 月）以 MXFP4 对 MoE 专家进行量化感知训练；DeepSeek-V4（2026 年）以 QAT 将专家权重训练为 FP4<sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup> |

## FP4 是什么

这些格式中的 4 位浮点值编码为 E2M1：一位符号位、两位指数位、一位尾数位。这留下十四个非零有符号编码，对应七个非零幅值及其正负号，再加上零。微缩放的思想使该格式变得可用：相邻值的组共享一个以更高精度存储的缩放因子，因此每组在舍入到 4 位之前先进行归一化。<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[3](https://arxiv.org/html/2509.23202v3)</sup>

## 起源：OCP MXFP4 与 NVIDIA 的 NVFP4

微缩放格式由 Rouhani 等人于 2023 年发表，并通过开放计算项目标准化为 MXFP4：E2M1 值以 32 个为一块，每块共享一个 E8M0 格式的 2 的幂次缩放因子。MXFP4 的 E8M0 缩放格式较为粗糙。<sup>[4](https://arxiv.org/html/2601.20088v3)</sup><sup> • </sup><sup>[6](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)</sup>

NVFP4 由 NVIDIA 随 Blackwell 架构于 2025 年推出，保持相同的 E2M1 元素格式，但改变了两点：块从 32 个值缩小到 16 个值，缩放因子使用完整的 FP8 E4M3 表示而非 2 的幂次，并附加一个第二级的逐张量 FP32 缩放因子以提供动态范围。其结果是以每值约四分之一位（4.5 对 4.25）的代价换取更精确的表示，已发表的比较报告称在许多模型上精度优于 MXFP4 和 INT4。<sup>[3](https://arxiv.org/html/2509.23202v3)</sup><sup> • </sup><sup>[4](https://arxiv.org/html/2601.20088v3)</sup> 在 Llama 3.3 70B 上的直接 [KV 缓存](https://www.edgepedia.org/zh/kv-cache)比较中，NVIDIA 测得 NVFP4 的 MMLU 精度比 MXFP4 高 5%，并将其归因于更细的块缩放和更高精度的缩放因子。<sup>[7](https://developer.nvidia.com/blog/optimizing-inference-for-long-context-and-large-batch-sizes-with-nvfp4-kv-cache/)</sup> 当模型需要跨厂商迁移时，MXFP4 仍保有优势，因为它是开放标准。<sup>[6](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)</sup>

## FP4 推理的工作原理

在 FP4 服务路径中，主导 Transformer 计算的大规模矩阵乘法（GEMM）以两个操作数均为 FP4 的方式运行。每个 16 值（NVFP4）或 32 值（MXFP4）块携带其缩放因子，逐张量的 FP32 缩放因子恢复整体范围。这种块缩放正是朴素 FP4 转换所缺乏的；与 FP8 相比，MXFP4 存在明显的精度下降风险，而 NVFP4 的风险较低，尤其是对较大的模型。<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[3](https://arxiv.org/html/2509.23202v3)</sup>

该方法也扩展到 KV 缓存。NVIDIA 的 NVFP4 KV 缓存将缓存内存相对 FP8 缓存减少约 50%，从而支持更大的上下文长度和批大小，据报告在 [LiveCodeBench](https://www.edgepedia.org/zh/livecodebench)、MMLU-PRO、MBPP 和 Ruler 64K 上相对 BF16 和 FP8 基线的精度损失低于 1%。当前的一个限制：在注意力计算之前，值必须从 NVFP4 反量化为 FP8，这是注意力路径上的反量化代价。<sup>[7](https://developer.nvidia.com/blog/optimizing-inference-for-long-context-and-large-batch-sizes-with-nvfp4-kv-cache/)</sup>

## 数据一览

厂商和独立测量的范围不同，两者都重要。NVIDIA 报告称，通过训练后量化从 FP8 量化为 NVFP4 的 DeepSeek-R1-0528 在关键语言建模任务上退化不超过 1%，在 AIME 2024 上甚至高出 2%；该公司还引用相对 FP8 的 2-3 倍算术吞吐量和 1.8 倍内存缩减。<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[4](https://arxiv.org/html/2601.20088v3)</sup>

独立结果则更为参差。2025 年的一项 arXiv 研究发现 NVFP4 和 MXFP4 均有损，MXFP4 导致约 10% 的相对精度下降，并观察到现有量化技术在这些新格式上并不总是优于简单的最近舍入。其 MR-GPTQ 方法在 B200 上相对 FP16 达到最高 3.6 倍的逐层加速和 2.2 倍的端到端加速，大模型恢复 98-99% 的基线精度。<sup>[3](https://arxiv.org/html/2509.23202v3)</sup> [Red Hat](https://www.edgepedia.org/zh/red-hat) 于 2026 年 2 月使用 LLM Compressor 的评估发现，大模型（70B-235B）一致恢复约 99% 的 BF16 精度，中型模型约 97-99%，7B-14B 模型为 95-98%，其中 Llama-3.1-8B 退化略多，而 Qwen-8B 和 Qwen-14B 保持在 98% 附近。<sup>[5](https://developers.redhat.com/articles/2026/02/04/accelerating-large-language-models-nvfp4-quantization)</sup> Nota AI 在 [HellaSwag](https://www.edgepedia.org/zh/hellaswag)、MMLU 和 PiQA 上测得各精度格式之间的分数差异在 ±0.005-0.02 以内，仅 [Winogrande](https://www.edgepedia.org/zh/winogrande) 显示出略大的任务级波动。<sup>[6](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)</sup>

在速度方面，Nota AI 在 vLLM v0.10.1.1 上的测试发现，NVFP4 在 Blackwell（RTX PRO 6000）上提供最快的预填充和最高吞吐量，而在 A100 上 BF16 基线仍然领先，证实了增益与 Blackwell 硬件绑定。<sup>[6](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)</sup>

## 谁在使用：模型与系统，2025–2026

**gpt-oss，2025 年 8 月。** OpenAI 的开放权重 gpt-oss 模型以 MXFP4 对其 MoE 专家（占参数 90% 以上）进行量化感知训练，这正是 120B 模型能跑在单张 80 GB GPU 上的原因。选择 MXFP4 而非 NVFP4 被记录为事实；来源未记录团队为何如此选择。<sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup>

**DeepSeek-V4，2026 年。** DeepSeek 的 1.6 万亿参数 MoE 模型通过量化感知训练直接以 FP4 训练其专家权重和稀疏注意力索引器，使用 NVFP4 的 16 值块，其余组件保持 FP8。<sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup>

**检查点与工具栈。** [Hugging Face](https://www.edgepedia.org/zh/hugging-face) 托管 NVFP4 预量化检查点，包括 DeepSeek-R1-0528、Llama 3 和 FLUX.1-dev，可在 [TensorRT-LLM](https://www.edgepedia.org/zh/tensorrt-llm) 和 vLLM 上部署，SGLang 支持已宣布即将推出；量化配方随 TensorRT Model Optimizer 发布。<sup>[1](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)</sup><sup> • </sup><sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup> Red Hat 报告了从 8B 级到 400B+ MoE 架构的 NVFP4 量化模型，包括 Llama-4 Scout 和 Maverick，以及用 LLM Compressor 量化的 Qwen3-235B-A22B，可通过 vLLM 部署。<sup>[5](https://developers.redhat.com/articles/2026/02/04/accelerating-large-language-models-nvfp4-quantization)</sup> Atlas 推理栈将 NVFP4 列为其在 GB10 上的旗舰格式，大多数 Qwen 和 Nemotron 检查点以此格式发布。<sup>[8](https://docs.atlasinference.io/deep-dives/nvfp4.html)</sup>

## 近期发展

这一发展历程始于 2023 年 OCP 微缩放标准，经过 2025 年 NVIDIA 在 Blackwell 上推出 NVFP4，到 2025 年 8 月 gpt-oss 以 MXFP4 训练 MoE 专家出厂，再到 2026 年 DeepSeek-V4 以 FP4 训练 1.6 万亿参数模型的专家。这场最初作为硬件问题的格式之争——16 值 FP8 缩放块对 32 值 2 的幂次块——如今已在前沿模型的训练过程中有了答案：DeepSeek-V4 使用 NVFP4 更细的块，而 gpt-oss 使用 MXFP4 更简单的块。<sup>[4](https://arxiv.org/html/2601.20088v3)</sup><sup> • </sup><sup>[2](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)</sup>

## References

1. [Introducing NVFP4 for Efficient and Accurate Low-Precision Inference | NVIDIA Technical Blog](https://developer.nvidia.com/blog/introducing-nvfp4-for-efficient-and-accurate-low-precision-inference/)
2. [Pushing Intelligence to 4-bit | Efficient AI (NVIDIA Research)](https://research.nvidia.com/labs/eai/blogs/pushing-intelligence-to-4-bit/)
3. [Bridging the Gap Between Promise and Performance for Microscaling FP4 Quantization](https://arxiv.org/html/2509.23202v3)
4. [Quantization-Aware Distillation for NVFP4 Inference Accuracy Recovery](https://arxiv.org/html/2601.20088v3)
5. [Accelerating large language models with NVFP4 quantization | Red Hat Developer](https://developers.redhat.com/articles/2026/02/04/accelerating-large-language-models-nvfp4-quantization)
6. [NVIDIA Blackwell; The Impact of NVFP4 For LLM Inference | Nota AI](https://blog.nota.ai/insights/nvidia-blackwell-nvfp4)
7. [Optimizing Inference for Long Context and Large Batch Sizes with NVFP4 KV Cache | NVIDIA Technical Blog](https://developer.nvidia.com/blog/optimizing-inference-for-long-context-and-large-batch-sizes-with-nvfp4-kv-cache/)
8. [NVFP4 Quantization - The Atlas Book](https://docs.atlasinference.io/deep-dives/nvfp4.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 19, 2026; Sep 30, 2026 · Edited: Sep 19, 2026; Sep 30, 2026; Oct 11, 2026; Oct 15, 2026; Oct 21, 2026; Oct 25, 2026 · Last review: Sep 30, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › 基础模型方法与训练 › 基础模型的推理、服务与效率

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/fp4-and-nvfp4-inference

English original: https://www.edgepedia.org/fp4-and-nvfp4-inference
