Entmax-1.5: Sparse Differentiable Transformation
- Entmax-1.5 is a specialized α-entmax transformation (with α=1.5) that applies a squared-threshold function to assign exact zeros to low-scoring logits.
- It is employed in transformer attention and seq2seq output layers to yield sparse activations that reduce search space and alleviate issues like attention dispersion.
- Its variational formulation and Fenchel-Young loss structure provide clear gradient signals, while computational surrogates like 1.5-ReLU and AdaSplash optimize performance.
Searching arXiv for foundational and papers on Entmax-1.5 and related sparse attention. Entmax-1.5 is the -entmax transformation specialized to , used to map a logit vector to a normalized distribution with exact zeros. In the sources considered here, it occupies an intermediate regime between the dense softmax limit and the sparsemax case, and appears in several distinct roles: as a row-wise attention normalization in transformers, as an output-layer distribution and training loss in seq2seq models, as the fixed sparse baseline against which adaptive variants are compared, and as a sparse weighting mechanism outside sequence modeling. Its defining practical property is support selection by thresholding: low-scoring coordinates are assigned probability exactly zero, while the surviving coordinates are normalized through a squared-threshold form (Vasylenko et al., 19 Jun 2025, Peters et al., 2021, Tezekbayev et al., 2021).
1. Mathematical definition and equivalent parameterizations
For , recent transformer work defines -entmax as
with chosen so that the output sums to $1$. In attention, this map is applied row-wise to a query’s score vector, typically with logits
Setting yields
The support condition becomes
0
so Entmax-1.5 keeps only coordinates above an adaptive threshold and sets the rest exactly to zero (Vasylenko et al., 19 Jun 2025).
A seq2seq treatment writes the same family through the Tsallis/1-exponential: 2 and for 3 expands it as
4
Under this parameterization, the 5 case is written as
6
This suggests that the apparent discrepancy between the two formulas is a difference in threshold parameterization rather than a change in the underlying map (Peters et al., 2021).
The practically important specialization to 7 also admits a closed-form threshold expression once the support size 8 is known. With sorted logits 9,
0
where
1
The valid support size satisfies
2
This explicit structure is mathematically attractive, but it also exposes the computational difficulty: identifying 3 requires information from sorted logits (Tezekbayev et al., 2021).
2. Variational form, losses, and differential structure
A variational definition used in the long-context attention literature is
4
where 5 is the Tsallis6 entropy. The same family is also presented through Fenchel-Young regularized prediction: 7 with entmax recovered by taking 8 to be the negative Tsallis entropy. For 9,
0
These formulations are important because they make Entmax-1.5 not merely a decoding transform but also the prediction map associated with a specific training loss (Vasylenko et al., 19 Jun 2025, Peters et al., 2021).
The corresponding Fenchel-Young loss is
1
with gradient
2
For Entmax-1.5 this gives the familiar
3
The same framework supports label smoothing by replacing the one-hot target with 4, yielding
5
and gradient
6
One motivation given for this Fenchel-Young smoothing is that vanilla KL-style smoothing is problematic for sparse distributions because KL diverges when the model has zeros and the target does not (Peters et al., 2021).
This gradient structure also motivates later surrogates. A computational paper on sparse output layers notes that when entmax is coupled with the entmax loss, differentiation again produces the usual “prediction minus one-hot target” form, and proposes a non-normalized surrogate designed to preserve that training behavior while avoiding the cost of adaptive thresholding. The surrogate is not exact Entmax-1.5, but its loss is engineered so that the gradient retains the same algebraic pattern (Tezekbayev et al., 2021).
3. Entmax-1.5 in attention and long-context transformers
In transformer attention, Entmax-1.5 is used by replacing the softmax map in
7
with 8-entmax, typically applied row-wise to the standard scaled dot-product scores and combined with positional choices such as NoPE, ALiBi, RoPE, or the hybrid NAPE. A recent long-context study states explicitly: “For our experiments with 9-entmax, we use 0 as the default value for the 1-entmax models, unless mentioned otherwise.” In that work, Entmax-1.5 functions primarily as the default fixed sparse transformer attention mechanism and as the baseline recovered by ASEntmax when 2 (Vasylenko et al., 19 Jun 2025).
The theoretical case for Entmax-1.5 in long contexts is the general case for 3-entmax with 4. Softmax attention is dense and must distribute mass over all tokens; entmax can assign exact zeros. The paper emphasizes that this helps avoid attention dispersion, representational collapse, and over-squashing. One lemma establishes that when an extra token is added, softmax must strictly reduce the probability of an existing token, whereas 5-entmax may leave that probability unchanged if the new token falls below threshold. The same work argues that with bounded logits softmax entropy tends to 6, while 7-entmax entropy scales like 8 when the support size is 9, so attention can remain focused even as total sequence length grows. It also reports stronger layerwise gradients, up to 0 larger than softmax, and gives an ALiBi analysis in which 1-entmax induces a hard attention window (Vasylenko et al., 19 Jun 2025).
The empirical behavior of fixed Entmax-1.5 in long-context generalization is mixed but often strong. On MQMTAR with NAPE, fixed Entmax scored 2 at lengths 3 and 4, remained at 5 at 6, and reached 7 at 8K, compared with NAPE softmax at 9 at $1$0K; however, at $1$1K it scored $1$2 versus softmax’s $1$3. On Reverse with NAPE, fixed Entmax gave $1$4 at length $1$5, $1$6 at $1$7, $1$8 at $1$9, and 0 at 1, substantially above softmax. On Sort with NAPE, fixed Entmax achieved 2 at 3 and 4 at 5, while softmax was already 6 from 7 onward. By contrast, Copy is the clearest case in which fixed sparse attention is “too sparse”: under NAPE, fixed Entmax fell from 8 in-distribution to 9 by 0 and 1, while softmax was much stronger. On Max Retrieval at 2, fixed Entmax-3 scored 4; larger fixed 5 values improved concentration up to 6 at 7 and then degraded, while ASEntmax with 8 and 9 reached 0. This suggests that Entmax-1.5 is a useful fixed sparse operating point, but not a universally optimal one across task structure and context length (Vasylenko et al., 19 Jun 2025).
4. Output-layer normalization, search-space shrinking, and seq2seq use
A separate line of work studies Entmax-1.5 as an output-layer replacement for softmax in locally normalized seq2seq models: 1 Here the key claim is that exact zeros shrink the search space. Under softmax, every vocabulary item retains nonzero probability; under Entmax-1.5, many local continuations receive zero probability and can never appear in any hypothesis. The paper frames this as a remedy for length bias and for the “cat got your tongue” pathology, where the empty string is assigned excessively high probability (Peters et al., 2021).
In machine translation, Entmax-1.5 is the only sparse entmax setting evaluated. The paper reports that with 2, the percentage of development examples where the empty string is more probable than the beam hypothesis collapses to near zero: 3 for de4en, 5 for en6de, 7 for ja8en, 9 for en00ja, 01 for ro02en, and 03 for en04ro. By contrast, softmax models exhibit much larger values, and label smoothing can worsen them substantially. The same study reports that unsmoothed Entmax-1.5 beats smoothed softmax on 05 MT directions, while label-smoothed Entmax-1.5 is best on 06, unsmoothed Entmax-1.5 best on 07, and tied on 08. Representative BLEU numbers include de09en: 10 for Entmax-1.5 versus 11 for smoothed softmax; ro12en: 13 for smoothed Entmax-1.5 versus 14 for smoothed softmax; and en15ro: 16 for unsmoothed Entmax-1.5 versus 17 for smoothed softmax (Peters et al., 2021).
The same paper measures how sparse these output distributions are under forced decoding. For Entmax-1.5, the average percentage of the target vocabulary with nonzero probability is 18 to 19 at 20, 21 to 22 at 23, and 24 to 25 at 26, whereas cross-entropy models remain 27 dense. It also reports better calibration than softmax at the same smoothing level. Moderate smoothing improves performance and calibration, but the paper is explicit that smoothing and sparsity trade off: heavier smoothing makes the tail heavier and can reintroduce empty-string problems (Peters et al., 2021).
Entmax-1.5 is also used beyond MT within seq2seq. On multilingual grapheme-to-phoneme conversion, 28 with 29 achieved WER 30 and PER 31, and the ensemble reached WER 32 and PER 33, improving on the previous best ensemble baseline. On crosslingual morphological inflection, unsmoothed Entmax-1.5 reached accuracy 34 and Levenshtein distance 35, while smoothed Entmax-1.5 improved to accuracy 36 and distance 37. The same paper additionally notes that its G2P model uses Entmax-1.5 attention, so the 38 operating point appears in both output normalization and attention within that architecture (Peters et al., 2021).
5. Computation, kernels, and support-aware inference
The principal computational bottleneck of Entmax-1.5 is the adaptive threshold 39. One paper states this directly: “It is this threshold 40 that makes the computation of 41-entmax slow, because one needs to sort the components of 42 to find 43.” In large-vocabulary settings, this overhead is substantial. Rather than proposing a faster exact Entmax-1.5 algorithm, that work introduces the surrogate
44
where 45 is constant, not input-dependent. The method is therefore not normalized and not exact Entmax-1.5, but is intended to mimic its sparse support and training dynamics. Training time results show the scale of the original bottleneck: on IWSLT'14 En46De, softmax took 47 h, 1.5-entmax 48 h, and 1.5-ReLU 49 h; on WMT'14 De50En, softmax took 51 h, 1.5-entmax 52 h, and 1.5-ReLU 53 h. In inference on WMT En54Ru, softmax is reported as almost twice faster than full-sort 1.5-entmax, while 1.5-ReLU runs at softmax speed (Tezekbayev et al., 2021).
Exact attention-side acceleration is addressed by AdaSplash, which implements 55-entmax attention in Triton and introduces a hybrid Halley-bisection solver for the root problem
56
in the 57 case. The paper reports a 58-fold reduction in the number of iterations needed to compute 59-entmax and states that for 60 the hybrid method reaches machine precision for output and gradient in 61 iterations, whereas standard bisection needs 62. AdaSplash then combines this solver with Flash-style tiling and a sparsity-aware block mask so that exact zeros can be skipped in forward and backward passes. In GPT-2 training, FlashAttention-2 ran at 63 s/step and 64 GB, while Entmax-1.5 via AdaSplash ran at 65 s/step with the same 66 GB, dramatically better than prior entmax implementations. On long-sequence benchmarks the paper states that AdaSplash approaches, and in some cases surpasses, the efficiency of FlashAttention-2 when sparsity is high (Gonçalves et al., 17 Feb 2025).
AdaSplash-2 pushes the same agenda further with histogram-based initialization of 67, reducing the number of refinement iterations to typically 68--69. Its central guarantee is
70
where 71 is the histogram estimate. For 72, the paper emphasizes that the histogram problem can be solved exactly from bin counts without sorting, and that Halley refinement remains stable because 73 is bounded for 74. The reported systems-level outcome is that AdaSplash-2 matches or improves per-step training time relative to FlashAttention-2 when block sparsity is moderate-to-high, for example above 75. All major modeling experiments in that paper use 76, and the strongest long-context results come from Entmax-1.5 paired with NAPE rather than RoPE (Gonçalves et al., 16 Apr 2026).
Decode-time efficiency introduces a different question: not how to compute dense Entmax-1.5 faster, but how to avoid reading irrelevant KV cache pages before sparsity is known. EntmaxKV formulates this as support recovery. For general 77-entmax, if a kept token set 78 contains the true support 79, then sparse decoding is exact; for Entmax-1.5 this means exactness once all indices satisfying 80 are retained. The paper measures error through the dropped mass 81 and proves
82
with exact equality of sparse and dense outputs when 83. Empirically, EntmaxKV reports better support retention, lower dropped mass, and lower output error than softmax-based sparse decoding at matched KV budgets, and at 84M context length achieves up to 85 speedup over full softmax and 86 over full entmax while closely matching full-cache entmax (Duarte et al., 20 May 2026).
6. Broader uses, operating-point interpretation, and limits
Entmax-1.5 also appears outside attention and output normalization. In Forward-Forward learning, an “entmax-weighted energy” goodness function is defined by
87
Here 88 recovers softmax, 89 gives sparsemax, and intermediate values produce adaptive sparsity. The paper’s central empirical conclusion is that 90 is best: on Fashion-MNIST with a 91 network, standard FF with Entmax-1.5 energy achieved 92, and FFCL with Entmax-1.5 reached 93, the best overall result in the paper. The corresponding 94-sweep exhibits a clear inverted-U, with 95 outperforming both the dense endpoint 96 and the harder sparse endpoint 97 (Yuksel et al., 28 Mar 2026).
This broader evidence reinforces a recurring interpretation of Entmax-1.5 as a moderate sparse operating point rather than an extremal one. In the FF paper, 98 corresponds to roughly 99--00 of neurons receiving nonzero weight, varying per input. In long-context transformers, Entmax-1.5 is repeatedly used as the default fixed sparse baseline, while later methods such as ASEntmax are introduced precisely because fixed sparsity can be either too weak or too strong depending on the task. In machine translation, Entmax-1.5 sharply reduces empty-string pathologies and shrinks the beam-search space, but heavier label smoothing can erode those benefits. In computational work, 1.5-ReLU is proposed as a fast surrogate precisely because exact Entmax-1.5 thresholding remains expensive unless specialized kernels are used (Vasylenko et al., 19 Jun 2025, Peters et al., 2021, Tezekbayev et al., 2021).
Several common misunderstandings are corrected by this recent literature. Entmax-1.5 is not the main novelty in all papers that use it: some papers treat it chiefly as a baseline or default sparse choice, with the primary contribution lying in adaptive scaling, efficient kernels, or support-aware decoding. It is not merely “softmax with fewer nonzeros”: its variational definition, Fenchel-Young loss, and exact support recovery behavior have algorithmic consequences not shared by dense truncation heuristics. Nor is it uniformly superior to either denser or sparser alternatives. The most consistent picture across the cited work is narrower and more technical: Entmax-1.5 is a sparse, differentiable, squared-threshold normalization that often provides a robust middle ground between dispersion and over-hard selection, and whose value becomes especially pronounced when exact zeros can be exploited by the model, the loss, or the system implementation (Vasylenko et al., 19 Jun 2025, Yuksel et al., 28 Mar 2026).