arXiv(opens in a new tab)cs.LGSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.09721

EFQ-Softmax: Exp-Free Quantization for Softmax

Haohui Han, Yuming Wan, Hongni Wang, Pengcheng Xie, Xiaodong Yan, Runqi You, Wencong Zhang

Haohui Han 1^{1}, Yuming Wan 2^{2}, Hongni Wang 3^{3}, Pengcheng Xie 2^{2}

Xiaodong Yan 1,∗^{1,*}, Runqi You 1^{1}, Wencong Zhang 1^{1}

1^{1}Xi'an Jiaotong University

2^{2}Huawei Technologies Co., Ltd

3^{3}Shandong University of Finance and Economics

hhhan200001@163.com, wanyuming3@huawei.com, wanghongnisd@126.com

xiepengcheng2@huawei.com, yanxiaodong@xjtu.edu.cn

18174543996@163.com, 2161934877@qq.com

Abstract—Low-bit attention accelerates Transformer inference by moving the QK⊤QK^{\top} and PVPV matrix multiplications to FP8 or FP4 matrix engines. However, the softmax probability path often still evaluates shifted-score exponentials in higher precision, forms a temporary probability block, and then quantizes it before the low-bit PVPV multiplication. This exp-then-quantize path creates a mismatch between a high-precision probability producer and a low-bit matrix consumer.

This paper proposes EFQ-Softmax (Exp-Free Quantization for Softmax), a low-bit probability-generation method that directly maps shifted attention scores to block-scaled E2M1 operands. For each microscaling block, EFQ-Softmax selects an exponent-only scale from the local maximum, maps the shifted scores to a normalized residual domain, and generates nonnegative E2M1 probability codes using a single affine rule. The resulting operand is used consistently in both the P~V\tilde{P}V numerator update and the P~1\tilde{P}1 denominator update. Meanwhile, the FlashAttention-style row-maximum update, historical rescaling, high-precision accumulation, and final normalization remain unchanged.

We evaluate the end-to-end quality of EFQ-Softmax across language, vision-language, and text-to-video workloads, and separately evaluate its kernel-level performance on the A5 vector unit. Specifically, we evaluate EFQ-Softmax on Qwen3-8B, Qwen3-VL-8B-Instruct, and WAN2.2-TI2V-5B. EFQ-Softmax improves the Qwen3-8B seven-task mean from 0.6749 with MXFP4 to 0.6773 and the Qwen3-VL nine-task mean from 0.7826 to 0.8000. On WAN2.2, it maintains temporal consistency and visual quality comparable to the FP16 and MXFP4 baselines under VBench. On the A5 vector unit, EFQ-Softmax reduces the vector-stage latency of the fused probability-generation kernel by 40.33% on average across sequence lengths from 16K to 128K. These results show that direct low-bit probability generation can replace the conventional exp-then-quantize path while preserving end-to-end model quality.

I. INTRODUCTION

Self-attention is a central operator in modern Transformer models [20]. In a standard implementation, its arithmetic cost grows quadratically with the sequence length, and the score and probability matrices may also require quadratic storage. These costs make attention expensive in long-context language models, vision-language models, and video-generation models. FlashAttention reduces memory traffic by computing attention in tiles and maintaining the softmax statistics through an online recurrence, without materializing the full attention matrix [4].

FlashAttention-2 further improves parallelism and work partitioning [3], while FlashAttention-3 uses asynchronous execution and low-precision matrix multiplication on recent hardware [16]. In parallel, low-precision formats such as FP8 and microscaling FP4 provide compact operands for modern matrix engines [11], [14]. Quantized attention systems such as SageAttention and SageAttention3 show that the two matrix multiplications in attention can be executed at low precision while maintaining model quality across language, image, and video workloads [24], [25]. As these matrix multiplications become faster, the probability-generation operations between score computation and value multiplication account for a larger part of the attention execution time.

