The Fundamental Role of Schur-Convexity in Uncertainty Estimation

A short two-sentence abstract belongs here. It should summarize the post in plain text, without mathematics or hyperlinks, to mirror the website description field.

When discussing uncertainty estimation in deep learning, often, the first scenario that comes to mind is of the following shape:

This describes the setting of selective prediction : we select predictions for which the model has high confidence and discard or process separately predictions with high uncertainty.In this blogpost we use “confidence” and “uncertainty” simply as opposite notions.

Selective prediction example: if the model is uncertain, an automated medical diagnosis is deferred to a human expert. Inspired by .

Selective prediction covers a range of popular tasks such as misclassification detection and OOD detection that the reader may be aware of.Selective prediction is orthogonal to confidence calibration, which is not the focus of this blogpost. See for a blogpost that clarifies the differences. It is well motivated by safety critical applications where serving a bad prediction comes with high costs.

Confidence scores , $C\in \mathbb R$ are a core element of selective prediction; they convert model outputs into a scalar measure of confidence/uncertainty. A selection decision can then be made, e.g. accept a prediction only if $C$ exceeds a certain confidence threshold. There is plenty of research on these confidence scores , generally focusing on improving their ability to distinguish good outputs from bad ones. The focus of this blogpost, however, lies elsewhere.

In this blogpost, we are interested in confidence scores $C$ that map the softmax output of a classification network into a scalar value,\(\Delta^{K-1}\) refers to a probability simplex over \(K\) discrete outcomes – or in other terms, a \(K-\)event discrete probability distribution/vector.

$$ C:\Delta^{K-1}\to\mathbb{R}, \quad \boldsymbol{\pi}\mapsto C(\boldsymbol{\pi}), \quad \boldsymbol{\pi}\in\Delta^{K-1}. \tag{1} $$

which is then used to perform selection based on whether it exceeds a threshold,

$$ g(\boldsymbol \pi;\tau) = \begin{cases} 0\text{ (reject prediction if uncertain)}, &\text{if }C(\boldsymbol \pi) < \tau\\ 1\text{ (accept prediction if confident)}, &\text{if }C(\boldsymbol \pi) \geq \tau~, \end{cases} \tag{2}\label{eq:select} $$

Notably, since the threshold can be freely set, strictly increasing transforms $h(C(\boldsymbol{\pi}))$ give equivalent performance.

Softmax-based confidence scores and selective prediction: \(C\) is a function that maps a categorical softmax distribution \(\boldsymbol \pi\) to a scalar measure of confidence. Higher-confidence predictions are selected according to a decision threshold.

The AI research literature tends to take certain properties of softmax-based confidence scores for granted, and so readers may not have thought much about them. The aim of this blogpost is to explain some fundamental confidence score properties in an intuitive and enjoyable manner.The ideas explored in this blogpost around Schur convexity are established in classical mathematics and information theory . However, for the intended audience of AI researchers and practitioners, they are typically overlooked.

In this blogpost we:
  • Discuss some fundamental properties of confidence scores (that AI researchers often take for granted).

  • Show how Schur convexity can induce these properties.

  • Discuss the prevalence of Schur-convex scores in the literature.

  • Show that Schur convexity nonetheless permits a wide range of selection behaviour.

What Fundamental Properties Should a Confidence Score Have?

If you were to ask a deep learning researcher or practitioner what fundamental properties a softmax confidence score $C(\boldsymbol \pi)$ should have, they would probably say the following two things straight away off the top of their head:Note that in this section we will keep definitions informal to keep things intuitive for all readers.

Property 1: Confidence is maximised for a one-hot distribution, e.g. \([0,1,0,\dots,0]\)

Property 2: Confidence is minimised for a uniform distribution, \([\frac{1}{K},\frac{1}{K},\dots,\frac{1}{K}]\)

To many, this will be intuitive and obvious. When a model thinks there is only a single possible outcome, it should be maximally confident. On the other hand, when it assigns equal probability to all outcomes, it should be maximally uncertain.

For our next property, consider a transfer of probability mass from a larger probability to a smaller one, that makes the distribution less unequal, like Robin Hood – stealing from the rich and giving to the poor.

