In deterministic, realizable online prediction, the optimal mistake bound is exactly the Littlestone dimension. This note defines and proves this characterization, then compares it with VC dimension: real thresholds, intervals, and affine halfspaces all have finite VC dimension but no finite mistake bound.
Let X=∅ be an input space and ∅=H⊆{0,1}X a class of binary-valued functions. Write N0:={0,1,2,…}.
A deterministic online learner is a sequence of maps A=(At)t≥1, where
At:(X×{0,1})t−1×X⟶{0,1}.
At round t, the learner observes xt, predicts yt=At(z<t,xt), and then receives the label yt; here z<t:=((xs,ys))s<t records the preceding inputs and labels.
Definition 1 (Realizability).
A sequence z1:T:=((xt,yt))t=1T is H-realizable if there exists h⋆∈H such that
yt=h⋆(xt),t=1,…,T.
Let ST(H) denote the set of these sequences.
Define the number of mistakes and its worst-case bound by
where the infimum ranges over all deterministic online learners, with no computational restrictions; both t and T range over the positive integers.
The question is when M⋆(H)<∞: can a constant independent of the horizon T bound the number of mistakes on every H-realizable sequence? The trivial bound MT≤T does not meet this requirement.
A complete binary tree of depth d∈N0, with internal nodes taking values in X, can be represented as
x=(xt)t=1d,xt:{0,1}t−1⟶X.
Each internal node specifies an input, and each edge a label. The node reached by following the labels y<t:=(y1,…,yt−1) carries the input xt(y<t); y<1 is the empty sequence.
Definition 2 (Littlestone dimension).
The class H shatters x if, for every y∈{0,1}d, the path
((xt(y<t),yt))t=1d
is H-realizable (Definition 1). Define
Ldim(H):=sup{d∈N0:H shatters some tree of depth d}.
Every nonempty class shatters the depth-zero tree; we also set Ldim(∅):=−1.
Fix a deterministic learner A and a tree of depth d≥1 shattered by H. For t=1,…,d, set
xt:=xt(y<t),yt:=At(z<t,xt),yt:=1−yt.
By Definition 2,
∃h∈H,∀t≤d,h(xt)=h(xt(y<t))=yt.
Thus z1:d∈Sd(H) and MA(H)≥Md(A;z1:d)=d. Taking the infimum over A and then the supremum over the depths of trees shattered by H gives M⋆(H)≥Ldim(H). When Ldim(H)=0, the bound follows from nonnegativity.
Fix any H-realizable sequence and suppose D:=Ldim(H)<∞. At round t, retain the functions consistent with the observed labels to form the version space Vt. Partition it into two subclasses according to their values at xt:
VtVt(b):={h∈H:h(xs)=ys for all s<t},:={h∈Vt:h(xt)=b},b∈{0,1}.
After observing yt, set Vt+1=Vt(yt).
Let k:=Ldim(Vt). Both subclasses have dimension at most k, and
b∈{0,1}minLdim(Vt(b))≤k−1.
Otherwise, each subclass would shatter a tree of depth k. Attaching these two trees below a root xt would yield a tree of depth k+1 shattered by Vt, contradicting the definition of k.
The Standard Optimal Algorithm (SOA) predicts
yt∈b∈{0,1}argmaxLdim(Vt(b)),
with ties always broken in favor of 0.
Remark (Computability).
The dimensions of the two subclasses are well-defined, so fixing the tie-breaking rule makes SOA a prediction map. Defining this map does not compute it: no method for computing these two dimensions is given here, nor is a computable implementation of SOA guaranteed [2].
If the prediction is wrong, the retained branch is the other one, whose dimension is the smaller of the two:
Ldim(Vt+1)=b∈{0,1}minLdim(Vt(b))≤Ldim(Vt)−1.
If the prediction is correct, Vt+1⊆Vt ensures that the dimension does not increase. Each mistake lowers the dimension by at least one, while realizability ensures VT+1=∅, so its dimension cannot fall below zero. Since V1=H, the total number of mistakes satisfies
MT(SOA;z1:T)≤D−Ldim(VT+1)≤D.
Thus M⋆(H)≤D, which, together with the lower bound, proves the result. When Ldim(H)=∞, the lower bound alone proves the result.□
The VC dimension (Vapnik–Chervonenkis dimension) is
VCdim(H):=sup{∣F∣:F⊆X finite,H shatters F}.
Every nonempty class shatters the empty set. Both VCdim(H) and Ldim(H) take values in N0∪{∞}.
Proposition 1 (Comparison of dimensions).
VCdim(H)≤Ldim(H),Ldim(H)≤⌊log2∣H∣⌋(H finite).
Proof.
If H shatters {u1,…,ud}, it also shatters the tree xt(y<t)=ut, giving the first inequality.
A function realizes at most one path in a fixed tree. Shattering a tree of depth d therefore requires at least 2d functions, giving the second inequality. □
In VC shattering, the inputs are fixed in advance; in a tree, they may depend on the preceding labels.
Let hθ(x):=1{x≤θ}, with x,θ∈R. This class shatters a single point but cannot assign labels (0,1) to two increasing inputs, so its VC dimension is 1. To determine its Ldim, it suffices to restrict the parameter to (0,1). Given a feasible parameter interval (a,b), query its midpoint x=(a+b)/2 and retain
y=0⟹retain (a,x),y=1⟹retain (x,b).
Either label leaves a nonempty open interval. For every finite depth, this constructs a tree shattered by the class. Hence [3, §21.1.1]
Intervals and affine halfspaces also have finite VC dimension and infinite Ldim. Both reproduce the threshold construction above.
Intervals. On the input space R, define
Hint:={x↦1{a≤x≤b}:a,b∈R,a≤b}.
This class shatters any two distinct points but cannot realize the labels (1,0,1) on three increasing points. This determines its VC dimension; the Ldim claim is proved below:
VCdim(Hint)=2,Ldim(Hint)=∞.
Affine halfspaces. For an integer p≥1, take the input space Rp and define
Hhs(p):={x↦1{w⊤x+b≥0}:w∈Rp,b∈R}.
The classical VC dimension result [3, §9.1.3] and the construction below give
VCdim(Hhs(p))=p+1,Ldim(Hhs(p))=∞.
No margin condition is imposed here; a finite parameter dimension does not guarantee a finite mistake bound.
Proof of the Ldim claims. Let t,θ∈(0,1).
For the interval [0,θ], the label of input t is 1{t≤θ}.
For the halfspace x1≤θ, query only points (t,0,…,0) on the first coordinate axis. The label is again 1{t≤θ}.
In both cases, the threshold bisection tree from the preceding section applies directly, so both classes have infinite Ldim.