---
title: Shtarkov Solution in Minimax Prediction
url: https://www.emergentmind.com/topics/shtarkov-solution
type: topic
---

# Shtarkov Solution in Minimax Prediction

Searching arXiv for recent papers on the Shtarkov solution and related minimax log-loss regret.
arXiv search query: "Shtarkov solution normalized maximum likelihood minimax regret sequential probability assignment"
The Shtarkov solution is the exact minimax solution to sequential probability assignment under logarithmic loss in the context-free setting. For a class of sequence distributions $Q\subset\Delta(Y^n)$, it is the Normalized Maximum Likelihood (NML) distribution
$$
p^*(y)=\frac{\sup_{q\in Q} q(y)}{S_n(Q)},
\qquad
S_n(Q)\coloneqq \sum_{y\in Y^n}\sup_{q\in Q} q(y),
$$
and the corresponding minimax regret is exactly $\log S_n(Q)$ [2503.17823]. In parametric notation, the same construction is written
$$
q_{\rm NML}(y)=\frac{p(y\mid \hat\theta(y))}{C_n},
\qquad
\hat\theta(y)=\arg\max_\theta p(y\mid\theta),
$$
with $C_n$ the Shtarkov sum [2507.21308]. The construction occupies a central position in online log-loss prediction, universal coding, and MDL, and recent work extends it from the classical context-free setting to adversarial contextual forecasting and to entropy-based characterizations of minimax regret.

## 1. Classical minimax characterization

In the non-contextual formulation, one fixes a finite alphabet $Y$ and considers sequences $y=(y_1,\dots,y_n)\in Y^n$. A forecaster chooses $p\in\Delta(Y^n)$ and incurs log-loss $-\log p(y)$. The worst-case regret against a reference class $Q\subset\Delta(Y^n)$ is
$$
R_n(Q)=\inf_p\sup_{y\in Y^n}\sup_{q\in Q}\log \frac{q(y)}{p(y)}.
$$
Shtarkov’s theorem shows that this optimization has a closed form:
$$
R_n(Q)=\log S_n(Q),
\qquad
S_n(Q)=\sum_{y\in Y^n}\sup_{q\in Q}q(y),
$$
and the minimizing distribution is the NML predictor $p^*$ defined by normalizing $\sup_{q\in Q}q(y)$ over all sequences [2503.17823].

An equivalent parametric presentation starts from a family of joint distributions $\{p_\theta:\theta\in\Theta\}$ over sequences $y^n\in\mathcal Y^n$. The sequence-wise regret of a predictor $\hat p(\cdot)$ is
$$
R(y^n,\hat p)=-\log \hat p(y^n)-\min_{\theta\in\Theta}(-\log p_\theta(y^n)),
$$
and the minimax value is
$$
R_n^*=\min_{\hat p}\max_{y^n} R(y^n,\hat p).
$$
In this notation, Shtarkov’s theorem gives
$$
S_n=\sum_{y^n\in\mathcal Y^n}\max_{\theta\in\Theta}p_\theta(y^n),
\qquad
p_{\rm NML}(y^n)=\frac{\max_{\theta\in\Theta}p_\theta(y^n)}{S_n},
$$
with $R_n^*=\log S_n$ [2410.03849].

The significance of the theorem is that it converts a worst-case sequential decision problem into the normalization of a pointwise maximum likelihood. The Shtarkov sum is therefore both a coding-theoretic normalizer and the exact minimax individual-sequence log-loss regret.

## 2. Normalized maximum likelihood and the equalized-regret property

For log-loss, the NML construction has a distinctive equalization property. In the generalized form studied in learning theory, the strategy
$$
r^*(z^n)=\frac{\sup_{f\in F}q_f(z^n)}{\int \sup_{f\in F}q_f(u^n)\,d\nu(u^n)}
$$
equalizes the regret over all $z^n$, and its constant value is the logarithm of the corresponding Shtarkov integral [1710.07732]. In the ordinary log-loss specialization with $\eta=1$ and $q_f(z)=f(z)$, this recovers the classical NML density.