Robin Hood Transfer: Move probability mass \(\delta\) from a larger probability \(\pi_i\) to a smaller one \(\pi_j\), where \(\pi_i > \pi_j\) and \(0 < \delta < \pi_i - \pi_j\). The distribution becomes “more equal”.

Robin Hood aiming a bow and arrow

Doesn’t it make sense that confidence should decrease after such a transfer? Which gives us:

Property 3: Confidence decreases after a Robin Hood transfer, \(\boldsymbol \pi \rightarrow \boldsymbol{\pi'}\).

Although the above property may not immediately come to mind for an AI researcher, spreading out probability so it is more equal between outcomes intuitively ought to increase a model’s uncertainty. The literature tends to take the above properties for granted, and so readers may not have thought much about them. Confidence scores are motivated through decision theory , intuition and empirical performance without explicitly discussing these properties. It may seem obvious that a confidence score should behave as the above, but the reader may be unsure of exactly why they do. We will now demonstrate how the last “Robin Hood” property, formally known as "Schur convexity" induces the other two, and how it organically appears throughout many of the softmax confidence scores in the deep learning uncertainty literature.

Schur-Convexity Gives Us These Properties

If Property 3 holds for one Robin Hood transfer, then it also holds for a sequence of Robin Hood transfers, with $C$ decreasing at each step.

$$ \begin{align} &\text{For Robin Hood transfers } \boldsymbol{\pi}^{(1)} \rightarrow \boldsymbol{\pi}^{(2)} \rightarrow \cdots \rightarrow \boldsymbol{\pi}^{(n)}, \nonumber \\ &C(\boldsymbol{\pi}^{(1)}) > C(\boldsymbol{\pi}^{(2)}) > \cdots > C(\boldsymbol{\pi}^{(n)}) \tag{3} \end{align} $$
Widget that visualises a sequence of Robin Hood transfers where confidence keeps decreasing.

The neat thing, is that given the above, the maximum and minimum end-points drop out intuitively.

Thus, Property 3 induces Properties 1 and 2.This transfer-based argument assumes that confidence varies continuously with \(\boldsymbol{\pi}\); we elaborate on this detail later. This is visualised in the following widget.

Widget bidirectionally visualises extrema.
Key Takeaway

It is intuitively desirable for a confidence score $C(\boldsymbol{\pi})$ to decrease after a Robin Hood transfer (Property 3), i.e. increasing equality between two classes increases uncertainty. If this is the case, it will also decrease after a sequence of such transfers. This means that $C$ is maximised for one-hot distributions and minimised for uniform distributions (Properties 1 and 2).

Schur-Convexity, Formally

The above behaviour, which we’ve tried to introduce intuitively, can be framed formally as Majorisation and Schur convexity :We note that the mathematical theory is well established, and if the reader wishes to understand it in more detail they should consult the referenced resources. This blog aims to present ideas to a broader audience, so we will refrain from dwelling too long on theory.

Majorisation

For vectors $\boldsymbol{x},\boldsymbol{y}\in \mathbb{R}^K$, where $\sum_k x_k=\sum_k y_k$, $\boldsymbol{x}$ majorises $\boldsymbol{y}$ if, after sorting each vector from largest to smallest:

$$ \sum_{i=1}^k x_i^\text{sorted} \geq \sum_{i=1}^k y_i^\text{sorted}\quad \text{for all } k=1,\dots,K, \tag{4}\label{eq:maj} $$

i.e. adding one element at a time, the cumulative sum of sorted (highest to lowest) $\boldsymbol{x}$ stays greater than or equal to that of $\boldsymbol{y}$, all the way. This is denoted:

$$ \boldsymbol{x} \succ \boldsymbol{y} \tag{5} $$

Linking to our above illustrations about probabilities, note that:

Schur Convexity

A function $f:\mathbb{R}^K\rightarrow\mathbb{R}$ is Schur convex if

$$ f(\boldsymbol{x}) \geq f(\boldsymbol{y}) \text{ when } \boldsymbol{x}\succ\boldsymbol{y} \tag{6} $$

and strictly Schur convex if

$$ f(\boldsymbol{x}) > f(\boldsymbol{y}) \text{ when } \boldsymbol{x}\succ\boldsymbol{y} \tag{7} $$

when $\boldsymbol{x}$ and $\boldsymbol{y}$ are not permutations of each other. If they are,If \(\boldsymbol{x}\) and \(\boldsymbol{y}\) are permutations of each other, \(\boldsymbol{x}\succ\boldsymbol{y}\) according to Eq. \ref{eq:maj}, so we require this additional case.

$$ f(\boldsymbol{x}) = f(\boldsymbol{y}). \tag{8} $$

The above implies $f$ is necessarily permutation invariant, which we haven’t discussed explicitly yet – we elaborate on this later.

As a sequence of Robin Hood transfers from $\boldsymbol{x}$ to $\boldsymbol{y}$ implies $\boldsymbol{x}\succ\boldsymbol{y}$ and vice versa, the above strict definition of Schur convexity corresponds to our Property 3, i.e. confidence decreases after a Robin Hood transfer. The non-strict version permits confidence to stay the same under a Robin Hood transfer, but not increase. An example of a non-strict Schur-convex score would be the maximum of the softmax $C=\max_k \pi_k$ (MSP), where transfers between non-max outcomes do not change the score.

The following widget visualises how sequences of Robin Hood transfers relate to majorisation and Schur complexity.

Visualisation of schur convexity like before, however, also showing comparison of cumulative sums (CDFs) that demonstrate majorisation.

In this blogpost, we chose to start with Robin Hood transfers conceptually as they more intuitively connect with confidence score behaviour compared to the formal definitions of majorisation and Schur convexity. In the remainder of the blog we will refer to Property 3 as Schur convexity; however, we want to emphasise the underlying intuition – Robin Hood transfers that increase inequality also decrease confidence/increase uncertainty.In fact, the Schur–Ostrowski criterion for Schur convexity tests precisely this for infinitesimal transfers .

Finally, we note that strict vs non-strict Schur convexity impacts the uniqueness of the maximum and minimum values from Properties 1 and 2 :

Property strictly Schur-convex Schur-convex
3: (sequence of) Robin Hood transfer(s) decreases score Cannot increase score
1: one-hot distribution(s) unique global maximiser(s) global maximiser(s), unique or non-unique
2: uniform distribution unique global minimiser global minimiser, unique or non-unique
A Few Mathematical Details

The Robin Hood explanation gives the main idea. The following details connect it to the formal definitions.

  • Why permutation invariance follows. Explain that a vector and any permutation of it majorise each other, so Schur convexity forces their confidence scores to agree. This also holds for strictly Schur-convex scores: strictness concerns genuine equalisation, not relabelling. Connect this to the later discussion of scores that depend on class identity.

  • Where continuity enters the transfer explanation. Our transfers allow rank reversal but exclude a complete swap, which would occur at $\delta=\pi_i-\pi_j$. Explain that a transfer can approach that swap arbitrarily closely. For continuous $C$, taking this limit gives a non-increase inequality between the original and swapped vectors; applying the argument in reverse forces equality. This supplies the symmetry used in the endpoint argument. Continuity is a convenient assumption for this bridge, not part of the definition of Schur convexity.

  • What “reachable by Robin Hood transfers” means. State the precise connection: $\boldsymbol{x}\succ\boldsymbol{y}$ means that $\boldsymbol{y}$ can be obtained by finitely many equalising transfers, possibly followed by a permutation . Explain why the final relabelling does not affect confidence once permutation invariance is established.

  • How to interpret the endpoints. Distinguish softmax outputs with positive probabilities from the closed simplex, which also includes zeros. For a finite, continuous score on the closed simplex, the endpoint comparisons apply directly; for strict Schur convexity on that domain, all $K$ one-hot vectors share the maximum and the uniform vector is the unique minimum. Explain separately how limiting values are used for scores such as Self-Certainty, which diverges whenever a probability approaches zero. Its strict classification applies on the positive-probability domain; one-hot vectors are not the only boundary points with divergent values.

  • Optional: checking the intuition with derivatives. Retain the criterion below only if a local mathematical test adds value. If kept, show that it measures the change along a transfer from a larger probability to a smaller one. A short example using $C(\boldsymbol{\pi})=\sum_k\pi_k^2$ would make the connection concrete. MSP and GradNorm need not be differentiable everywhere to be Schur convex.

Wait, They Were Schur-Convex All Along?

A meme

Next, we’ll discuss how many existing confidence scores used in the literature are in fact Schur convex, and so have the desirable properties discussed in this blogpost. The following table lists a number of examples:

Name \(C(\boldsymbol{\pi})\) Schur-convexity
Maximum Softmax Probability (MSP) \(\displaystyle \max_k \pi_k\) Non-strict
Negative Gini ,Interestingly, this score dates back to the same work that laid the foundations for the Gini coefficient, which is widely used to quantify income inequality – a more direct link to our Robin Hood analogy. In fact, there exists an economics analogue to Schur convexity, the Pigou–Dalton transfer principle, which says that a measure of inequality should decrease if wealth is transferred from a richer individual to a poorer one. DOCTOR \(\displaystyle \sum\nolimits_k \pi_k^2 - 1\) Strict
Negative Shannon Entropy \(\displaystyle \sum\nolimits_k \pi_k \log \pi_k\) Strict
Negative Rényi Entropy \(\displaystyle \frac{1}{\alpha-1} \log \sum\nolimits_k \pi_k^\alpha\) Strict
Self-Certainty \(\displaystyle -\frac{1}{K}\sum\nolimits_k \log(K\pi_k)\) Strict
Negative Generalised Entropy (GEN) \(\displaystyle -\sum\nolimits_k [\pi_k(1-\pi_k)]^\gamma\) Strict
GradNorm (softmax component) \(\displaystyle \sum\nolimits_k \left|\pi_k-\tfrac{1}{K}\right|\) Non-strict

Some of these are established and widespread confidence scores in the literature, e.g. MSP, Shannon Entropy, whilst others are recently proposed and widely cited, e.g. GradNorm, Self-Certainty.

What’s interesting is that not a single paper explicitly discusses Schur convexity. It seems like Schur-convexity has been organically selected for by researchers, without them necessarily understanding that it fundamentally determines some important properties of the scores that they propose.

Many confidence scores inherit Schur convexity via the following result: any (monotone transform of a) permutation-invariant convex function is Schur-convex . A straightforward example is a confidence score of the form,

$$ C(\boldsymbol{\pi})=h\left(\sum_k f(\pi_k) \right) \tag{9}\label{eq:convex-sum} $$

where $f$ is convex and $h$ is non-decreasing monotone – you can see that all the listed scores in the above table follow this form.

The established theoretical and practical frameworks that researchers derive confidence scores from often contain the properties of permutation invariance and convexity, naturally giving rise to Schur convexity. Classes/outcomes are often treated symmetrically as a practical default giving scores permutation invariance – this means scores don’t require class-specific knowledge, improving portability across tasks and ease of deployment.It’s often easiest to assume permutation invariance, especially when there are many classes e.g. LLM vocabularies. You just need to deploy a fixed function, rather than one that may need parameters to be set for each different class, where said parameters may vary depending on the specific task and data distribution. Convexity arises in Bayesian decision theory and Proper Scoring Rules Both MSP and the negative generalised entropies associated with proper scoring rules arise from maximising an expected utility under distribution \(\boldsymbol{\pi}\). Since the expected utility of a given decision is a linear function of the outcome probabilities, its maximum over all possible decisions is convex in \(\boldsymbol{\pi}\). through which many of the above scores can be characterised.We won’t dwell on proper scoring rules here, however, it may interest the reader that many confidence scores in the literature can be cast as negative generalised entropies within this theoretical framework . Most familiar entropies from information theory, where researchers often derive confidence scores, are of the form in Equation \ref{eq:convex-sum} .

Researchers also like to explicitly construct scores as divergences from the uniform distribution (e.g. Gradnorm , GEN and Self-Certainty ), seeking to minimise confidence at the uniform and maximise it at one-hot distributions (Properties 1 and 2). Interestingly, the three listed examples all end up satisfying the notion of Schur convexity as well.

We Still Need Empirical Comparison

Although Schur convexity gives a confidence score a number of desirable properties, it only constrains ranking behaviour between softmax distributions that majorise each other – for other confidence comparisons it is completely permissive. This is illustrated in the following widget, where we use a score parameterised by power $\alpha$ to demonstrate how ranking behaviour can vary whilst Schur convexity is maintained.Incidentally, we remark that this power score is able to encompass the ranking behaviour of a large range of existing confidence scores, as indicated on the widget. It is a monotone transform of Rényi Entropy with different limiting behaviour at discontinuities. Cycling through the modes, note that as $\alpha$ varies:

  1. The confidence rankings of different $\boldsymbol{\pi}$ vary wildly, shown by changing confidence isocontours.

  2. The relative ranking of $\boldsymbol{\pi}$ that majorise each other stays fixed due to Schur convexity.

  3. The relative ranking of $\boldsymbol{\pi}$ that do not majorise each other can change freely.

Widget that visualises the contours of a score over the simplex. Shows how behaviour can vary considerably even with Schur convexity.

In selective prediction, we are often interested in discriminating between two data populations (on the simplex), e.g. correct predictions and misclassifications. How well a score performs at this depends on both the global ranking behaviour (isocontours in the above widget) and the distribution of these populations on the simplex. Thus, for developing effective confidence scores for selective prediction, Schur convexity is not sufficient – it simply provides some desirable properties. We still need experimental evaluation to determine which score has the best ranking behaviour for a given task.

We illustrate this with another widget, with the scores compared remaining Schur convex:

Widget that shows how AUROC varies for two different 2-class distributions on the simplex as alpha changes.
Key Takeaway

Although Schur convexity gives a confidence score desirable properties, it is permissive of varying global ranking behaviour. To determine ranking performance, we still need empirical evaluations on task-specific distributions over softmax outputs.

Additional Thoughts

Sequences of Probabilities

In the age of large language models, uncertainty scores over sequences of softmax outputs are becoming increasingly pertinent. It turns out we can also define a sequence-wise notion of Schur convexity, based on row-wise majorisation :

Sequence Schur Convexity

For two sequences of probability vectors of length $T$, $\boldsymbol{\Pi}=(\boldsymbol{\pi}^{(1)},\ldots,\boldsymbol{\pi}^{(T)})$ and $\boldsymbol{Q}=(\boldsymbol{q}^{(1)},\ldots,\boldsymbol{q}^{(T)})$, a sequence confidence score $C_{\mathrm{seq}}$ is sequence Schur convex if

$$ C_{\mathrm{seq}}(\mathcal{P}) \geq C_{\mathrm{seq}}(\mathcal{Q}) \text{ when } \boldsymbol{\pi}^{(t)} \succ \boldsymbol{q}^{(t)} \text{ for all } t=1,\dots,T, \tag{10} $$

i.e. $\boldsymbol{\Pi}$ majorises $\boldsymbol{Q}$ at all sequence positions. Intuitively, a set of (sequences of) Robin Hood transfer(s) across any positions in the sequence should reduce confidence.

One can straightforwardly construct a sequence Schur convex score by aggregating a position-wise score over a sequence,

$$ C_{\mathrm{seq}}(\mathcal{P}) = A\left(C(\boldsymbol{\pi}^{(1)}),\ldots, C(\boldsymbol{\pi}^{(T)})\right), \tag{11} $$

as long as the aggregation function $A$ is monotonically non-decreasing in each of its arguments, e.g. sum, mean, max, product (if $C\geq 0$). Indeed many existing sequence confidence scores proposed in the literature achieve sequence Schur convexity by doing this, such as negative mean token entropy , mean Rényi entropy , and self-certainty (without mentioning Schur convexity).

Not All Confidence Scores Are Schur Convex

Confidence score designers are free to forgo Schur convexity as a property, i.e. Robin Hood transfers mustn’t increase confidence, and there are some examples of this in the literature. Generative perplexity evaluates on the generated tokens, so a Robin Hood transfer into a generated token’s probability can increase confidence even if the softmax becomes more equal. The margin between the top 2 probabilities in $\boldsymbol{\pi}$ , keeps the maximum and minimum at one hot and uniform, however, a Robin Hood transfer out of the 2nd largest probability will increase confidence. Scores that treat specific classes/outcomes differently are inherently not permutation invariant, and so are not Schur convex. Ultimately, ranking performance is the downstream goal – Schur convexity provides desirable properties, but they are not essential or necessarily optimal.

Concluding Remarks

Enjoy Reading This Article?

Here are some more articles you might like to read next: