---
title: 'α-Entmax: Sparse Generalization of Softmax'
url: https://www.emergentmind.com/topics/entmax
type: topic
---

# α-Entmax: Sparse Generalization of Softmax

Searching arXiv for primary and recent papers on α-entmax to ground the article in the relevant literature.
Searching arXiv for "alpha entmax".
\(\alpha\)-Entmax is a differentiable sparse transformation from logits to a probability distribution on the simplex that generalizes softmax by allowing for sparse probability distributions. In the form used across modern neural sequence models and attention mechanisms, it is written as a thresholded power transformation,
\[
\operatorname{entmax}_{\alpha}(z)_j=\bigl[(\alpha-1)z_j-\tau\bigr]_+^{\frac{1}{\alpha-1}},
\]
where \(\tau\) is chosen so that the probabilities sum to one, and coordinates below threshold are mapped to exactly zero. As \(\alpha \to 1\), it reduces to softmax; at \(\alpha=2\), it yields sparsemax; and for \(\alpha \in (1,2)\) it gives a smoothed sparse transform. The operator is especially relevant when dense softmax tails are undesirable, including large-vocabulary prediction, long-context attention, and dense open-vocabulary vision, but its threshold computation has historically been a central computational bottleneck [2111.06832].

## 1. Definition and variational form

\(\alpha\)-Entmax is commonly presented in two equivalent ways. The first is as a closed-form thresholded map:
\[
\alpha\text{-entmax}_i(\mathbf{z})=\big[(\alpha-1)z_i-\tau(\mathbf{z})\big]_+^{\frac{1}{\alpha-1}},
\]
with \([x]_+=\max\{x,0\}\) and \(\tau(\mathbf{z})\) chosen so that
\[
\sum_j \big[(\alpha-1)z_j-\tau(\mathbf{z})\big]_+^{\frac{1}{\alpha-1}}=1.
\]
This makes \(\alpha\)-entmax a probability distribution, but unlike softmax, many coordinates can be exactly zero [2111.06832].

The second is as the solution to an entropy-regularized optimization problem using Tsallis \(\alpha\)-entropy:
\[
\operatorname{entmax}_{\alpha}(z) = \arg\!\max_{p \in \Delta^{N-1}} \Bigl[ p^\top z + H_{\alpha}(p) \Bigr],
\]
with
\[
H_{\alpha}(p) = \frac{1-\sum_j p_j^\alpha}{\alpha(\alpha-1)}, \qquad \alpha\in(1,2].
\]
This formulation makes explicit that \(\alpha\)-entmax is the sparse analogue of the usual softmax-as-entropy-regularized argmax perspective [2607.07135].

The interpolation parameter \(\alpha\) controls sparsity. The literature summarized here states three standard anchor points: \(\alpha=1\) corresponds to softmax-like behavior, \(\alpha=2\) yields sparsemax, and values in \((1,2)\) give a smoothed sparse transform [2111.06832]. The practical consequence of the thresholded form is equally standard: a token receives nonzero mass iff \((\alpha-1)z_i>\tau(\mathbf{z})\), so low-scoring entries can be discarded exactly rather than merely downweighted [2506.16640].

This exact-zero behavior is the defining distinction from softmax. Softmax is strictly positive everywhere, so every class or token gets nonzero mass. \(\alpha\)-Entmax instead preserves simplex normalization while enabling finite support. In applications, this means that probability mass can be concentrated on the most relevant classes, and irrelevant classes can be assigned exactly zero probability [2111.06832].

## 2. Information-geometric and entropy-theoretic background

The mathematical substrate underlying \(\alpha\)-entmax predates modern neural attention. A foundational antecedent is the theory of relative \(\alpha\)-entropy, denoted \(\mathscr{I}_{\alpha}\), which generalizes the usual relative entropy and yields power-law rather than exponential structure in projection problems [1410.2346].