The same point is expressed in coding-length language in the parametric streaming formulation. Under the logarithmic score, a forecaster using density $q$ pays a code-length of $-\ln q(y)$ nats, whereas the best expert at $y$ pays $-\ln p(y\mid\hat\theta(y))$. The NML predictor achieves the minimax worst-case excess code-length
$$
R_{\max}(q_{\rm NML})=\ln C_n,
$$
and no other $q$ can guarantee smaller maximum regret [2507.21308].

This characterization is compatible with sequential one-step-ahead prediction. If
$$
q_{\rm NML}^{(n)}(y^{(n)})=
\frac{p(y^{(n)}\mid\hat\theta(y^{(n)}))}{C_n},
$$
then the one-step-ahead density is
$$
q_{\rm NML}(y_{n+1}\mid y^{(n)})=
\frac{q_{\rm NML}^{(n+1)}(y^{(n)},y_{n+1})}{q_{\rm NML}^{(n)}(y^{(n)})}.
$$
In streaming prediction, the minimax guarantee holds at each $n$ [2507.21308].

A common misunderstanding is that any low-regret expert-advice method is equivalent to the Shtarkov solution. The available results distinguish the notions sharply: exponential-weights forecasters can bound regret in expectation or with high probability under worst-case sequences, but they do not in general achieve the absolute minimax code-length [2507.21308].

## 3. Contextual and adversarial sequential extensions

Recent work extends the Shtarkov construction to the fully contextual online setting. Here, at each round $t=1,\dots,n$, the learner observes a context $x_t\in\mathcal X$ that may depend adversarially on past labels $y^{t-1}$. Equivalently, one fixes a $\mathcal Y$-ary context tree
$$
\mathcal X=\{x_1(\cdot),x_2(\cdot),\dots,x_n(\cdot)\},
$$
where each $x_t:\mathcal Y^{t-1}\to\mathcal X$. An expert $f\in\mathcal F$ is a sequence of conditional probability mappings
$$
f_t(\cdot\mid\cdot):\mathcal Y\times\mathcal X\to[0,1],
$$
with joint likelihood
$$
L(f;x^n,y^n)=\prod_{t=1}^n f_t(y_t\mid x_t).
$$
The contextual Shtarkov sum for a fixed context tree is then
$$
S_n^{\rm ctx}(\mathcal X;\mathcal F)=\sum_{y^n\in\mathcal Y^n}\max_{f\in\mathcal F}\prod_{t=1}^n f_t(y_t\mid x_t).
$$
The minimax regret against $\mathcal F$ and adaptive contexts is
$$
R_n^*(\mathcal F)=\sup_{\mathcal X}\log S_n^{\rm ctx}(\mathcal X;\mathcal F)
$$
[2410.03849].

The corresponding minimax-optimal strategy is contextual Normalized Maximum Likelihood (cNML). At time $t$, after past labels $y^{t-1}$ and context $x_t=x_t(y^{t-1})$, it predicts
$$
\hat p_{\rm cNML}(y_t\mid y^{t-1})
=
\frac{\max_{f\in\mathcal F}\prod_{s=1}^t f_s(y_s\mid x_s)}
{\sum_{a\in\mathcal Y}\max_{f\in\mathcal F}\bigl[\prod_{s=1}^{t-1}f_s(y_s\mid x_s)\bigr]f_t(a\mid x_t)}.
$$
These fractions form a valid probability mass function over $y_t\in\mathcal Y$, and by construction the strategy achieves the value $\sup_{\mathcal X}\log S_n^{\rm ctx}$ [2410.03849].

The contextual extension is technically significant because the usual sequential $\ell_\infty$ entropy does not characterize minimax risk in general, whereas the contextual Shtarkov sum does. The framework also applies to general finite label alphabets, not only binary labels, and allows expert classes of mappings from $(\text{context},\text{history})\to\Delta(\mathcal Y)$, including nonparametric and combinatorial classes [2410.03849].

## 4. Sequential square-root entropy and geometric upper bounds

A major recent development is the control of the Shtarkov sum by a geometric complexity defined through Hellinger-type sequential covers. For $Q\subset\Delta(Y^n)$, a finite set $V\subset\Delta(Y^n)$ is an $\ell_\infty$ sequential square-root $\epsilon$-cover if for every $q\in Q$ and every history $w\in Y^{t-1}$ one can choose $v\in V$ such that, at each time $t$ and symbol $y\in Y$,
$$
\bigl|\sqrt{q_t(y\mid w)}-\sqrt{v_t(y\mid w)}\bigr|\le \epsilon.
$$
The smallest cover size is denoted $N(Q,\epsilon,n)$, and
$$
H(Q,\epsilon,n)=\log N(Q,\epsilon,n).
$$
At each time-step, this controls the Hellinger distance between the conditional laws $q_t(\cdot\mid w)$ and $v_t(\cdot\mid w)$ uniformly in the history $w$ [2503.17823].

Jia, Polyanskiy, and Rakhlin prove that this entropy yields a general upper bound for the non-contextual minimax regret. For any class $Q\subset\Delta(Y^n)$ and alphabet size $|Y|\ge 2$, there are absolute constants $C,c$ such that for all $n\ge 7$,
$$
R_n(Q)=\log S_n(Q)
\le
C\!\left[
1+\inf_{0<\delta<\gamma<1}
\left\{
n\delta\sqrt{|Y|}
+\sqrt{n|Y|}\int_{\alpha=\delta}^{\gamma}\sqrt{H(Q,\alpha,n)}\,d\alpha
+
H(Q,\gamma,n)\cdot \log(n|Y|)
\right\}
\right].
$$
Up to $O(\log n)$ factors, this may be written as
$$
R_n(Q)=O\!\left(
n\delta\sqrt{|Y|}
+\sqrt{n|Y|}\int_\delta^\gamma \sqrt{H(Q,\alpha,n)}\,d\alpha
+H(Q,\gamma,n)
\right)
$$
[2503.17823].

The proof route is itself structurally important. It passes through a dual form of regret, a truncation step that clips conditionals into $[\delta,1-\delta]$ at cost $O(n\delta)$, a log-to-Hellinger transform using a function $\zeta(x)$ with $\log x\le \zeta(x)-c\zeta(x)^2$, sequential symmetrization with Rademacher signs and a ghost-sample construction, and finally chaining over a sequence of covers. The resulting Dudley-type integral shows that the exact Shtarkov/NML redundancy admits a geometric upper bound even without side information [2503.17823].

## 5. Tightness regimes and Donsker-type behavior

The square-root entropy bounds are nearly tight in a broad class of regimes. If
$$
H(Q,\alpha,n)=\Theta(\alpha^{-p})
\qquad\text{for }\alpha\in(0,1),
$$
then choosing $\delta\approx n^{-1/(p+2)}$ and $\gamma\approx 1$ yields
$$
R_n(Q)=
\begin{cases}
\Theta(n^{p/(p+2)}) & \text{if } 0<p\le 2,\\[4pt]
\Theta(n^{(p-1)/p}) & \text{if } p>2.
\end{cases}
$$
For classes with $p\le 2$, described as the classical Donsker regime, the lower bounds match the upper bounds up to logarithmic factors [2503.17823].

Two examples illustrate the regime distinction. A Hilbert-ball infinite-dimensional linear class has
$$
H(Q,\alpha,n)=O(\log n/\alpha^2),
$$
so $p=2$ and therefore $R_n=O(\sqrt n)$. A one-dimensional Lipschitz class has $p=1$, so again $R_n=O(\sqrt n)$ [2503.17823].

These results matter because they connect an exact minimax quantity, $\log S_n(Q)$, to scale-sensitive entropy. A plausible implication is that the Shtarkov solution is not merely an extremal coding construction; it also indexes the rate structure of nonparametric sequential prediction. In the cited work, the approach extends to contextual forecasting and is presented as resolving a long-standing open problem in online log-loss prediction and universal coding [2503.17823].

## 6. Existence, asymptotics, and computation

The Shtarkov solution is exact only when the normalizer exists. In the parametric presentation, the normalizer is
$$
C_n=\int_{\mathcal Y^n} p\bigl(y^{(n)}\mid \hat\theta(y^{(n)})\bigr)\,dy^{(n)}.
$$
Finite-sample existence is guaranteed under mild regularity conditions. In the compact-support case, if $\Theta$ is bounded and convex, the joint density in $\theta$ is continuous and strictly convex for large $n$, the outcomes have common bounded support, and suitable continuity and prior conditions hold, then $0<C_n<\infty$, so the frequentist NML and Bayesian NML exist [2507.21308].