In a FlashAttention-style kernel, each score tile is first shifted by an updated row maximum for numerical stability. Elementwise exponentials are then evaluated to generate the current unnormalized probability weights. In a conventional FP4 attention path, these weights are first produced in FP16 or FP32 and are then quantized into a block-scaled E2M1 representation for the low-bit value multiplication. This expthen-quantize path therefore contains three separate steps: evaluating dense elementwise exponentials, forming a temporary high-precision probability tile, and quantizing the tile into a low-bit operand. The resulting pipeline uses a high-precision probability producer even though the following matrix multiplication consumes low-precision values. Existing FP4 attention methods improve the scaling and quantization of probability values, but still compute the exponential values before converting them into a low-bit representation [25]. This producer-consumer mismatch motivates bypassing the temporary high-precision probability representation and directly generating the low-bit operand from the shifted scores. However, doing so is not merely a scalar exponential-approximation problem. The generated values must be directly usable by the low-bit value multiplication, and the same approximation must be used in both the softmax numerator and denominator. At the same time, the online recurrence must preserve its row-maximum update, historical rescaling, high-precision accumulation, and final normalization.

To address this problem, we propose EFQ-Softmax, a low-bit probability-generation method that directly converts shifted

∗^{*}Corresponding author: Xiaodong Yan (yanxiaodong@xjtu.edu.cn).

Figure

Fig. 1: EFQ-Softmax directly generates a shared block-scaled E2M1 operand within online attention.

attention scores into a block-scaled E2M1 operand. Here, “Exp-Free” refers to removing the dense elementwise exponential computation for the current score block, while retaining the row-level exponential required for historical rescaling. For each microscaling block, EFQ-Softmax selects an exponent-only scale from the local maximum, maps the shifted scores to a scale-normalized residual domain, and generates nonnegative E2M1 codes using a single affine index rule. Together with the block-level E8M0 scale, these codes form the final MXFP4 probability operand and are used consistently in both the numerator and denominator updates. This design eliminates

the intermediate FP16 or FP32 probability tile and the separate post-exponential quantization step, while preserving the row-maximum update, historical rescaling, high-precision accumulation, and final normalization of online attention.

Fig. 1 illustrates how EFQ-Softmax is integrated into the online attention recurrence, while Fig. 2 compares its direct score-to-E2M1 generation path with the conventional exp-then-quantize path.

We evaluate EFQ-Softmax on Qwen3-8B [18], Qwen3-VL-8B-Instruct [19], and WAN2.2-TI2V-5B [21]. On Qwen3-8B, EFQ-Softmax improves the seven-task mean score from 0.6749 with MXFP4 to 0.6773. On Qwen3-VL-8B-Instruct, it improves the nine-task mean score from 0.7826 to 0.8000 and achieves better results on all six referring-expression grounding splits. On WAN2.2, EFQ-Softmax maintains temporal consistency and visual quality comparable to the FP16 and MXFP4 baselines under VBench [7]. We also evaluate the probability-generation path on the A5 vector unit. Across sequence lengths from 16K to 128K, EFQ-Softmax reduces the vector-stage latency of the fused probability-quantization kernel by 40.33% on average. These results show that EFQ-Softmax shortens the probability-generation path while preserving numerical accuracy and end-to-end model quality.

Our main contributions are summarized as follows:

  • We propose EFQ-Softmax, a low-bit probability-generation method that fuses exponential approximation and MXFP4 probability quantization. It maps shifted attention scores to E2M1 probability codes through a single affine transformation and rounding, together with a block-level E8M0 scale.
  • Through integrating EFQ-Softmax into the FlashAttention-style online attention computation, the method preserves row-maximum and row-sum state updates, avoids storing full SS or PP matrices, and directly feeds the generated MXFP4 probability block into the low-bit PVPV multiplication.
  • EFQ-Softmax is evaluated on both controlled simulations and real model workloads. Experiments on Qwen3-8B, Qwen3-VL, and Wan2.2 show that the proposed method improve attention throughput while preserving numerical accuracy and end-to-end output quality.

The rest of this paper is organized as follows. Section II presents the design of EFQ-Softmax, including the block-scaled E2M1 representation, exponent-only scale selection, residual-domain normalization, affine code generation, and the EFQ-Softmax-16 variant. Section III describes the integration of EFQ-Softmax into FlashAttention-style online attention, including the numerator and denominator updates, algorithm summary, parameter calibration, and implementation boundary. Section IV evaluates EFQ-Softmax on language, vision-language, text-to-video, and kernel-level workloads. Section V concludes the paper.

Figure

Fig. 2: Conventional exp-then-quantize versus EFQ-Softmax. EFQ-Softmax directly generates block-scaled E2M1 probabilities from shifted scores, reducing A5 vector-stage latency by 40.33%.

References (26)