In that framework, \(\mathscr{I}_{\alpha}\) is defined using escort distributions. If \(P,Q\ll \mu\) with densities \(p,q\in L^\alpha(\mu)\), and \(\alpha>0,\alpha\neq 1\), then
\[
p'(x)=\frac{p(x)^\alpha}{\int p^\alpha\,d\mu},\qquad q'(x)=\frac{q(x)^\alpha}{\int q^\alpha\,d\mu}.
\]
With \(\rho=\alpha^{-1}-1\) and
\[
f(u)=\operatorname{sgn}(\rho)\,(u^{1+\rho}-1),\qquad u\ge 0,
\]
the generalized relative entropy is
\[
\mathscr{I}_\alpha^\mu(P,Q) =\frac{1}{\rho}\log\!\left[ \operatorname{sgn}(\rho)\,I_f(P',Q')+1\right],
\]
where \(I_f\) is Csiszár’s \(f\)-divergence. The paper explicitly proves that
\[
\lim_{\alpha\to 1}\mathscr{I}_\alpha(P,Q)=\mathscr{I}(P\|Q),
\]
so \(\mathscr{I}_{\alpha}\) is a genuine generalization of KL divergence [1410.2346].

For projection onto a linear family,
\[
\mathbb L=\left\{P:\int f_\gamma\,dP=0,\ \gamma\in\Gamma\right\},
\]
the forward \(\mathscr{I}_{\alpha}\)-projection \(Q\) of \(R\) has density \(q\) satisfying the power-law relation
\[
q(x)^{\alpha-1}=c\,r(x)^{\alpha-1}+g(x),\qquad x\notin N,
\]
with \(q(x)=0\) on \(N\). This is not exponential-family-like but a power-law family member, and the thresholded support condition \(q(x)=0\) on a set \(N\) already exhibits the sparse / thresholded behavior that later becomes central in sparsemax and \(\alpha\)-entmax [1410.2346].

The same theory establishes a Pythagorean property:
\[
\mathscr{I}_\alpha(P,R)\ge \mathscr{I}_\alpha(P,Q)+\mathscr{I}_\alpha(Q,R),
\]
for projection of \(R\) onto convex \(\mathbb E\). It also connects minimization of \(\mathscr{I}_{\alpha}\) against the uniform distribution with maximum Rényi entropy, and therefore also with the Tsallis maximum entropy principle because Tsallis entropy is a monotone transform of Rényi entropy [1410.2346].

This suggests a clear conceptual lineage: modern \(\alpha\)-entmax inherits a power-law geometry in place of the exponential-family geometry associated with KL and softmax. The earlier theory does not discuss neural attention, but it shows that minimizing a generalized entropy divergence naturally yields sparse, thresholded, power-law distributions, precisely the structural phenomenon exploited by \(\alpha\)-entmax [1410.2346].

## 3. Sparsity mechanism and computational bottlenecks

The principal attraction of \(\alpha\)-entmax is that it retains normalization on the simplex while introducing an input-dependent threshold. Because
\[
z_j \le \tau \;\Rightarrow\; p_j = 0,
\]
the operator acts as a content-aware selector rather than a merely sharper dense normalizer [2607.07135].

This threshold, however, is also the main source of computational overhead. Unlike softmax, where normalization is a simple log-sum-exp over all logits and can be implemented in highly optimized CUDA kernels, \(\alpha\)-entmax requires identifying the active support and solving for the threshold that makes the outputs sum to one. In the original formulation, computing \(\tau(\mathbf{z})\) involves sorting the logits. Sorting over a large vocabulary is expensive, especially in NLP settings with tens of thousands of classes. That is why standard \(\alpha\)-entmax is significantly slower than softmax in both training and inference [2111.06832].

For general \(\alpha\), the threshold is generally found by bisection. Special cases admit more structured solvers. The sparsemax case \((\alpha=2)\) uses
\[
p_j = [z_j-\tau]_+,
\]
with the threshold found by sorting logits \(z_{(1)}\ge \dots \ge z_{(N)}\) and finding the largest active set size \(k\) such that
\[
1 + k z_{(k)} > \sum_{i=1}^k z_{(i)},
\]
then
\[
\tau = \frac{\sum_{i=1}^k z_{(i)} - 1}{k}.
\]
For \(\alpha=1.5\), an exact sort-based algorithm exists because the exponent becomes an integer [2607.07135].

The computational problem can also be posed as root finding. One must solve
\[
f(\tau) \coloneqq -1 + \sum_{j=1}^n \left[(\alpha-1)s_j - \tau\right]_+^{\frac{1}{\alpha-1}} = 0,
\]
where \(f\) is continuous and strictly decreasing, so the root is unique. This is substantially less hardware-friendly than softmax’s additive normalizer
\[
\tau = \log \sum_j \exp(s_j),
\]
which can be accumulated online in one pass [2604.15180].

A common misconception is that sparsification benefits arise only from sharpening or temperature scaling. In dense open-vocabulary CLIP, an ablation reported that a matched-support random mask and temperature scaling both underperform entmax, showing that which entries are removed matters, not just how many. The benefit is attributed to a data-dependent cutoff rather than to mere saturation [2607.07135].

## 4. Output-layer use, losses, and the \(\alpha\)-ReLU alternative

In large-vocabulary generation, \(\alpha\)-entmax is motivated by a limitation of softmax: by producing a dense probability distribution each token in the vocabulary has a nonzero chance of being selected at each generation step, leading to a variety of reported problems in text generation. The key benefit of \(\alpha\)-entmax is that probability mass is concentrated on the most relevant classes, and irrelevant classes can be assigned exactly zero probability, which is attractive for language modeling and machine translation [2111.06832].

A practical complication is that normalized entmax is slower than optimized softmax. One response is the output-layer substitute \(\alpha\)-ReLU, an unnormalized sparse transform defined as
\[
\alpha\text{-ReLU}_i(\mathbf{z})=\big[(\alpha-1)z_i-\tau\big]_+^{\frac{1}{\alpha-1}},
\]
where now \(\tau\) is a constant, not a function of \(\mathbf{z}\). The associated loss is
\[
\ell(\mathbf{z},y)= (\alpha\text{-ReLU}(\mathbf{z})-\mathbf{e}_y)^\top \left(\mathbf{z}-\frac{\tau}{\alpha-1}\mathbf{1}\right) +\mathcal{H}_\alpha[\alpha\text{-ReLU}(\mathbf{z})],
\]
with
\[
\mathcal{H}_\alpha[\mathbf{p}] =\frac{1}{\alpha(\alpha-1)}\left(1-\sum_j p_j^\alpha\right).
\]
The paper proves the gradient identity
\[
\nabla_{\mathbf{z}} \ell(\mathbf{z},y)=\alpha\text{-ReLU}(\mathbf{z})-\mathbf{e}_y,
\]
which mirrors the familiar “prediction minus target” structure [2111.06832].

The same work emphasizes that \(\alpha\)-ReLU is a “shifted ReLU raised to a power”: for \(\alpha=2\), \(\alpha\)-ReLU reduces to standard ReLU when \(\tau=0\), and for \(\alpha\in(1,2)\), it becomes a smoothed version of ReLU. The Jacobian is diagonal,
\[
\mathbf{J}_{\alpha\text{-ReLU}(\mathbf{z})} = \operatorname{diag}\left([\alpha\text{-ReLU}(\mathbf{z})]^{2-\alpha}\right),
\]
which enables the cancellation with the derivative of Tsallis entropy that yields the gradient identity [2111.06832].

Empirically, the method was evaluated on Transformer-based NMT across IWSLT’14 De\(\to\)En, WMT’14 En\(\to\)De, and WMT’13 En\(\to\)Ru. The main BLEU results reported were softmax: \(35.3 / 28.7 / 22.4\), sparsemax: \(35.5 / 26.6 / 19.6\), 1.5-entmax: \(36.6 / 28.6 / 23.9\), 1.5-entmax (top-100): \(36.7 / 28.4 / 23.7\), and 1.5-ReLU: \(37.3 / 28.6 / 24.6\). The same study also reported that softmax assigns the empty translation a much higher probability too often, whereas sparsemax, entmax, and \(\alpha\)-ReLU drastically reduce this issue [2111.06832].

A notable empirical difference is that \(\alpha\)-ReLU is less sparse than 1.5-entmax, yet this lower sparsity correlates with slightly better BLEU in these experiments. The paper argues that \(\alpha\)-entmax’s threshold \(\tau(\mathbf{z})\) grows during training, increasing sparsity, whereas \(\alpha\)-ReLU keeps \(\tau\) fixed [2111.06832].

## 5. Attention mechanisms and long-context modeling

Within transformer attention, \(\alpha\)-entmax is used by replacing the row-wise softmax normalization with a sparse simplex-preserving alternative. In a causal transformer, attention weights are formed from logits
\[
z_{ij}^{(\ell)} = \langle \bm{q}_i^{(\ell)}, \bm{k}_j^{(\ell)} \rangle / \sqrt{d},
\]
and normalized by a map \(\pi:\mathbb{R}^n\to\triangle_n\):
\[
p_{ij}^{(\ell)} = \pi(\bm{z}_{i}^{(\ell)})_j.
\]
Standard transformers use \(\pi=\mathrm{softmax}\); sparse variants replace this with \(\alpha\)-entmax [2506.16640].

The long-context rationale is that softmax always assigns positive probability to every token, so as sequence length increases, non-informative tokens accumulate attention probability mass, leading to dispersion and representational collapse. Sparse attention mechanisms using \(\alpha\)-entmax can avoid these issues, due to their ability to assign exact zeros to irrelevant tokens [2506.16640].

A central result summarized for long-context generalization is that \(\alpha\)-entmax can keep entropy at
\[
\mathcal{O}(\log s)
\]
where \(s\) is the number of tokens with nonzero probability, instead of softmax’s \(\mathcal{O}(\log n)\). This matters for tasks that depend on fixed-size patterns or local structures, including associative recall, copy/retrieval, reverse, local count, and 2-back, because sparse attention can remain focused on a small support set regardless of sequence length [2506.16640].

The same paper introduces Adaptive-Scalable Entmax (ASEntmax),
\[
\text{ASEntmax}(\bm{z}) = \aentmax((\delta + \beta (\log n)^{\gamma}) \bm{z}),
\]
with head-specific, learnable scaling. It recovers standard \(\alpha\)-entmax when \(\beta=0\), and can interpolate between sharper and smoother regimes by adapting sparsity per head and query [2506.16640].

Positional encoding interacts strongly with \(\alpha\)-entmax. With ALiBi,
\[
z_{ij}^{(\ell)} = \langle \bm{q}_i^{(\ell)}, \bm{k}_j^{(\ell)} \rangle / \sqrt{d} + m \cdot (j-i),
\]
the paper’s key point is that \(\alpha\)-entmax converts ALiBi’s smooth recency bias into a hard attention window. With RoPE, thresholding yields multi-scale sparse attention rather than a single distance cutoff. The best reported results generally came from combining NAPE with ASEntmax [2506.16640].

A related line uses \(\alpha\)-entmax in CLIP’s final visual self-attention layers as a training-free inference-time substitution for row-wise softmax. The stated motivation is that dense softmax attention spreads attention across many low-salience tokens, producing noise that obscures the fine-grained, spatially localized cues required for dense, open-vocabulary prediction. Entmax is positioned there as an implicit denoiser that zeroes contextually irrelevant dependencies while redistributing mass onto the most relevant tokens [2607.07135].

## 6. Efficient kernels, decoding, and hierarchical routing

Because the main obstacle to practical deployment is threshold computation, several later works focus on making \(\alpha\)-entmax hardware-efficient. AdaSplash-2 addresses this by introducing a histogram-based initialization that reduces the number of iterations needed to compute \(\tau\) to typically 1–2. The scores are re-centered and rescaled so that the threshold search lies in \([0,1]\), a coarse histogram is computed on the fly and stored in on-chip SRAM, and the resulting histogram root \(\tau_h\) satisfies
\[
\tau^\star - h < \tau_h \le \tau^\star, \qquad 0 \le \tau^\star - \tau_h < \frac{1}{B}.
\]
The paper states that AdaSplash-2 matches or improves per-step training time relative to FlashAttention-2 when block sparsity is moderate-to-high, e.g. \(>60\%\), and that models trained with efficient \(\alpha\)-entmax attention match softmax baselines at short-context lengths and achieve substantial gains in long-context settings [2604.15180].

