Manuscript Offprint
arXiv:2609.09721EFQ-Softmax: Exp-Free Quantization for Softmax
Haohui Han , Yuming Wan , Hongni Wang , Pengcheng Xie
Xiaodong Yan , Runqi You , Wencong Zhang
Xi'an Jiaotong University
Huawei Technologies Co., Ltd
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 and 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 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 numerator update and the 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).

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 or matrices, and directly feeds the generated MXFP4 probability block into the low-bit 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.

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%.
A. Design Scope and Overview
a) Targeted probability path.: For one attention head, let , , and . The exact attention output is
Let denote the score matrix. Stable softmax evaluates each row after subtracting the row maximum:
The elementwise term that must be generated before normalization is therefore
We refer to as a row-max-shifted attention score, or simply a shifted score.
EFQ-Softmax modifies only the probability-generation path. It replaces the elementwise computation of for the current score block and the subsequent probability quantization with direct generation of a low-bit probability operand. The attention formulation, value-side representation, and precision of the online accumulators remain unchanged from the surrounding attention kernel. The value block is not modified by EFQ-Softmax; it only consumes the generated probability operand in the subsequent (PV) multiplication.
In a low-bit attention path, the consumer often expects a low-bit probability operand. A conventional construction first evaluates Eq. (1) in a higher-precision format and then quantizes the resulting probability block:
EFQ-Softmax replaces the exp-then-quantize sequence by direct probability-code generation:
The generated operand is then shared by the numerator branch and the denominator branch . The outputs of these two branches are accumulated in FP16 or FP32, as in standard low-bit matrix-multiply pipelines.
b) Online attention recurrence.: To describe how EFQ-Softmax operates in a tiled online-attention kernel, we now move from the elementwise notation above to a blockwise formulation. FlashAttention processes the score matrix by query blocks and key/value blocks. For query block and key/value block , the score block is
where denotes an optional mask term. The online state consists of a row maximum , a numerator accumulator , and a denominator accumulator . The row maximum update is
Using , the exact current unnormalized probability block is
The historical state must be rescaled when the row maximum changes. With
the exact online update is
EFQ-Softmax keeps Eqs. (4)-(7). Only the current-block probability block is replaced by a block-scaled low-bit approximation.
c) Required probability operand.: These constraints define the required EFQ-Softmax output. The generated operand must be directly consumed by the low-bit PV path, reused by the denominator update, and accumulated into the existing high-precision online state. We therefore represent the current unnormalized probability block as
Here is a nonnegative E2M1 code block and is a block scale. The rest of this section describes how and are generated directly from the shifted score block .
B. Block-Scaled E2M1 Probability Representation
a) Nonnegative E2M1 code set.: The E2M1 format contains a small number of representable values. Since attention probabilities are nonnegative, EFQ-Softmax only uses the nonnegative code set
The index set is , and denotes the numerical value represented by code . This notation is only used to state the mathematical value of each bit pattern. In the data path, the generated code is packed as a 4-bit E2M1 probability operand rather than used as an index for a runtime value lookup.
For each microscaling block , EFQ-Softmax writes . The scale determines the exponent range of the block, while the code value determines the local mantissa-like value. In the probability path, this is sufficient because all inputs satisfy after the row-maximum shift and the largest exact value inside a row is at most one.
b) Exponent-Only Scale Rule: Let be the largest shifted score inside a microscaling block. Since the largest value in is 6, the scale is chosen so that is close to . EFQ-Softmax restricts the scale to an exponent-only value . The scale exponent is selected by
Equivalently,
The constant is part of the scale rule. It is not a fitted EFQ-Softmax parameter. Its role is to choose a power-of-two scale around the largest local probability value under the E2M1 maximum code 6. The only fitted EFQ-Softmax parameters are the affine code-generation parameters , introduced below.
This exponent-only scale is compatible with the probability-side data path. It avoids a general floating-point scale generation step and provides a compact representation that can be consumed together with the generated E2M1 code. The scale is shared by all elements in the microscaling block; therefore the elementwise decision that remains after scaling is only an index-generation problem.
c) Residual Log-Domain Normalization: After the scale has been selected, each shifted score is converted into a residual log-domain value
This residual satisfies
Thus the remaining operation is to approximate by one of the values in . The residual is the proper input to the code-generation rule because it has already absorbed the block scale. Using directly without this normalization would mix two tasks: block-level dynamic-range selection and element-level code selection.
The largest residual in block b is
From Eq. (9), remains in a bounded interval determined by the power-of-two rounding of the scale. This bounded residual range is the reason that a single pair of EFQ-Softmax parameters can be reused across many blocks. The exact shifted scores may have a large dynamic range across rows and layers, but the residual code-generation input is locally normalized.
d) Microscaling blocks.: The microscaling block size is a design parameter of the probability path. For a flattened local score block, the partition can be written as
For each , the scale exponent is computed once and then reused by all elements in the block. A smaller gives more local scaling and can reduce approximation error, while a larger reduces scale metadata and scale-generation work. EFQ-Softmax does not rely on a particular value of in the mathematical definition, and the implementation keeps consistent with the low-bit matrix operand layout.
C. EFQ-Softmax Probability Code Generation
Given the residual from Eq. (10), EFQ-Softmax generates a 4-bit E2M1 probability code with a single affine rule:
The generated is the probability code. Operationally, it is stored as a 4-bit pattern and interpreted as a nonnegative E2M1 operand:
Mathematically, the represented probability value is . Here denotes the numerical value of the E2M1 bit pattern and does not imply a runtime lookup of a high-precision exponential value.