A separate asymptotic regularity theorem assumes uniform boundedness and convergence of Fisher information matrices, uniform local asymptotic normality around the maximizer, and continuity and equicontinuity conditions for second derivatives; under these assumptions, again $0<C_n<\infty$ for each $n$ [2507.21308]. Under conditions ensuring uniform convergence of the MLE and Fisher-information regularity,
$$
\ln C_n=\frac d2 \ln n + O(1),
$$
where $d=\dim\Theta$, so $C_n\approx n^{d/2}\times \exp(O(1))$. Clarke and Chanda cite Barron–Rissanen–Yu and S. Watanabe for asymptotic $\frac d2\ln n$ expansions [2507.21308].

Computationally, the normalizer can be available in closed or semi-closed form in some families and require approximation in others. The paper reports that, for the one-parameter exponential family, $C_n$ diverges and NML fails. For larger models, the listed approaches are asymptotic approximation via $\ln C_n\approx \tfrac d2\ln n+O(1)$, Monte Carlo with simulated maximization and importance-sampling or MCMC for the integral, and Bayesian mixture fallback
$$
\mathrm{NML}\approx \int p(y\mid\theta)\,w(\theta)\,d\theta
$$
[2507.21308].

In streaming applications, only the ratio $C_n/C_{n+1}$ is needed for one-step-ahead prediction, and this ratio can be approximated via Laplace’s method in smooth problems [2507.21308]. The same source works through classical examples including normal mean, normal variance, binomial, and Gamma/Inv-Gamma models, showing that existence and tractability depend strongly on model structure rather than on the minimax principle alone.

## 7. Relation to MDL, PAC-Bayesian theory, and broader predictive methodology

The Shtarkov solution also appears as a special case of a broader learning-theoretic complexity developed in the PAC-Bayesian-Rademacher-Shtarkov-MDL framework. For entropified densities
$$
q_f(z)=\frac{p(z)\exp(-\eta R_f(z))}{C(f)},
$$
the Shtarkov integral for a deterministic estimator $\hat f$ is
$$
S(F;\hat f)=\int q_{\hat f(z^n)}(z^n)\,d\nu(z^n),
$$
and the corresponding complexity is its logarithm scaled by $1/\eta$. In the log-loss special case with $\eta=1$ and a model containing $p$, one has $q_f(z)=f(z)$ and recovers the classical NML density [1710.07732].

Within this framework, the old Shtarkov/NML complexity is exactly the special case with luckiness weight $w\equiv 1$ and deterministic posterior. The cited results then connect minimax log-loss regret to excess-risk bounds: Theorem 3.1 gives an exact exponential-moment identity for the generalized complexity, and Corollary 3.2 specializes to deterministic ERM to bound expected excess risk in terms of the NML complexity under bounded-loss plus a central/Bernstein condition [1710.07732].

The same paper places the Shtarkov code inside classical MDL. Two-part codelengths of the form
$$
-\ln\pi(k)-\ln p_{\hat f_k}(z^n)+\ln Z_{n,k}
$$
use the NML normalization $\ln Z_{n,k}$ for submodels $F_k$, and the resulting $\eta$-generalized MDL estimator attains the same excess-risk rates as ERM on the best submodel [1710.07732]. This identifies the Shtarkov solution not only as a predictor but also as a complexity term that mediates between MDL, PAC-Bayesian information complexity, and empirical-process quantities such as Rademacher complexity.

Two limitations follow directly from the cited literature. First, NML is not automatically available: existence can fail, as in the one-parameter exponential example, or can demand nontrivial approximation. Second, minimax optimality is not a guarantee of empirical dominance under misspecification or computational constraints. In a review of streaming observational prediction, Clarke and Chanda report that although Shtarkov is conceptually minimax-optimal, it can be outperformed in practice when models are misspecified or computing is constrained [2507.21308]. In that sense, the Shtarkov solution is best understood as an exact benchmark for worst-case log-loss regret, with extensions that now cover contextual forecasting and geometric regret analysis, rather than as a universal prescription independent of model class or computational regime.

Source: https://www.emergentmind.com/topics/shtarkov-solution