In autoregressive decoding, exact sparsity changes the nature of the approximation problem. EntmaxKV states the key implication as
\[
S\subseteq I \quad \Longrightarrow \quad \delta=0 \quad \Longrightarrow \quad \tilde{\mathbf{o}}=\mathbf{o},
\]
where \(S\) is the entmax support and \(I\) is the kept set. With softmax, every token gets positive mass, so any truncation discards probability mass; with entmax, sparse decoding is exact once support is recovered. The paper also proves the output error bound
\[
\|\mathbf{o}-\tilde{\mathbf{o}}\|_2 \le 2B\delta,
\]
and reports up to \(3.36\times\) speedup over full-cache softmax FlashDecoding and \(5.43\times\) speedup over full entmax at 1M context length [2605.21649].

In hierarchical attention, DashAttention uses \(\alpha\)-entmax in Stage 1 to decide which KV chunks to keep before Stage 2 token-level softmax attention. Chunk-level routing logits
\[
\bar z_{i,c}^{(h)} =
\langle {\bm{q}_{i}^{(h)},\, \bar{\bm{k}_{c}^{(r)}} \rangle\, /\, \sqrt{d_h}
\]
are transformed as
\[
\hat{\bm{w}}_{i}^{(h)} = \alpha\text{-entmax}\!\left(\gamma \bar{\bm{z}}_{i}^{(h)} \right),
\]
with support
\[
\hat{\mathcal{S}}_{i}^{(h)} = \{c \mid w_{i,c}^{(h)} > 0\}.
\]
The paper emphasizes that, unlike top-\(k\), entmax gives exact zeros while keeping the support adaptive and differentiable, so the number of selected chunks can vary by query, head, and layer. It also states that DashAttention is non-dispersive and achieves comparable accuracy as full attention with 75% sparsity [2605.18753].

These systems works make a common point: \(\alpha\)-entmax is not only a sparsifying normalizer but also an enabling mechanism for support-aware algorithms. This suggests that once support recovery or support-aware routing becomes the main design objective, exact zeros change both algorithmic structure and attainable efficiency.

## 7. Practical trade-offs and recurrent points of interpretation

Across the literature, the main practical trade-off is between normalized sparsity and computational cost. Standard \(\alpha\)-entmax preserves the probability simplex and yields input-dependent support, but it requires threshold computation that is slower than optimized softmax. This is why alternatives such as \(\alpha\)-ReLU, approximate solvers, histogram-based kernels, and support-aware page selection appear repeatedly [2111.06832].

A second recurrent point is that sparsity is not uniformly beneficial. In CLIP dense prediction, the gain from attention sparsification is proportional to how much baseline attention spreads off the target class; if the baseline attention is already concentrated on the right tokens, entmax has little to fix and may even remove useful mass. Likewise, in long-context learning, fixed-temperature \(\alpha\)-entmax can be too sparse for some tasks and too diffuse for others, which motivates adaptive scaling in ASEntmax [2607.07135].

A third point concerns differentiability relative to hard selection. The later sparse-attention systems repeatedly distinguish \(\alpha\)-entmax from top-\(k\): top-\(k\) is sparse but discontinuous and non-differentiable at selection boundaries, whereas \(\alpha\)-entmax remains differentiable and induces exact zeros smoothly. This makes it especially suitable for hierarchical or end-to-end trainable sparse mechanisms [2604.15180].

A plausible implication is that \(\alpha\)-entmax occupies a technically distinctive middle ground. It is denser and easier to optimize than purely hard routing, but structurally more selective than softmax because it replaces dense tails with thresholded power-law support. That combination explains its continued use in machine translation output layers, long-context transformers, sparse decoding, hierarchical attention, and dense open-vocabulary vision [2506.16640].

Source: https://www.emergentmind.com/topics/entmax