arXiv:2605.07662cs.LGcs.NA2026-05

研究低精度数值如何更好保留向量方向,为高效机器学习提供新编码方案。

Direction-Preserving Number Representations

论文配图:Direction-Preserving Number Representations
图 1 · 摘自论文原文
  • 用几何框架分析有限字母表对向量方向的覆盖能力
  • 证明传统浮点/整数格式方向表示有可量化差距,存在优化空间
  • 4位时NVFP4的E2M1格式接近最优,解释其在实际中的优异表现

低精度数值格式因效率高被广泛用于现代机器学习系统。准确表示向量方向是保持向量运算精度的关键。本文系统研究从给定大小的有限字母表中选取标量元素时,向量方向能被多大程度表示。这在机器学习中常见,如窄宽浮点或整数表示。文中引入几何框架分析此类乘积结构码的方向覆盖能力。理论量化了这类乘积码与球面码在低维和渐进高维下的次优性差距。进一步证明,标准的补码、定点和浮点格式均次优,且差距可量化,提示可设计新标量格式。通过数值优化,在多个块维度下(包括NVIDIA NVFP4使用的维度)寻找最佳字母表。实验对比标准格式与优化字母表性能。发现四比特时,NVIDIA的E2M1格式已接近优化结果,为该格式在低精度机器学习中的优秀表现提供了几何解释,并揭示其优越性与块尺寸的关联。本文开源提供Lean形式化证明、实验代码及优化得到的字母表。

原文摘要 · Abstract (English)

Low-precision number formats are widely used in modern machine learning systems due to their efficiency. Accurate direction representation is key to the accuracy of vector operations. This work precisely explores the extent to which the direction of a vector can be represented by selecting its scalar elements from a common finite alphabet of a given size. This is standard practice in machine learning, where low-precision significands may be narrow-width floating-point or integer values. A geometric framework is introduced for analyzing the directional coverage of such product-structured codes. This work analytically quantifies the suboptimality gap between such product-structured codes and spherical codes for the vector as a whole, in both low and asymptotically high dimensions. Furthermore, within the product code class, it is proven that the standard formats of two's complement, fixed-point, and floating-point are suboptimal, again with quantified gap, pointing to the potential to develop new scalar number formats. Such scalar alphabets are numerically optimized across multiple block dimensions for directional coverage, including the dimension used in NVIDIA's NVFP4 format. Experimental results are presented comparing the performance of standard formats and the optimized alphabet. We find that for four bits, NVIDIA's choice of E2M1 closely approximates the optimized alphabet, providing a geometric explanation for its strong performance in low-precision machine learning workloads and an analytical understanding of the link between that superiority and block size. We provide open-source formal proofs in Lean for the theorems in this work, along with the experimental code and the optimized alphabets obtained.

低精度计算向量方向编码优化机器学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。