Fig. 3: Overview of the five-stage EFQ-Softmax probability-generation procedure.
Combining the scale rule in Eq. (8), the residual definition in Eq. (10), and the index rule in Eq. (11), EFQ-Softmax implements the direct path
Equivalently, for , the represented probability value is
The generated result is already the low-bit probability operand consumed by the following attention update, so EFQ-Softmax does not materialize an intermediate FP16/FP32 probability block required in the intended path.
The parameters and h define uniformly spaced thresholds in the residual log domain. Ignoring clipping, code c is selected when
The parameter shifts the thresholds, while h controls their spacing. Thus, EFQ-Softmax uses uniformly spaced residual thresholds together with a fixed nonuniform E2M1 output set. EFQ-Softmax does not use these thresholds to fetch a high-precision exponential value. The output of Eq. (11) is already the final 4-bit E2M1 code consumed by the attention data path.
The clipping in Eq. (11) bounds the generated code to the nonnegative E2M1 range. Residuals below the lowest threshold map to code 0, while residuals above the highest threshold map to code 7, which represents the largest nonnegative E2M1 value 6. The zero code is not a separate pruning rule; it is one representable outcome of the block-scaled E2M1 probability operand. This saturation is part of bounded index generation rather than an additional algorithmic branch.
If were first computed and then nearest-rounded to , the resulting log-domain boundaries would be nonuniform because the E2M1 values are nonuniform. EFQ-Softmax deliberately gives up this scalar nearest-rounding rule and uses affine residual thresholds to simplify code generation.
This design trades scalar nearest-rounding optimality for a simpler probability-code generation path. Nearest-code rounding after an explicit exponential requires computing and
then deciding the final E2M1 value. EFQ-Softmax removes the explicit exponential and learns a direct residual threshold rule. The correctness target is not exact scalar exponential reconstruction. The relevant target is output-level attention accuracy after the numerator and denominator updates.
The parameter controls the global threshold shift, and h controls the threshold spacing. Their values are selected offline by the calibration procedure described in Sec. III-C.
The complete EFQ-Softmax probability-generation procedure is summarized in Figure 3. The figure shows how shifted attention scores are transformed into packed block-scaled E2M1 probability operands through five consecutive stages.
D. EFQ-Softmax-LUT Variant
EFQ-Softmax-LUT uses the same block scale and the same nonnegative E2M1 output set as EFQ-Softmax, but introduces a 16-level intermediate index before folding to the final 8-code E2M1 output. The intermediate index is
where , . The final E2M1 code is obtained by the monotone folding table
Then the final code is
Mathematically, the represented probability value is . In contrast to EFQ-Softmax, this variant contains an explicit 16-to-8 remapping stage.
Fig. 4 compares the affine code mapping of EFQ-Softmax with the two-stage mapping of EFQ-Softmax-LUT.
EFQ-Softmax-LUT is useful as an accuracy-oriented comparison point. It has finer intermediate boundary placement than the 8-code EFQ-Softmax rule, but it also introduces an additional remapping stage. For this reason, the main method remains EFQ-Softmax. EFQ-Softmax-LUT acts as an ablation that measures how much accuracy can be gained by increasing mapping flexibility at the probability-code generation point.

Fig. 4: Affine code mapping in EFQ-Softmax and two-stage mapping in EFQ-Softmax-LUT.
III. ONLINE INTEGRATION AND IMPLEMENTATION
A. Integration with Online Attention
a) Probability operand and consumers.: For a score block , EFQ-Softmax produces the probability operand
The numerator contribution is
If the value block is already represented by an existing low-bit path, , the consumer can be written as
Equation (13) only specifies the consumer of the generated probability operand. It is not a new value quantization rule. The contribution of EFQ-Softmax is the generation of from the shifted score block.
The same probability operand is also used by the denominator branch:
The denominator increment is not stored as an E2M1 value; the low-bit operand provides the input to the row-sum operation, and the row-sum output is accumulated in FP16 or FP32.
Using the same probability operand in Eqs. (12) and (14) is important. If the numerator used EFQ-Softmax but the denominator used a separately reconstructed probability block, the online update would combine two different probability approximations. EFQ-Softmax instead uses one block-scaled probability operand for both branches.
b) Online recurrence.: With the rescaling factor from Eq. (5), the EFQ-Softmax online update is
The output after all key/value blocks are processed is
Thus the online structure of FlashAttention is preserved. EFQ-Softmax replaces only the current-block generation of . The row maximum update, historical rescaling, high-precision accumulation, and final division remain the same.
c) Current-block exponential path.: The current probability block normally requires elementwise exponentials for all entries of . EFQ-Softmax removes these current-block elementwise exponentials and replaces them with affine index generation. The historical rescaling factor is a row-level term and remains part of the online recurrence. This distinction is important: the method does not remove every exponential operation in FlashAttention. It removes the dense elementwise exponential path used to materialize the current unnormalized probability block.
B. Algorithm Summary
Algorithms 1 and 2 summarize the online execution of EFQ-Softmax. Algorithm 1 describes the probability-code generation rule for one microscaling block, while Algorithm 2 shows how the generated operand is consumed inside one online attention update. Algorithm 3 summarizes the offline calibration procedure used to select the global parameters by minimizing the attention-output error over representative calibration blocks.
C. Parameter Calibration
The affine thresholds in Eq. (11) are controlled by two global parameters, and h. Calibration selects these parameters to align the threshold range with the residual distribution observed after block-scale normalization. Specifically, shifts the threshold range, while h controls the spacing between adjacent thresholds. Larger h produces denser thresholds and can assign more residuals to higher E2M1 codes, whereas smaller h produces a more conservative code distribution.
Fig. 5 illustrates how shifts the threshold range and how h controls the spacing between adjacent thresholds.
We select offline using representative attention activations. For each candidate pair, EFQ-Softmax is applied to
Algorithm 1 EFQ-Softmax Probability-Code Generation for One Microscaling Block
Require: Shifted scores , EFQ-Softmax parameters
Ensure: Block scale and nonnegative E2M1 probability codes
1:
2:
3:
4: for each element do
5:
6:
7: Q_{P,t}^{\text{E2M1}} \leftarrow \text{pack}_4_{\text{E2M1}}(c_t)
8: end for
9: return ,
Algorithm 2 EFQ-Softmax Online Update for One Key/Value Block
Require: , previous state
Ensure: Updated state
1:
2:
3:
4: Partition into microscaling blocks
5: for each microscaling block do
6: Generate and by Algorithm 1
7: end for
8: Assemble from all blocks
9:
10:
11:
12:
13:
14: return
calibration score blocks, and the resulting attention output is compared with the reference output:
This output-level objective is used because the generated probability operand affects both the numerator branch and the denominator branch . Scalar fitting to can be used as an initialization or diagnostic, but scalar exponential error is not the final selection criterion. This objective also captures the coupled effect of probability-code errors on both the accumulated numerator and denominator, which is not reflected by scalar exponential fitting alone.
After calibration, the selected operating point remains fixed during inference and is validated on downstream tasks. This separation prevents the parameter search from being interpreted as per-input adaptation or test-set tuning.
Algorithm 3 Offline Selection of EFQ-Softmax Parameters
Require: Candidate sets and , calibration score blocks, reference outputs
Ensure: Selected parameters
1: Initialize best objective value
2: for each do
3: for each do
4: Run EFQ-Softmax attention on calibration blocks with
5: Compute
6: if then
7:
8:
9: end if
10: end for
11: end for
12: return

Fig. 5: Effect of and on affine threshold placement: shifts the threshold range, whereas controls the spacing between adjacent thresholds.
D. Algorithmic Cost and Method Boundary
a) Operations removed.: The conventional path in Eq. (2) first evaluates dense elementwise exponentials for the current probability block and then quantizes the resulting high-precision probabilities into E2M1. EFQ-Softmax fuses these two stages into the residual-domain score-to-code rule in Eq. (11). For each element, the EFQ-Softmax path uses subtraction, multiplication by , floor, clipping, and bit-pattern generation. For each microscaling block, it computes one local maximum and one exponent-only scale. The row-level exponential used for historical rescaling, , is outside the removed dense elementwise path and is retained.
b) Kernel interface and placement.: The probability-generation unit receives the shifted score block , the microscaling partition , and the fixed parameters , and returns the probability operand
Masks are applied before this stage when the score block is formed and shifted by the updated row maximum. EFQ-Softmax is placed immediately after this shift, at the point where the exact implementation would evaluate . The generated code and scale are then consumed by both the numerator branch and the denominator branch.
IV. EXPERIMENTS
A. Experimental Setup
a) Models.: We evaluate on three representative open models that span pure language modeling, vision-language understanding, and text-to-video generation: Qwen3-8B, Qwen3-VL-8B-Instruct [18], and WAN2.2-TI2V-5B [21]. For each model we replace the original self-attention and cross-attention over the token stream with our quantized attention, leaving all other components unchanged.
b) Quantization step.: Our attention follows the FlashAttention-2 [3] tiling loop and approximates the softmax numerator with a block-wise quantizer. We adopt a high-precision FP16 implementation as the baseline and compare it against a standard MXFP4 quantization implementation [13], [24] and our proposed EFQ-Softmax method; see the method section for the detailed configuration of EFQ-Softmax.
c) Benchmarks and metrics.: Qwen3-8B: seven zero-shot classification tasks from lm-eval-harness [5] -BoolQ [1], OpenBookQA [12], RTE [22], WinoGrande [15], MMLU [6], ARC-Easy and ARC-Challenge [2]— reported as accuracy and averaged into a 7-task mean. Qwen3-VL-8B-Instruct: three VQA tasks (AI2D [8], OK-VQA [10], TextVQA [17], exact-match) and six referring-expression grounding splits (RefCOCO [23] and RefCOCO+ [9] × {testA, testB, val}, ACC@0.5), averaged into a 9-task mean. WAN2.2-TI2V-5B: 14 diverse text-to-video prompts at , 121 frames, 50 UniPC [26] steps, with a fixed seed of 123469 across all prompts.
d) Parameter selection.: For the language-model evaluation, we report two calibrated EFQ-Softmax operating points. EFQ-Softmax-MMLU is configured with , and is selected for its highest MMLU accuracy in the parameter sweep, whereas EFQ-Softmax-Mean is configured with , and is selected for its highest seven-task mean in the parameter sweep. For Qwen3-VL, we first screen candidate pairs on at most 16 samples per task and keep only points whose per-task accuracy is within one point of MXFP4 (). The selected operating point, configured with , , is denoted EFQ-Softmax-Balance and is used for the full vision-language evaluation.
For comparison, we also evaluate a 16-level lookup-table variant denoted EFQ-Softmax-LUT as an ablation. In contrast
TABLE I: Qwen3-8B zero-shot accuracy (FP16, batch size 8), part 1 of 2. is relative to the MXFP4 reference (row 2).
| Method | BoolQ | OBQA | RTE | WinoG. | MMLU |
|---|---|---|---|---|---|
| FP16 | .8657 | .3120 | .7834 | .6772 | .7300 |
| MXFP4 | .8667 | .3080 | .7726 | .6827 | .7264 |
| MXFP4-scale6 | .8648 | .3080 | .7798 | .6835 | .7255 |
| EFQ-LUT | .8664 | .3180 | .7762 | .6851 | .7248 |
| EFQ-MMLU | .8703 | .3160 | .7690 | .6748 | .7223 |
| EFQ-Mean | .8667 | .3220 | .7762 | .6906 | .7119 |
TABLE II: Qwen3-8B zero-shot accuracy, part 2 of 2 (ARC-Easy, ARC-Challenge, and the 7-task mean). on the mean is relative to the MXFP4 reference.
| Method | ARC-E | ARC-C | Mean | |
|---|---|---|---|---|
| FP16 | .8350 | .5589 | .6803 | +.0055 |
| MXFP4 | .8207 | .5469 | .6749 | 0 |
| MXFP4-scale6 | .8194 | .5435 | .6749 | +.0001 |
| EFQ-LUT | .8325 | .5461 | .6784 | +.0036 |
| EFQ-MMLU | .8283 | .5469 | .6754 | +.0005 |
| EFQ-Mean | .8287 | .5452 | .6773 | +.0024 |
to our proposed 8-code configuration of EFQ-Softmax, EFQ-Softmax-LUT adopts a 16-level E2M1 code to isolate the effect of the proposed coding rule.
B. Quantitative Results on Qwen3-8B
Tables I–II report zero-shot accuracy on Qwen3-8B at batch size 8, with the FP16 in the first row and relative to the MXFP4 in parentheses. The seven tasks are split across two tables. From these results, three observations emerge.
(i) EFQ-Softmax-LUT matches or beats MXFP4 on average. EFQ-Softmax-Mean reaches a 7-task mean of 0.6773, compared with 0.6749 for the MXFP4 (+0.0024). The 16-level EFQ-Softmax-LUT ablation reaches 0.6784 (+0.0036). EFQ-Softmax-MMLU is on par with MXFP4 while using the same 8-code E2M1 output set as EFQ-Softmax. Crucially, both 8-code operating points stay within 0.005 of the FP16 baseline (0.6803), so the accuracy lost to P-quant quantization is recovered by our simpler LUT.
(ii) Per-task behavior separates the two operating points. The two 8-code operating points exhibit different accuracy trade-offs. EFQ-Softmax-MMLU gives the best BoolQ result in the table (0.8703) and keeps MMLU within 0.0041 of MXFP4. By contrast, EFQ-Softmax-Mean favors WinoGrande (0.6906, +0.0079) and OpenBookQA (0.3220, +0.0140), yielding the highest seven-task mean among the 8-code EFQ-Softmax variants. The two configurations therefore deliver a tunable accuracy trade-off that MXFP4's quantize-after-exponential scheme cannot provide.
TABLE IV: Qwen3-VL-8B-Instruct VQA tasks (exact match). is EFQ-Softmax-Balance minus MXFP4.
| Task | MXFP4 | EFQ-Softmax-bal. | |
|---|---|---|---|
| AI2D | .83646 | .83323 | -.00324 |
| OK-VQA | .49370 | .49184 | -.00186 |
| TextVQA | .79722 | .79792 | +.00070 |
TABLE III: Qwen3-8B 7-task mean across batch sizes and kernel backends. is relative to the MXFP4 reference at the same batch size.
| Method | batch = 16 | batch = 24 | ||
|---|---|---|---|---|
| Mean | Mean | |||
| FP16 | .6805 | +.0074 | .6809 | +.0074 |
| MXFP4 | .6731 | 0 | .6735 | 0 |
| MXFP4-scale6 | .6736 | +.0005 | .6736 | +.0001 |
| EFQ-LUT | .6781 | +.0050 | .6757 | +.0023 |
| EFQ-MMLU | .6740 | +.0009 | .6764 | +.0029 |
| EFQ-Mean | .6733 | +.0002 | .6785 | +.0050 |
(iii) Batch size does not change the conclusion. Table III replicates the comparison under batch sizes of 16 and 24. The seven-task average of each method deviates by no more than 0.006 from its batch-8 result, confirming that our comparison conclusions remain stable under batching. The FP16 baseline consistently yields the highest accuracy, and the MXFP4 reference the lowest. Meanwhile, the EFQ-Softmax variants — EFQ-Softmax-LUT, EFQ-Softmax-MMLU, and EFQ-Softmax-Mean — sit in the intermediate range, with their relative ordering interchangeable within a 0.005 accuracy band.
C. Quantitative Results on Qwen3-VL-8B-Instruct
Tables IV–V compare EFQ-Softmax-Balance with the MXFP4 across the full Qwen3-VL evaluation suite. The results are split into VQA (Table IV) and referring-expression grounding (Table V) to fit within the column width. On the three VQA tasks, the two methods yield nearly indistinguishable performance. EFQ-Softmax-Balance incurs a maximum accuracy drop of only 0.0032 on AI2D and even achieves a slight gain of 0.0007 on TextVQA; the worst-case degradation on VQA is therefore well below 0.01. In contrast, EFQ-Softmax-Balance outperforms MXFP4 on all six grounding splits, with improvements ranging from +0.0028 (RefCOCO+ testB) to +0.0430 (RefCOCO testA). Aggregated over all nine tasks, the mean accuracy rises from 0.7826 to 0.8000(+0.0174). The IoU metrics underlying these ACC@0.5 scores (Table VI) follow the same trend, indicating that the quantized grounding boxes are not only correct more often but also spatially better aligned with target objects.
In short, for the vision-language model, EFQ-Softmax incurs no accuracy loss on VQA and strictly outperforms MXFP4 on grounding. Moreover, it achieves a clear advantage on referring-expression splits: on these tasks, the softmax
TABLE V: Qwen3-VL-8B-Instruct referring-expression grounding (ACC@0.5). is EFQ-Softmax-Balance minus MXFP4; every split improves. The 9-task mean (VQA + grounding) is shown in the last row.
| Split | MXFP4 | EFQ-Softmax-Bal. | |
|---|---|---|---|
| RefCOCO testA | .85418 | .89722 | +.04304 |
| RefCOCO testB | .83094 | .84862 | +.01768 |
| RefCOCO val | .85178 | .88617 | +.03439 |
| RefCOCO+ testA | .84608 | .88051 | +.03443 |
| RefCOCO+ testB | .74805 | .75083 | +.00278 |
| RefCOCO+ val | .78502 | .81367 | +.02865 |
| 9-task mean | .78260 | .80000 | +.01740 |
TABLE VI: IoU of the EFQ-Softmax-Balance grounding boxes on the RefCOCO / RefCOCO+ splits (Qwen3-VL full evaluation).
| Split | EFQ-Softmax-bal. IoU |
|---|---|
| RefCOCO testA | 0.8257 |
| RefCOCO testB | 0.7778 |
| RefCOCO val | 0.8152 |
| RefCOCO+ testA | 0.8058 |
| RefCOCO+ testB | 0.7006 |
| RefCOCO+ val | 0.7527 |
distribution over candidate boxes is sharper, which enables the method to reap benefits from the arithmetic-midpoint scale.
D. Text-to-Video Generation on WAN2.2-TI2V-5B

Fig. 6: Middle-frame qualitative overview.
We generate 14 text-to-video clips with the WAN2.2-TI2V-5B model under three P-quant settings: the FP16 baseline, EFQ-Softmax, and MXFP4_SCALE4. All clips adopt identical generation parameters: resolution, 121 frames, 50 UniPC steps, and a fixed random seed of 123469. As such, the sole experimental variable is the attention kernel. The 14 prompts encompass the visual styles utilized in previous WAN2.2 [21]evaluations, including museum interiors, close-up object motion, archival footage, fantasy creatures, neon

(a) Television-wall scene.
(b) Coffee-cup scene.

(c) Outdoor scene.
(d) Terrarium scene.
Fig. 7: Temporal consistency comparison across four representative text-to-video examples. Columns within each panel show frames sampled at different timesteps, while rows correspond to different attention implementations.
street scenes, drone landscapes, and papercraft/craft-material clips.
a) VBench quantitative metrics.: To complement our qualitative comparison, we evaluate all video clips via VBench [7] with its default auxiliary-information configuration, which enables 10 valid dimensions covering the primary evaluation criteria. Table VII summarizes the results of the three variants. In terms of temporal-coherence metrics, EFQ-Softmax achieves scores comparable to both the FP16 baseline and MXFP4_SCALE4. Subject consistency (0.9493), background consistency (0.9564), temporal flickering (0.9784), and motion smoothness (0.9891) reveal no observable degradation of temporal consistency. For visual quality dimensions, EFQ-Softmax attains the highest imaging quality (0.7178), surpassing the baseline (0.7098) and MXFP4_SCALE4 (0.7004), whereas its aesthetic quality (0.6355) lies between the two reference variants. Overall, the VBench metrics verify that EFQ-Softmax retains the visual quality of the FP16 baseline while delivering competitive performance relative to MXFP4_SCALE4.
b) Visual quality.: Since a single scalar metric cannot comprehensively characterize text-to-video generation quality, we present side-by-side video comparisons below. Figure 6 shows middle-frame examples for four prompts, and Figure 7 compares the temporal consistency of different attention methods on these cases. Each of the 14 prompts yields three video clips (FP16 baseline, EFQ-Softmax, MXFP4_SCALE4) generated using identical prompts and random seeds. Qualitatively, videos produced by EFQ-Softmax retain the motion coherence, lighting, and fine texture details seen in the FP16 baseline, achieving performance comparable to MXFP4_SCALE4. Im-
TABLE VII: WAN2.2-TI2V-5B VBench results under the default auxiliary-information setting (15 valid dimensions, main evaluation criteria). Baseline is FP16, MXFP4 scale4 is the MXFP4 reference, and EFQ-Softmax.
| VBench dimension | Baseline | MXFP4 scale4 | EFQ-Softmax |
|---|---|---|---|
| subject consistency | 0.9509 | 0.9536 | 0.9493 |
| background consistency | 0.9559 | 0.9624 | 0.9564 |
| temporal flickering | 0.9801 | 0.9775 | 0.9784 |
| motion smoothness | 0.9901 | 0.9887 | 0.9891 |
| dynamic degree | 0.5714 | 0.5000 | 0.5000 |
| aesthetic quality | 0.6488 | 0.6295 | 0.6355 |
| imaging quality | 0.7098 | 0.7004 | 0.7178 |
| temporal style | 0.2645 | 0.2475 | 0.2562 |
| appearance style | 0.2431 | 0.2416 | 0.2406 |
| overall consistency | 0.2645 | 0.2475 | 0.2562 |
portantly, EFQ-Softmax relies on a streamlined probability-code generation pipeline based on a single affine index rule, which differs from MXFP4's scale-and-round procedure.
E. Kernel-Level Speedup on the A5 Vector Unit
We benchmark the fused P-quant kernel on the A5 vector unit. We compare the MXFP4 with the fused EFQ-Softmax implementation across six sequence lengths spanning 16K to 128K tokens. The P-quant computation pipeline is split into three stages: matrix-multiply-accumulate (mmad), fixed-point pipeline (fixpipe), and vector processing (vector). By construction, the mmad stage is identical for both variants. Both implementations dequantize operands to the identical E2M1 format for matrix multiplication. Accordingly, their
TABLE VIII: A5 vector-unit per-stage timing (s) and per-stage speedup for fixpipe and vector: MXFP4 baseline vs. A5-EFQ-Softmax. Speedup is .
| Seq | fixpipe | vector | ||||
|---|---|---|---|---|---|---|
| base | LUT | gain | base | LUT | gain | |
| 16K | 106.1 | 105.4 | 0.69% | 112.6 | 67.4 | 40.10% |
| 24K | 243.9 | 242.1 | 0.71% | 250.1 | 149.7 | 40.12% |
| 32K | 431.2 | 429.8 | 0.32% | 443.8 | 264.4 | 40.44% |
| 48K | 977.2 | 969.0 | 0.84% | 994.4 | 592.7 | 40.39% |
| 64K | 1738.0 | 1720.5 | 1.01% | 1764.1 | 1050.5 | 40.45% |
| 128K | 6955.0 | 6883.2 | 1.03% | 7043.8 | 4192.3 | 40.48% |
| mean | 1741.9 | 1725.0 | 0.77% | 1768.1 | 1052.8 | 40.33% |
measured latencies align down to the microsecond, and we exclude this stage from Table VIII.
The observed speedup is consistent with the underlying LUT design. The fixpipe stage executes per-element scaling, clipping and rounding logic, achieving a 0.3%–1.0% performance improvement. This modest yet steady gain arises from substituting the abs-max/log/ceil/bucketize pipeline with a single linear index lookup. The most significant improvement occurs within the vector stage: the fused LUT reduces latency by an average of 40.33%, and this reduction remains nearly invariant across all tested sequence lengths (40.10% at 16K up to 40.48% at 128K). As the end-to-end acceleration is constrained by the proportion of P-quant computation located in the vector stage, further speedups are anticipated for tensor shapes where the softmax-numerator tile accounts for a larger share compared with the matmul operation.
V. CONCLUSION
This paper introduced EFQ-Softmax, a probability-side method for low-bit attention. Instead of computing high-precision shifted-score exponentials and then quantizing the resulting probabilities, EFQ-Softmax directly generates a block-scaled E2M1 probability operand. Its core generator selects an exponent-only scale per microscaling block, maps residual log-domain scores to 4-bit E2M1 probability codes, and feeds the same generated operand to both the numerator branch and the denominator branch . EFQ-Softmax therefore changes only the probability-code generation path. It does not define a new value-side quantizer, a new attention rule, or a pruning method. The row-maximum update, historical rescaling, high-precision branch outputs, online accumulators, and final normalization remain part of the FlashAttention-style online recurrence.
Although EFQ-Softmax changes the generation of the current unnormalized weights, the final output remains a normalized weighted sum. The online recurrence accumulates and , and applies the final division as in standard online softmax. Since all values in the E2M1 probability code set are nonnegative, the current-block denominator increments are nonnegative. Different microscaling blocks may use different scales, but their contributions are converted to high-precision branch outputs before being accumulated into the common
online state. The only data-dependent metadata introduced by EFQ-Softmax is the scale exponent per microscaling block; the parameters are fixed after calibration and are not stored per token, per row, or per block.
Across Qwen3-8B, Qwen3-VL-8B-Instruct, and WAN2.2-TI2V-5B, EFQ-Softmax preserves task accuracy and output quality relative to FP16 and MXFP4 baselines. These results show that direct low-bit probability-code generation can replace post-softmax probability quantization while maintaining the numerical behavior required by online attention. EFQ-Softmax therefore provides a practical path toward fully low-bit attention kernels in which probability generation, not only and , is aligned with low-bit execution.
REFERENCES
[1] C. Clark, K. Lee, M.-W. Chang, T. Kwiatkowski, M. Collins, and K. Toutanova, "Boolq: Exploring the surprising difficulty of natural yes/no questions," in Proceedings of the 2019 conference of the north American chapter of the association for computational linguistics: Human language technologies, volume 1 (long and short papers), 2019, pp. 2924–2936. [2] P. Clark, I. Cowhey, O. Etzioni, T. Khot, A. Sabharwal, C. Schoenick, and O. Tafjord, "Think you have solved question answering? try arc, the ai2 reasoning challenge," arXiv preprint arXiv:1803.05457, 2018. [3] T. Dao, "Flashattention-2: Faster attention with better parallelism and work partitioning," in International Conference on Learning Representations, vol. 2024, 2024, pp. 35 549–35 562. [4] T. Dao, D. Fu, S. Ermon, A. Rudra, and C. Ré, "Flashattention: Fast and memory-efficient exact attention with io-awareness," Advances in neural information processing systems, vol. 35, pp. 16 344–16 359, 2022. [5] L. Gao, J. Tow, B. Abbasi, S. Biderman, S. Black, A. DiPofi, C. Foster, L. Golding, J. Hsu, A. Le Noac'h, H. Li, K. McDonell, N. Muennighoff, C. Ociepa, J. Phang, L. Reynolds, H. Schoelkopf, A. Skowron, L. Sutawika, E. Tang, A. Thite, B. Wang, K. Wang, and A. Zou, "The language model evaluation harness," 07 2024. [Online]. Available: https://zenodo.org/records/12608602 [6] D. Hendrycks, S. Basart, M. Belinkov, A. Zou, M. Mazeika, D. Song, and J. Steinhardt, "Measuring massive multitask language understanding," 2021. [Online]. Available: https://arxiv.org/abs/2009.03300 [7] Z. Huang, Y. He, J. Yu, F. Zhang, C. Si, Y. Jiang, Y. Zhang, T. Wu, Q. Jin, N. Chanpaisit, Y. Wang, X. Chen, L. Wang, D. Lin, Y. Qiao, and Z. Liu, "Vbench: Comprehensive benchmark suite for video generative models," in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024, pp. 21 807–21 818. [8] A. Kembhavi, M. Salvato, E. Kolve, M. Seo, H. Hajishirzi, and A. Farhadi, "A diagram is worth a dozen images," in European conference on computer vision. Springer, 2016, pp. 235–251. [9] J. Mao, J. Huang, A. Toshev, O. Camburu, A. L. Yuille, and K. Murphy, "Generation and comprehension of unambiguous object descriptions," in Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 11–20. [10] K. Marino, M. Rastegari, A. Farhadi, and R. Mottaghi, "Ok-vqa: A visual question answering benchmark requiring external knowledge," in Proceedings of the IEEE/cvf conference on computer vision and pattern recognition, 2019, pp. 3195–3204. [11] P. Micikevicius, D. Stosic, P. Judd, J. Kamalu, S. Oberman, M. Shoeybi, M. Siu, H. Wu, N. Burgess, S. Ha, R. Grisenthwaite, N. Mellempudi, M. Cornea, A. Heinecke, and P. Dubey, "Fp8 formats for deep learning," arXiv preprint arXiv:2209.05433, 2022. [12] T. Mihaylov, P. Clark, T. Khot, and A. Sabharwal, "Can a suit of armor conduct electricity? a new dataset for open book question answering," in Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018. [13] O. C. Project, "Mx floating-point (mxfp) format," 2024. [Online]. Available: https://www.opencompute.org/documents/ocp-microscaling-formats-mx-v1-0-0-spec-final-pdf
[14] B. D. Rouhani, R. Zhao, A. More, M. Hall, A. Khodamoradi, S. Deng, D. Choudhary, M. Cornea, E. Dellinger, K. Denolf, D. Stosic, V. Elango, M. Golub, A. Heinecke, P. James-Roxby, D. Jani, G. Kolhe, M. Langhammer, A. Li, L. Melnick, M. Mesmakhosroshahi, A. Rodriguez, M. Schulte, R. Shafipour, L. Shao, M. Siu, P. Dubey, P. Micikevicius, M. Naumov, C. Verrilli, R. Wittig, D. Burger, and E. Chung, "Microscaling data formats for deep learning," arXiv preprint arXiv:2310.10537, 2023.
[15] K. Sakaguchi, R. Le Bras, C. Bhagavatula, and Y. Choi, "Winogrande: An adversarial winograd schema challenge at scale," pp. 8732–8740, 2020.
[16] J. Shah, G. Bikshandi, Y. Zhang, V. Thakkar, P. Ramani, and T. Dao, "Flashattention-3: Fast and accurate attention with asynchrony and low-precision," Advances in Neural Information Processing Systems, vol. 37, pp. 68 658–68 685, 2024.
[17] A. Singh, V. Natarajan, M. Shah, Y. Jiang, X. Chen, D. Batra, D. Parikh, and M. Rohrbach, "Towards vqa models that can read," in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2019, pp. 8317–8326.
[18] Q. Team, “Qwen3 technical report,” arXiv preprint arXiv:2505.09388, 2025.
[19] Q. Team, “Qwen3-v1 technical report,” arXiv preprint arXiv:2511.21631, 2025.
[20] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, K. Kaiser, and I. Polosukhin, “Attention is all you need,” Advances in neural information processing systems, vol. 30, 2017.
[21] A. G. Wan Team, “Wan: Open and advanced large-scale video generative models,” arXiv preprint arXiv:2503.20314, 2025.
[22] A. Wang, Y. Pruksachatkun, N. Nangia, A. Singh, J. Michael, F. Hill, O. Levy, and S. Bowman, “Superglue: A stickier benchmark for general-purpose language understanding systems,” Advances in neural information processing systems, vol. 32, 2019.
[23] L. Yu, P. Poirson, S. Yang, A. C. Berg, and T. L. Berg, “Modeling context in referring expressions,” in Proceedings of the European Conference on Computer Vision (ECCV), 2016.
[24] J. Zhang, J. Wei, H. Huang, P. Zhang, J. Zhu, and J. Chen, “Sageattention: Accurate 8-bit attention for plug-and-play inference acceleration,” arXiv preprint arXiv:2410.02367, 2024.
[25] J. Zhang, J. Wei, H. Wang, P. Zhang, X. Xu, H. Huang, K. Jiang, J. Chen, and J. Zhu, “Sageattention3: Microscaling fp4 attention for inference and an exploration of 8-bit training,” Advances in Neural Information Processing Systems, vol. 38, pp. 53 901–53 931, 2026.
[26] W. Zhao, L. Bai, Y. Rao, J. Zhou, and J. Lu, “Unipc: A unified predictor-corrector framework for fast sampling of diffusion models,” Advances in Neural Information Processing Systems, vol. 36, pp. 49 842–49 869, 2023.