Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

Machine Learning

273 missions · 182 completed

The science of systems that learn from data and experience. Its scope runs from the statistical and mathematical foundations of learning, including generalization, expressivity, and computational limits, through the design of learning algorithms, deep learning, reinforcement learning, and probabilistic methods, to the empirical study of large models and the trustworthiness, interpretability, and societal impact of learned systems.

Missions

Open91Completed182All273
🏆Completed
Dynamic ProgrammingOperations ResearchProbability+1·Captain: mikedeng1

Approximately Optimal Approximate Reinforcement Learning I: Conservative Policy Iteration Improves Monotonically and Returns a Near-Greedy PolicyResearch Paper

Motivation

Approximate policy iteration and policy gradient methods are the two classical families of reinforcement learning algorithms that work with approximate, sampled information instead of an exact model. Kakade and Langford (ICML 2002) observed that neither family answers three basic questions: is there a performance measure that is guaranteed to improve at every step, how hard is it to verify that an update improves it, and what performance is reached after a reasonable number of updates. Greedy approximate policy iteration can make the policy worse when the value estimates are slightly wrong at a few states, and policy gradient methods can stall on plateaus where estimating the gradient needs an enormous number of samples.

Their answer is conservative policy iteration: instead of jumping to a greedy policy, move only a controlled fraction of the way toward it, with a step size chosen from an estimate of how much the greedy policy helps. The paper proves that this update improves a restart-distribution performance measure monotonically, terminates after a number of iterations that depends only on the reward range and the target accuracy, and stops at a policy that the greedy oracle can no longer improve by much. The idea is the direct ancestor of trust-region and proximal policy optimization methods (TRPO, Schulman et al. 2015; PPO, Schulman et al. 2017), whose improvement bounds are refinements of the paper's Theorem 4.1.

Setting

A finite Markov decision process has a finite nonempty set of states SSS, a finite nonempty set of actions AAA, transition probabilities P(s′;s,a)P(s';s,a)P(s′;s,a) (for each state sss and action aaa, a probability distribution over next states s′s's′), a reward function R:S×A→[0,R]\mathcal R : S\times A\to[0,R]R:S×A→[0,R] with R>0R>0R>0, and a discount factor 0≤γ<10\le\gamma<10≤γ<1. A stochastic policy π(a;s)\pi(a;s)π(a;s) gives, for each state sss, a probability distribution over actions.

The normalized value of π\piπ from sss is Vπ(s)=(1−γ)E[∑t≥0γtR(st,at)∣π,s]V_\pi(s) = (1-\gamma)E[\sum_{t\ge0}\gamma^t\mathcal R(s_t,a_t)\mid\pi,s]Vπ​(s)=(1−γ)E[∑t≥0​γtR(st​,at​)∣π,s], where s0=ss_0=ss0​=s, at∼π(⋅ ;st)a_t\sim\pi(\cdot\,;s_t)at​∼π(⋅;st​), st+1∼P(⋅ ;st,at)s_{t+1}\sim P(\cdot\,;s_t,a_t)st+1​∼P(⋅;st​,at​); it lies in [0,R][0,R][0,R]. The state-action value is Qπ(s,a)=(1−γ)R(s,a)+γEs′∼P(s′;s,a)[Vπ(s′)]Q_\pi(s,a) = (1-\gamma)\mathcal R(s,a)+\gamma E_{s'\sim P(s';s,a)}[V_\pi(s')]Qπ​(s,a)=(1−γ)R(s,a)+γEs′∼P(s′;s,a)​[Vπ​(s′)] and the advantage is Aπ(s,a)=Qπ(s,a)−Vπ(s)∈[−R,R]A_\pi(s,a) = Q_\pi(s,a)-V_\pi(s)\in[-R,R]Aπ​(s,a)=Qπ​(s,a)−Vπ​(s)∈[−R,R].

For a state distribution μ\muμ (a restart distribution), the discounted future state distribution is dπ,μ(s)=(1−γ)∑t≥0γtPr⁡(st=s;π,μ)d_{\pi,\mu}(s) = (1-\gamma)\sum_{t\ge0}\gamma^t\Pr(s_t=s;\pi,\mu)dπ,μ​(s)=(1−γ)∑t≥0​γtPr(st​=s;π,μ) (eq. (2.1)), and the performance measure is ημ(π)=Es∼μ[Vπ(s)]\eta_\mu(\pi) = E_{s\sim\mu}[V_\pi(s)]ημ​(π)=Es∼μ​[Vπ​(s)].

The policy advantage of a policy π′\pi'π′ with respect to π\piπ and μ\muμ is

Aπ,μ(π′)=Es∼dπ,μ[Ea∼π′(a;s)[Aπ(s,a)]],\mathbb A_{\pi,\mu}(\pi') = E_{s\sim d_{\pi,\mu}}\big[E_{a\sim\pi'(a;s)}[A_\pi(s,a)]\big],Aπ,μ​(π′)=Es∼dπ,μ​​[Ea∼π′(a;s)​[Aπ​(s,a)]],

and OPT(Aπ,μ)=max⁡π′Aπ,μ(π′)\mathrm{OPT}(\mathbb A_{\pi,\mu}) = \max_{\pi'}\mathbb A_{\pi,\mu}(\pi')OPT(Aπ,μ​)=maxπ′​Aπ,μ​(π′). The conservative update (4.1) is πnew=(1−α)π+απ′\pi_{new} = (1-\alpha)\pi+\alpha\pi'πnew​=(1−α)π+απ′ with α∈[0,1]\alpha\in[0,1]α∈[0,1]. An ε\varepsilonε-greedy policy chooser GεG_\varepsilonGε​ (Definition 4.3) returns, for every policy π\piπ, a policy π′\pi'π′ with Aπ,μ(π′)≥OPT(Aπ,μ)−ε\mathbb A_{\pi,\mu}(\pi')\ge\mathrm{OPT}(\mathbb A_{\pi,\mu})-\varepsilonAπ,μ​(π′)≥OPT(Aπ,μ​)−ε.

Conservative policy iteration (§5) starts from any policy and repeats: call Gε(π,μ)G_\varepsilon(\pi,\mu)Gε​(π,μ) to get π′\pi'π′; form an ε3\frac\varepsilon33ε​-accurate estimate A^\hat{\mathbb A}A^ of Aπ,μ(π′)\mathbb A_{\pi,\mu}(\pi')Aπ,μ​(π′) from μ\muμ-restarts; if A^<2ε3\hat{\mathbb A}<\frac{2\varepsilon}3A^<32ε​, stop and return π\piπ; otherwise apply (4.1) with α=(1−γ)(A^−ε/3)4R\alpha = \frac{(1-\gamma)(\hat{\mathbb A}-\varepsilon/3)}{4R}α=4R(1−γ)(A^−ε/3)​ and repeat.

Formalization targets

Goal: Theorem 4.4 (p. 5)

With probability at least 1−δ1-\delta1−δ, conservative policy iteration (i) strictly improves ημ\eta_\muημ​ with every policy update, (ii) stops after at most 72R2/ε272R^2/\varepsilon^272R2/ε2 policy updates, and (iii) returns a policy π\piπ with

OPT(Aπ,μ)<2ε.\mathrm{OPT}(\mathbb A_{\pi,\mu}) < 2\varepsilon.OPT(Aπ,μ​)<2ε.

The estimation step is represented by its guarantee: each reached loop's estimate fails to be ε3\frac\varepsilon33ε​-accurate with probability at most δ/(N+1)\delta/(N+1)δ/(N+1), N=⌊72R2/ε2⌋N=\lfloor72R^2/\varepsilon^2\rfloorN=⌊72R2/ε2⌋.

Milestones

Lemma 6.1 (p. 6), the performance difference identity:

ημ(π~)−ημ(π)=11−γE(a,s)∼π~dπ~,μ[Aπ(s,a)].\eta_\mu(\tilde\pi)-\eta_\mu(\pi) = \frac1{1-\gamma}E_{(a,s)\sim\tilde\pi d_{\tilde\pi,\mu}}[A_\pi(s,a)].ημ​(π~)−ημ​(π)=1−γ1​E(a,s)∼π~dπ~,μ​​[Aπ​(s,a)].

Theorem 4.1 (p. 4), with ε=max⁡s∣Ea∼π′(a;s)[Aπ(s,a)]∣\varepsilon=\max_s|E_{a\sim\pi'(a;s)}[A_\pi(s,a)]|ε=maxs​∣Ea∼π′(a;s)​[Aπ​(s,a)]∣ and all α∈[0,1]\alpha\in[0,1]α∈[0,1]:

ημ(πnew)−ημ(π)≥α1−γ(A−2αγε1−γ(1−α)).\eta_\mu(\pi_{new})-\eta_\mu(\pi)\ge\frac{\alpha}{1-\gamma}\Big(\mathbb A-\frac{2\alpha\gamma\varepsilon}{1-\gamma(1-\alpha)}\Big).ημ​(πnew​)−ημ​(π)≥1−γα​(A−1−γ(1−α)2αγε​).

Corollary 4.2 (p. 5): if A≥0\mathbb A\ge0A≥0, the step size α=(1−γ)A4R\alpha=\frac{(1-\gamma)\mathbb A}{4R}α=4R(1−γ)A​ gives

ημ(πnew)−ημ(π)≥A28R.\eta_\mu(\pi_{new})-\eta_\mu(\pi)\ge\frac{\mathbb A^2}{8R}.ημ​(πnew​)−ημ​(π)≥8RA2​.

Significance

Theorem 4.4 is the first guarantee of its kind for approximate reinforcement learning: the number of iterations is bounded by 72R2/ε272R^2/\varepsilon^272R2/ε2, independent of the number of states and of the restart distribution, and every iteration provably helps. Lemma 6.1 is the standard performance difference lemma, used throughout the analysis of policy optimization, including natural policy gradient and trust-region methods; Theorem 4.1 is the prototype of the "surrogate objective minus a penalty" bound that TRPO refines.

These results are proved in the paper. As far as a search of the platform shows, none is formalized: the platform's finite-horizon performance difference lemma (Foster and Rakhlin's Lemma 13) is a different statement, for episodic problems with non-stationary policies. This mission produces machine-checked versions of the discounted performance difference identity, the conservative improvement bound with its exact constants, and the high-probability termination and quality guarantee of the algorithm, all on top of an explicit infinite-horizon model rather than an assumed Bellman equation.

Difficulty

The obvious argument for the improvement bound expands ημ(πnew)\eta_\mu(\pi_{new})ημ​(πnew​) to first order in α\alphaα; that only gives α1−γA+O(α2)\frac{\alpha}{1-\gamma}\mathbb A+O(\alpha^2)1−γα​A+O(α2) with an unspecified constant, which cannot fix a step size. The exact bound needs control of how far the state distribution of the mixed policy drifts from that of the old policy, uniformly in time, and the performance difference identity is only useful once the states are weighted by the new policy's distribution. On the formal side, VπV_\piVπ​ and dπ,μd_{\pi,\mu}dπ,μ​ are infinite discounted series, so summability, exchanges of sums and the identities ∑sdπ,μ(s)=1\sum_s d_{\pi,\mu}(s)=1∑s​dπ,μ​(s)=1 and ∑aπ(a;s)Aπ(s,a)=0\sum_a\pi(a;s)A_\pi(s,a)=0∑a​π(a;s)Aπ​(s,a)=0 must all be established from the definitions. For Theorem 4.4, the algorithm is a random process whose policies depend on all earlier estimates; the argument has to be made pathwise on the event that every reached loop is accurate, together with a union bound over the loops that can be reached.

Formalization scope

Policies are functions π : S → A → ℝ with π s a the paper's π(a;s)\pi(a;s)π(a;s), and P s a s' is P(s′;s,a)P(s';s,a)P(s′;s,a); both are constrained by the published predicates IsPolicy and IsTransitionKernel. VπV_\piVπ​ is (1−γ)(1-\gamma)(1−γ) times the published series PolicyValue, so values are normalized as in the paper. OPT\mathrm{OPT}OPT is a real supremum over all stochastic policies; the set is nonempty and bounded, and the maximum is attained. Every theorem carries the standing assumptions of §2: finite nonempty SSS and AAA, a transition kernel, rewards in [0,R][0,R][0,R] with R>0R>0R>0, 0≤γ<10\le\gamma<10≤γ<1, and a state distribution μ\muμ. In Corollary 4.2, RRR is any upper bound on the rewards rather than necessarily the attained maximum.

In Theorem 4.4 the run is formalized pathwise, driven by arbitrary real random estimates on a probability space; the conclusion bounds the probability of the failure event by δ\deltaδ. Two deviations from the printed statement are disclosed. First, (ii) is stated for policy updates: the proof bounds updates, and the algorithm calls GεG_\varepsilonGε​ once more than it updates, so "at most 72R2/ε272R^2/\varepsilon^272R2/ε2 calls" is off by one. Second, the per-loop failure budget is δ/(N+1)\delta/(N+1)δ/(N+1), which covers the N+1N+1N+1 loops that may be reached. The Hoeffding estimate (5.1) is not formalized: as printed it concerns the ε6\frac\varepsilon66ε​-biased target, and its role is taken by the accuracy hypothesis. The step size is clipped at 111, which never binds when the estimate is accurate. No trivializing reading is available: the accuracy hypothesis is satisfied by a perfect estimator and a 000-greedy chooser exists, so the theorem is not vacuous, and strict improvement at every update is required, not merely nonnegative change.

Pages are PDF pages; the paper has no printed page numbers.

A complete development needs summability and algebra of discounted occupation measures, the performance difference identity, and a union bound over the loops of a random process; the first two are reusable for any discounted policy-optimization result. Proofs of the milestones in any order are welcome.

Selected references

  • S. Kakade and J. Langford, Approximately Optimal Approximate Reinforcement Learning, Proceedings of the 19th International Conference on Machine Learning (ICML), 2002. https://dl.acm.org/doi/10.5555/645531.656005
  • J. Schulman, S. Levine, P. Moritz, M. Jordan, P. Abbeel, Trust Region Policy Optimization, ICML 2015. https://arxiv.org/abs/1502.05477
  • J. Schulman, F. Wolski, P. Dhariwal, A. Radford, O. Klimov, Proximal Policy Optimization Algorithms, 2017. https://arxiv.org/abs/1707.06347
  • D. J. Foster and A. Rakhlin, Foundations of Reinforcement Learning and Interactive Decision Making, 2023. https://arxiv.org/abs/2312.16730
13 thms2 active usersReviewed
🏆Completed
Bandit AlgorithmsOperations ResearchStatistics·Captain: mikedeng1

Optimal Best Arm Identification with Fixed Confidence II: Characterization of the Optimal Proportions of Arm DrawsResearch Paper

Motivation

In best arm identification with fixed confidence, a learner samples KKK unknown distributions ("arms") sequentially and must name the arm with the largest mean, with error probability at most a prescribed δ\deltaδ, using as few samples as possible. Garivier and Kaufmann (arXiv:1602.04589, COLT 2016) showed that every δ\deltaδ-PAC strategy needs, in expectation, at least T∗(μ) kl(δ,1−δ)T^*(\boldsymbol\mu)\,\mathrm{kl}(\delta,1-\delta)T∗(μ)kl(δ,1−δ) samples, where the characteristic time T∗(μ)T^*(\boldsymbol\mu)T∗(μ) is the value of a max–min optimization problem over the proportions of draws allocated to the arms. The maximizer of that problem, w∗(μ)w^*(\boldsymbol\mu)w∗(μ), is the allocation any asymptotically optimal strategy must follow; the Track-and-Stop algorithm of the same paper computes w∗(μ^)w^*(\hat{\boldsymbol\mu})w∗(μ^​) at plug-in estimates and tracks it.

A strategy can only track w∗w^*w∗ if w∗w^*w∗ can be computed. This mission formalizes the part of the paper (Section 2.2 and Appendix A) that turns the abstract max–min problem into an explicit recipe: a closed form for the inner infimum, and a characterization of w∗w^*w∗ through the root of one increasing scalar function. The problem had been solved in closed form before only for special cases, such as Poisson rewards with all suboptimal arms equal (Vaidhyan and Sundaresan, 2015); the paper's result covers every one-parameter exponential family.

Setting

A canonical one-parameter exponential family is a family of laws νθ\nu_\thetaνθ​, θ∈Θ\theta\in\Thetaθ∈Θ, on R\mathbb RR with density exp⁡(θx−b(θ))\exp(\theta x-b(\theta))exp(θx−b(θ)) with respect to a reference measure ξ\xiξ. The law νθ\nu_\thetaνθ​ has mean b˙(θ)\dot b(\theta)b˙(θ); the set of attainable means is the mean space b˙(Θ)\dot b(\Theta)b˙(Θ). For means μ=b˙(θ)\mu=\dot b(\theta)μ=b˙(θ) and μ′=b˙(θ′)\mu'=\dot b(\theta')μ′=b˙(θ′) the Kullback–Leibler divergence is

d(μ,μ′)=KL(νθ,νθ′)=b(θ′)−b(θ)−b˙(θ)(θ′−θ).d(\mu,\mu')=\mathrm{KL}(\nu_\theta,\nu_{\theta'})=b(\theta')-b(\theta)-\dot b(\theta)(\theta'-\theta).d(μ,μ′)=KL(νθ​,νθ′​)=b(θ′)−b(θ)−b˙(θ)(θ′−θ).

Bernoulli laws and Gaussian laws with known variance are the standard examples.

A bandit model is identified with its vector of means μ=(μ1,…,μK)∈b˙(Θ)K\boldsymbol\mu=(\mu_1,\dots,\mu_K)\in\dot b(\Theta)^Kμ=(μ1​,…,μK​)∈b˙(Θ)K. S\mathcal SS is the set of models with a unique optimal arm a∗(μ)a^*(\boldsymbol\mu)a∗(μ), and Alt(μ)={λ∈S:a∗(λ)≠a∗(μ)}\mathrm{Alt}(\boldsymbol\mu)=\{\boldsymbol\lambda\in\mathcal S:a^*(\boldsymbol\lambda)\ne a^*(\boldsymbol\mu)\}Alt(μ)={λ∈S:a∗(λ)=a∗(μ)} is the set of alternatives. ΣK\Sigma_KΣK​ is the probability simplex. The transportation cost of proportions w∈ΣKw\in\Sigma_Kw∈ΣK​ and the objects of the paper are

cμ(w)=inf⁡λ∈Alt(μ)∑a=1Kwa d(μa,λa),T∗(μ)−1=sup⁡w∈ΣKcμ(w),w∗(μ)=argmax⁡w∈ΣKcμ(w).c_{\boldsymbol\mu}(w)=\inf_{\boldsymbol\lambda\in\mathrm{Alt}(\boldsymbol\mu)}\sum_{a=1}^Kw_a\,d(\mu_a,\lambda_a),\qquad T^*(\boldsymbol\mu)^{-1}=\sup_{w\in\Sigma_K}c_{\boldsymbol\mu}(w),\qquad w^*(\boldsymbol\mu)=\operatorname*{argmax}_{w\in\Sigma_K}c_{\boldsymbol\mu}(w).cμ​(w)=λ∈Alt(μ)inf​a=1∑K​wa​d(μa​,λa​),T∗(μ)−1=w∈ΣK​sup​cμ​(w),w∗(μ)=w∈ΣK​argmax​cμ​(w).

The arms are sorted so that μ1>μ2≥⋯≥μK\mu_1>\mu_2\ge\dots\ge\mu_Kμ1​>μ2​≥⋯≥μK​. The parameterized Jensen–Shannon divergence is, for α∈[0,1]\alpha\in[0,1]α∈[0,1],

Iα(μ1,μ2)=α d(μ1,αμ1+(1−α)μ2)+(1−α) d(μ2,αμ1+(1−α)μ2).I_\alpha(\mu_1,\mu_2)=\alpha\,d\big(\mu_1,\alpha\mu_1+(1-\alpha)\mu_2\big)+(1-\alpha)\,d\big(\mu_2,\alpha\mu_1+(1-\alpha)\mu_2\big).Iα​(μ1​,μ2​)=αd(μ1​,αμ1​+(1−α)μ2​)+(1−α)d(μ2​,αμ1​+(1−α)μ2​).

For a∈{2,…,K}a\in\{2,\dots,K\}a∈{2,…,K} let ga(x)=(1+x)I1/(1+x)(μ1,μa)g_a(x)=(1+x)I_{1/(1+x)}(\mu_1,\mu_a)ga​(x)=(1+x)I1/(1+x)​(μ1​,μa​) for x≥0x\ge0x≥0, let xa=ga−1x_a=g_a^{-1}xa​=ga−1​, and let x1≡1x_1\equiv1x1​≡1. Finally

Fμ(y)=∑a=2Kd(μ1,ma(y))d(μa,ma(y)),ma(y)=μ1+xa(y)μa1+xa(y).F_{\boldsymbol\mu}(y)=\sum_{a=2}^K\frac{d\big(\mu_1,m_a(y)\big)}{d\big(\mu_a,m_a(y)\big)},\qquad m_a(y)=\frac{\mu_1+x_a(y)\mu_a}{1+x_a(y)}.Fμ​(y)=a=2∑K​d(μa​,ma​(y))d(μ1​,ma​(y))​,ma​(y)=1+xa​(y)μ1​+xa​(y)μa​​.

Formalization targets

Goal: Theorem 5 (p. 5)

With D=d(μ1,μ2)D=d(\mu_1,\mu_2)D=d(μ1​,μ2​): FμF_{\boldsymbol\mu}Fμ​ is continuous and strictly increasing on [0,D[[0,D[[0,D[, Fμ(0)=0F_{\boldsymbol\mu}(0)=0Fμ​(0)=0, Fμ(y)→∞F_{\boldsymbol\mu}(y)\to\inftyFμ​(y)→∞ as y→Dy\to Dy→D, the equation Fμ(y)=1F_{\boldsymbol\mu}(y)=1Fμ​(y)=1 has a unique solution y∗∈[0,D[y^*\in[0,D[y∗∈[0,D[, and

w∈w∗(μ)  ⟺  wa=xa(y∗)∑i=1Kxi(y∗)for every arm a.w\in w^*(\boldsymbol\mu)\iff w_a=\frac{x_a(y^*)}{\sum_{i=1}^Kx_i(y^*)}\quad\text{for every arm }a.w∈w∗(μ)⟺wa​=∑i=1K​xi​(y∗)xa​(y∗)​for every arm a.

The equivalence says at once that the argmax exists, that it is a single point, and that it is given by eq. (5).

Milestones

  1. Lemma 3 (p. 5): for every w∈ΣKw\in\Sigma_Kw∈ΣK​,
cμ(w)=min⁡a≠1(w1+wa) Iw1w1+wa(μ1,μa).c_{\boldsymbol\mu}(w)=\min_{a\ne1}(w_1+w_a)\,I_{\frac{w_1}{w_1+w_a}}(\mu_1,\mu_a).cμ​(w)=a=1min​(w1​+wa​)Iw1​+wa​w1​​​(μ1​,μa​).
  1. Claim after eq. (4) (p. 5): gag_aga​ is a strictly increasing one-to-one mapping from [0,+∞[[0,+\infty[[0,+∞[ onto [0,d(μ1,μa)[[0,d(\mu_1,\mu_a)[[0,d(μ1​,μa​)[.
  2. Lemma 4 (p. 5): for every maximizer w∗w^*w∗ and all a,b∈{2,…,K}a,b\in\{2,\dots,K\}a,b∈{2,…,K},
(w1∗+wa∗)Iw1∗w1∗+wa∗(μ1,μa)=(w1∗+wb∗)Iw1∗w1∗+wb∗(μ1,μb).(w^*_1+w^*_a)I_{\frac{w^*_1}{w^*_1+w^*_a}}(\mu_1,\mu_a)=(w^*_1+w^*_b)I_{\frac{w^*_1}{w^*_1+w^*_b}}(\mu_1,\mu_b).(w1∗​+wa∗​)Iw1∗​+wa∗​w1∗​​​(μ1​,μa​)=(w1∗​+wb∗​)Iw1∗​+wb∗​w1∗​​​(μ1​,μb​).

Significance

The result. Theorem 5 reduces a (K−1)(K-1)(K−1)-dimensional non-smooth max–min problem to finding the root of one continuous increasing function on a bounded interval, each evaluation of which requires K−1K-1K−1 scalar inversions. It gives existence and uniqueness of w∗(μ)w^*(\boldsymbol\mu)w∗(μ), which the paper's lower bound only presupposes, and it is the computational core of Track-and-Stop: without an explicit, well-posed w∗w^*w∗ the tracking strategy is not defined. Lemma 3 alone gives the closed form of the inner infimum used again in the analysis of the stopping rule.

Formalizing it. The results are proved in the paper; nothing here is open. To the best of our knowledge none of them has a machine-checked proof: the platform's existing best-arm-identification rows concern Gaussian arms and state the characteristic time at the level of measures, without this characterization. The mission produces a checked reduction for general one-parameter exponential families, including the edge cases the text passes over (ties among suboptimal arms, zero weights, the behaviour of xax_axa​ near the end of its domain).

Difficulty

The infimum in Lemma 3 ranges over Alt(μ)\mathrm{Alt}(\boldsymbol\mu)Alt(μ), a set of models with a unique best arm, so it is an open condition: the minimizing configuration, in which λ1\lambda_1λ1​ and λa\lambda_aλa​ coincide, lies outside Alt(μ)\mathrm{Alt}(\boldsymbol\mu)Alt(μ) and is only approached. Other arms may also compete for the best position. A statement in which the infimum is taken over the closed relaxation {λa≥λ1}\{\lambda_a\ge\lambda_1\}{λa​≥λ1​} is a lemma of the proof, not Lemma 3.

For Theorem 5, the equalization in Lemma 4 needs an argument that holds for every maximizer, not only for one found by a first-order condition, because the objective is a minimum of functions and is not differentiable. The monotonicity of FμF_{\boldsymbol\mu}Fμ​ needs the monotonicity of each xax_axa​ and of each ratio in the moving point mam_ama​, and the limit at DDD rests on the second-best arm(s) only, which is where the ordering μ1>μ2≥…\mu_1>\mu_2\ge\dotsμ1​>μ2​≥… enters. Finally the analytic facts about ddd (continuity, positivity off the diagonal, monotonicity in each argument) must be derived from the exponential family itself.

Formalization scope

Lean represents a model by μ : Fin K → ℝ with 2 ≤ K and every μ a in the mean space deriv F.b '' F.Θ. The paper's arm 111 is index 0, arm 222 is index 1. The exponential family is a structure ExpFamily whose parameter set is a nonempty open interval and whose b is twice continuously differentiable with b¨>0\ddot b>0b¨>0 on Θ\ThetaΘ. These two conditions are added to the paper's "convex, twice differentiable" and are disclosed: strict convexity is what makes the mean parameterization unique, and openness is what lets alternatives approach the boundary of Alt(μ)\mathrm{Alt}(\boldsymbol\mu)Alt(μ). The reference measure and normalization are part of the structure but unused here.

The transportation cost is an infimum in EReal, so it is the true infimum of the set of values rather than a default 0. w∗(μ)w^*(\boldsymbol\mu)w∗(μ) is never defined by choice: "www is optimal" is a predicate, and Theorem 5 characterizes the set of such www. The functions xax_axa​ are the inverse of gag_aga​ on [0,+∞[[0,+\infty[[0,+∞[ and are evaluated only on [0,d(μ1,μ2)[[0,d(\mu_1,\mu_2)[[0,d(μ1​,μ2​)[. "Increasing" in Theorem 5 is stated as strictly increasing, as proved in Appendix A.2. Lemmas 3 and 4 and the claim on gag_aga​ assume only that arm 111 is the unique best arm, which is weaker than the paper's standing ordering.

A formalization that replaces Alt(μ)\mathrm{Alt}(\boldsymbol\mu)Alt(μ) by {λa≥λ1}\{\lambda_a\ge\lambda_1\}{λa​≥λ1​}, assumes the maximizer exists and is unique, or asserts only existence of some y∗y^*y∗ without the formula for w∗w^*w∗, does not state these results and is ruled out.

A complete development needs: basic calculus of exponential families (the Bregman form of ddd, its continuity and strict positivity off the diagonal, its monotonicity in the second argument), the inverse function of a continuous strictly monotone map on an interval, and compactness of the simplex. The divergence facts are reusable in every bandit mission built on exponential families. Proofs of the milestones, of auxiliary facts about ddd and IαI_\alphaIα​, and a sorry-free instance of ExpFamily (Bernoulli or unit-variance Gaussian) are welcome.

Selected references

  • A. Garivier, E. Kaufmann, Optimal Best Arm Identification with Fixed Confidence, COLT 2016 (JMLR W&CP 49), arXiv:1602.04589v2. https://arxiv.org/abs/1602.04589
  • E. Kaufmann, O. Cappé, A. Garivier, On the Complexity of Best-Arm Identification in Multi-Armed Bandit Models, JMLR 17, 2016. https://arxiv.org/abs/1407.4443
  • N. K. Vaidhyan, R. Sundaresan, Learning to detect an oddball target, arXiv:1508.05572, 2015. https://arxiv.org/abs/1508.05572
  • O. Cappé, A. Garivier, O.-A. Maillard, R. Munos, G. Stoltz, Kullback–Leibler upper confidence bounds for optimal sequential allocation, Annals of Statistics 41(3), 2013. https://arxiv.org/abs/1210.1136
6 thms2 active usersReviewed
🏆Completed
Convex OptimizationOperations ResearchOptimization·Captain: mikedeng1

A Stochastic Quasi-Newton Method for Large-Scale Optimization: The Expected Suboptimality Bound of the SQN MethodResearch Paper

Motivation

Training a statistical model by empirical risk minimization means minimizing an average of NNN losses over a parameter vector w∈Rnw\in\mathbb R^nw∈Rn, where both NNN and nnn can be in the millions. Stochastic gradient descent (SGD) is the standard method: each step uses the gradient of a small random batch of losses. It is cheap per step but sensitive to the scaling of the problem. Quasi-Newton methods such as L-BFGS correct the scaling in deterministic optimization, but naive stochastic versions are unstable, because differences of noisy gradients are poor curvature estimates.

Byrd, Hansen, Nocedal and Singer (SIAM J. Optim. 26(2), 2016) proposed the stochastic quasi-Newton (SQN) method. It decouples the two estimates: gradients come from small batches at every step, while curvature pairs are formed only every LLL steps, from averaged iterates and subsampled Hessian–vector products. The paper's analysis (Section 3) shows that the method keeps the O(1/k)O(1/k)O(1/k) expected suboptimality rate of SGD on strongly convex problems. The same eigenvalue bound was obtained independently by Mokhtari and Ribeiro (JMLR 16, 2015). Bottou, Curtis and Nocedal later gave a general treatment of such preconditioned stochastic methods (SIAM Review 60(2), 2018).

Setting

Let f1,…,fN:Rn→Rf_1,\dots,f_N:\mathbb R^n\to\mathbb Rf1​,…,fN​:Rn→R be twice continuously differentiable losses and

F(w)=1N∑i=1Nfi(w).F(w)=\frac1N\sum_{i=1}^N f_i(w).F(w)=N1​i=1∑N​fi​(w).

For a sample S⊆{1,…,N}\mathcal S\subseteq\{1,\dots,N\}S⊆{1,…,N} of size bbb, the minibatch gradient is ∇FS(w)=1b∑i∈S∇fi(w)\nabla F_{\mathcal S}(w)=\frac1b\sum_{i\in\mathcal S}\nabla f_i(w)∇FS​(w)=b1​∑i∈S​∇fi​(w). For a sample SH\mathcal S_HSH​ of size bHb_HbH​, the subsampled Hessian is ∇2FSH(w)=1bH∑i∈SH∇2fi(w)\nabla^2F_{\mathcal S_H}(w)=\frac1{b_H}\sum_{i\in\mathcal S_H}\nabla^2 f_i(w)∇2FSH​​(w)=bH​1​∑i∈SH​​∇2fi​(w).

Assumption 1 requires constants 0<λ,Λ0<\lambda,\Lambda0<λ,Λ with λI≺∇2FSH(w)≺ΛI\lambda I\prec\nabla^2F_{\mathcal S_H}(w)\prec\Lambda IλI≺∇2FSH​​(w)≺ΛI for every www and every Hessian sample. It also requires a bound γ2\gamma^2γ2 on the second moment of the stochastic gradient. w∗w^*w∗ denotes the minimizer of FFF.

Algorithm 2 turns correction pairs (sj,yj)(s_j,y_j)(sj​,yj​) into a matrix HtH_tHt​. With m~=min⁡{t,M}\tilde m=\min\{t,M\}m~=min{t,M}, it starts from stTytytTytI\frac{s_t^Ty_t}{y_t^Ty_t}IytT​yt​stT​yt​​I and applies the BFGS update

H←(I−ρjsjyjT)H(I−ρjyjsjT)+ρjsjsjT,ρj=1yjTsj,H\leftarrow(I-\rho_js_jy_j^T)H(I-\rho_jy_js_j^T)+\rho_js_js_j^T,\qquad\rho_j=\frac1{y_j^Ts_j},H←(I−ρj​sj​yjT​)H(I−ρj​yj​sjT​)+ρj​sj​sjT​,ρj​=yjT​sj​1​,

for j=t−m~+1,…,tj=t-\tilde m+1,\dots,tj=t−m~+1,…,t.

Algorithm 1 (SQN) runs for k=1,2,…k=1,2,\dotsk=1,2,…. It draws a gradient sample Sk\mathcal S_kSk​ and steps

wk+1=wk−αkH∇FSk(wk),w^{k+1}=w^k-\alpha^kH\nabla F_{\mathcal S_k}(w^k),wk+1=wk−αkH∇FSk​​(wk),

where H=IH=IH=I for k≤2Lk\le2Lk≤2L and H=HtH=H_tH=Ht​, t=⌊(k−1)/L⌋−1t=\lfloor(k-1)/L\rfloor-1t=⌊(k−1)/L⌋−1, afterwards. Every LLL iterations it forms the block average wˉt\bar w_twˉt​ of the last LLL iterates and a new pair

st=wˉt−wˉt−1,yt=∇2FSH,t(wˉt) st.s_t=\bar w_t-\bar w_{t-1},\qquad y_t=\nabla^2F_{\mathcal S_{H,t}}(\bar w_t)\,s_t .st​=wˉt​−wˉt−1​,yt​=∇2FSH,t​​(wˉt​)st​.

Samples are drawn independently and uniformly among the subsets of their size. The step length is αk=β/k\alpha^k=\beta/kαk=β/k.

Formalization targets

Goal: Corollary 3.3, with a corrected constant

There are 0<μ1≤μ20<\mu_1\le\mu_20<μ1​≤μ2​, depending only on the problem data, such that every matrix Algorithm 1 applies satisfies μ1I≺H≺μ2I\mu_1I\prec H\prec\mu_2Iμ1​I≺H≺μ2​I. Moreover, for every β>1/(2μ1λ)\beta>1/(2\mu_1\lambda)β>1/(2μ1​λ),

E[F(wk)−F(w∗)]≤Qc(β)k(k≥1),E[F(w^k)-F(w^*)]\le\frac{Q_c(\beta)}k\qquad(k\ge1),E[F(wk)−F(w∗)]≤kQc​(β)​(k≥1), Qc(β)=max⁡{Λμ22β2γ22(2μ1λβ−1), Λμ22β2γ2, F(w1)−F(w∗)}.Q_c(\beta)=\max\Big\{\frac{\Lambda\mu_2^2\beta^2\gamma^2}{2(2\mu_1\lambda\beta-1)},\ \Lambda\mu_2^2\beta^2\gamma^2,\ F(w^1)-F(w^*)\Big\}.Qc​(β)=max{2(2μ1​λβ−1)Λμ22​β2γ2​, Λμ22​β2γ2, F(w1)−F(w∗)}.

The constants μ1,μ2\mu_1,\mu_2μ1​,μ2​ are not fixed numerically. The goal asserts a rate of order 1/k1/k1/k with an explicit constant in terms of them.

Milestones

  • (3.8)–(3.10): the curvature bounds λ∥s∥2≤yTs≤Λ∥s∥2\lambda\|s\|^2\le y^Ts\le\Lambda\|s\|^2λ∥s∥2≤yTs≤Λ∥s∥2 and λ≤∥y∥2/yTs≤Λ\lambda\le\|y\|^2/y^Ts\le\Lambdaλ≤∥y∥2/yTs≤Λ for Hessian-product pairs.
  • (3.11) and (3.12): the trace bound and Powell's determinant formula for the direct L-BFGS matrices.
  • Lemma 3.1: μ1I≺Ht≺μ2I\mu_1I\prec H_t\prec\mu_2Iμ1​I≺Ht​≺μ2​I uniformly along every run.
  • (3.18): expected descent for the general Newton-like iteration wk+1=wk−αkHk∇f(wk,ξk)w^{k+1}=w^k-\alpha^kH_k\nabla f(w^k,\xi^k)wk+1=wk−αkHk​∇f(wk,ξk).
  • (3.19): 2λ[F(w)−F(w∗)]≤∥∇F(w)∥22\lambda[F(w)-F(w^*)]\le\|\nabla F(w)\|^22λ[F(w)−F(w∗)]≤∥∇F(w)∥2.
  • (3.22): the recursion ϕk+1≤(1−2αkμ1λ)ϕk+Λ2(αkμ2)2γ2\phi_{k+1}\le(1-2\alpha^k\mu_1\lambda)\phi_k+\frac\Lambda2(\alpha^k\mu_2)^2\gamma^2ϕk+1​≤(1−2αkμ1​λ)ϕk​+2Λ​(αkμ2​)2γ2.
  • Theorem 3.2: the Qc(β)/kQ_c(\beta)/kQc​(β)/k rate for the Newton-like iteration.

Significance

The corollary says that curvature information costs nothing in rate. With uniformly bounded preconditioners and the β/k\beta/kβ/k schedule, the SQN method converges in expectation at the same order as SGD, which is the order known to be optimal for this class of problems. Lemma 3.1 is the reusable part: it holds for any L-BFGS matrix built from pairs whose curvature is controlled by a bounded Hessian. Theorem 3.2 applies to every stochastic method whose preconditioner is fixed before the sample is drawn and has uniformly bounded spectrum.

The formalization adds three things. First, it states the result correctly. As printed, Theorem 3.2 is false and Assumption 1(3) cannot be satisfied (see Formalization scope), and the mission states and labels the repaired versions. Second, it gives a machine-checked statement of the SQN algorithm itself, which is not currently formalized anywhere. Third, it provides L-BFGS and preconditioned-SGD infrastructure that later missions on stochastic second-order methods can reuse. To our knowledge none of these results has a machine-checked proof.

Difficulty

The natural first idea is to feed the iterates of Algorithm 1 to a standard SGD rate theorem. This fails for two reasons. The preconditioner HtH_tHt​ depends on the past iterates and on independent Hessian samples, so the analysis needs a filtration in which HtH_tHt​ is known before the gradient sample is drawn. Also, the rate proof itself is an induction that breaks in the first iterations, which is exactly where the printed argument goes wrong.

On the linear-algebra side, the difficulty is a lower bound on the smallest eigenvalue of HtH_tHt​ that is uniform over all runs and all ttt. The curvature bounds on each individual pair do not give it directly, because the BFGS updates compound across the memory window. The expectation side needs conditional expectations of vector-valued functions and a descent inequality under a Hessian bound, neither of which Mathlib packages for this setting.

Formalization scope

Vectors live in EuclideanSpace ℝ (Fin n), matrices are Matrix (Fin n) (Fin n) ℝ acting through Matrix.toEuclideanLin, and A≺BA\prec BA≺B is (B - A).PosDef. Hessians are fderiv ℝ (gradient f) w. Indices k,tk,tk,t start at 111 as in the paper. In the corollary, EEE is an exact finite average over sample histories, and "almost surely" means "on every history". Theorem 3.2 uses a general probability space with a filtration. HkH_kHk​ and wkw^kwk are Fk\mathcal F_kFk​-measurable, the sample ξk\xi^kξk is Fk+1\mathcal F_{k+1}Fk+1​-measurable, and unbiasedness is a conditional expectation. Integrability of F(wk)F(w^k)F(wk) is part of each conclusion, so a junk-zero integral cannot satisfy it.

Two corrections to the paper, each labelled in the item titles and notes:

  • Iterate-wise γ\gammaγ. Assumption 1(3) says Eξ∥∇f(w,ξ)∥2≤γ2E_\xi\|\nabla f(w,\xi)\|^2\le\gamma^2Eξ​∥∇f(w,ξ)∥2≤γ2 for all www. Together with unbiasedness and λ\lambdaλ-strong convexity on Rn\mathbb R^nRn, this forces λ∥w−w∗∥≤∥∇F(w)∥≤γ\lambda\|w-w^*\|\le\|\nabla F(w)\|\le\gammaλ∥w−w∗∥≤∥∇F(w)∥≤γ for every www, which is impossible. The mission imposes the bound at the iterates, conditionally on the past, which is how the proof uses it.
  • Constant Qc(β)Q_c(\beta)Qc​(β). The induction after (3.22) multiplies by 1−2βμ1λ/k1-2\beta\mu_1\lambda/k1−2βμ1​λ/k, which is negative for k<2βμ1λk<2\beta\mu_1\lambdak<2βμ1​λ. Counterexample: n=1n=1n=1, f1,2(w)=(w∓1)2/2f_{1,2}(w)=(w\mp1)^2/2f1,2​(w)=(w∓1)2/2, Hk=IH_k=IHk​=I, w1=0w^1=0w1=0, β=2\beta=2β=2, γ2=5\gamma^2=5γ2=5. Then F(w2)−F(w∗)=2>Q(2)/2=5/3F(w^2)-F(w^*)=2>Q(2)/2=5/3F(w2)−F(w∗)=2>Q(2)/2=5/3, and the example survives perturbing the constants so that every strict inequality holds. The middle entry of QcQ_cQc​ repairs it, and Qc=QQ_c=QQc​=Q whenever 2μ1λβ≤3/22\mu_1\lambda\beta\le3/22μ1​λβ≤3/2.

Smaller conventions:

  • The pairs must satisfy st≠0s_t\neq0st​=0, since Algorithm 2 is undefined otherwise.
  • Hessian samples have size bH≥1b_H\ge1bH​≥1; the empty sample makes (2.3) a 0/00/00/0.
  • The corollary's undefined μ2\mu_2μ2​ is Lemma 3.1's constant, enlarged together with μ1\mu_1μ1​ to cover the initial H=IH=IH=I steps.
  • The block average of Algorithm 1 is used, not Eq. (2.1).

Trivializing encodings are ruled out: HtH_tHt​ is Algorithm 2 applied to Algorithm 1's own pairs, not an arbitrary bounded matrix, and the second-moment bound is not imposed for all www.

Needed infrastructure, all welcome as contributions: the symmetry and spectral bounds of Hessians of C2C^2C2 functions, trace and determinant identities for BFGS updates, the descent lemma from a Hessian upper bound, conditional-expectation manipulations for adapted iterations, and the reduction of Algorithm 1 with uniform finite sampling to the abstract iteration.

Selected references

  • R. H. Byrd, S. L. Hansen, J. Nocedal, Y. Singer, A Stochastic Quasi-Newton Method for Large-Scale Optimization, SIAM J. Optim. 26(2):1008–1031, 2016. https://doi.org/10.1137/140954362
  • A. Mokhtari, A. Ribeiro, Global Convergence of Online Limited Memory BFGS, J. Mach. Learn. Res. 16:3151–3181, 2015. https://jmlr.org/papers/v16/mokhtari15a.html
  • L. Bottou, F. E. Curtis, J. Nocedal, Optimization Methods for Large-Scale Machine Learning, SIAM Review 60(2):223–311, 2018. https://doi.org/10.1137/16M1080173
  • A. Nemirovski, A. Juditsky, G. Lan, A. Shapiro, Robust Stochastic Approximation Approach to Stochastic Programming, SIAM J. Optim. 19(4):1574–1609, 2009. https://doi.org/10.1137/070704277
  • M. J. D. Powell, Some global convergence properties of a variable metric algorithm for minimization without exact line searches, in Nonlinear Programming, SIAM-AMS Proc. IX, 1976, pp. 53–72.
13 thms2 active usersReviewed
🏆Completed
Combinatorics·Captain: mikedeng1

On the Uniform Convergence of Relative Frequencies of Events to Their Probabilities I: The Growth Function DichotomyResearch Paper

Motivation

Statistical learning theory asks when the empirical frequencies of a whole class of events converge to their probabilities uniformly over the class. Vapnik and Chervonenkis answered this question in 1971 (Theory Probab. Appl. 16 (1971) 264–280) by attaching to every class of sets a single combinatorial quantity, the growth function, and bounding the probability of a large uniform deviation in terms of it. For that bound to be useful, the growth function must grow more slowly than an exponential. The first result of the paper, Theorem 1, shows that the growth function of any class is either exactly 2r2^r2r or bounded by a polynomial. This dichotomy is the reason finite VC dimension (the size of the largest fully shattered sample) became the central complexity measure of learning theory.

Timeline of the combinatorial core:

  • 1971–1972. The same polynomial bound appeared in three independent papers: Vapnik and Chervonenkis (this paper; announced in Dokl. Akad. Nauk SSSR 181 (1968)), N. Sauer, On the density of families of sets, J. Combin. Theory Ser. A 13 (1972) 145–147, and S. Shelah, A combinatorial problem; stability and order for models and theories in infinitary languages, Pacific J. Math. 41 (1972) 247–261. The bound ∑k=0n(rk)\sum_{k=0}^{n} \binom{r}{k}∑k=0n​(kr​) of Lemma 1 below is now called the Sauer–Shelah lemma.
  • 1989. Blumer, Ehrenfeucht, Haussler and Warmuth, Learnability and the Vapnik–Chervonenkis dimension, J. ACM 36 (1989) 929–965, made finite VC dimension the characterization of PAC learnability.

Setting

Let XXX be a set and SSS a collection of subsets of XXX. A sample of size rrr is a finite sequence x1,…,xrx_1, \dots, x_rx1​,…,xr​ of elements of XXX; repetitions are allowed. Each A∈SA \in SA∈S induces in the sample the subsample of the terms that lie in AAA, which is determined by the set of positions {i:xi∈A}\{i : x_i \in A\}{i:xi​∈A}.

The index ΔS(x1,…,xr)\Delta^S(x_1, \dots, x_r)ΔS(x1​,…,xr​) is the number of different subsamples induced by the sets of SSS, i.e. the number of distinct sets of positions {i:xi∈A}\{i : x_i \in A\}{i:xi​∈A} with A∈SA \in SA∈S. It is at most 2r2^r2r. The growth function is

mS(r)=max⁡x1,…,xrΔS(x1,…,xr),m^S(r) = \max_{x_1, \dots, x_r} \Delta^S(x_1, \dots, x_r),mS(r)=x1​,…,xr​max​ΔS(x1​,…,xr​),

the maximum over all samples of size rrr. For the rays {y≤a}\{y \le a\}{y≤a} on the line mS(r)=r+1m^S(r) = r + 1mS(r)=r+1; for the open subsets of [0,1][0,1][0,1], mS(r)=2rm^S(r) = 2^rmS(r)=2r.

The function Φ(n,r)\Phi(n, r)Φ(n,r) on pairs of natural numbers is defined by the recurrence (1) of the paper,

Φ(n,r)=Φ(n,r−1)+Φ(n−1,r−1),Φ(0,r)=1,Φ(n,0)=1.\Phi(n, r) = \Phi(n, r-1) + \Phi(n-1, r-1), \qquad \Phi(0, r) = 1, \qquad \Phi(n, 0) = 1 .Φ(n,r)=Φ(n,r−1)+Φ(n−1,r−1),Φ(0,r)=1,Φ(n,0)=1.

In the Lean development these are index S x for x : Fin r → X, growthFunction S r, and Phi n r in the namespace VapnikChervonenkis.GrowthFunction.

Formalization targets

Goal: Theorem 1 (p. 267)

For a nonempty class SSS, either mS(r)=2rm^S(r) = 2^rmS(r)=2r for every rrr, or, with n≥1n \ge 1n≥1 the first value of rrr at which mS(r)=2rm^S(r) = 2^rmS(r)=2r fails,

mS(r)≤rn+1for all r≥0.m^S(r) \le r^n + 1 \qquad \text{for all } r \ge 0 .mS(r)≤rn+1for all r≥0.

The exponent nnn is pinned down by minimality: mS(n)≠2nm^S(n) \ne 2^nmS(n)=2n and mS(r)=2rm^S(r) = 2^rmS(r)=2r for every r<nr < nr<n.

Milestones, in the order the proof uses them

  1. The index is at most 2r2^r2r (p. 265): ΔS(x1,…,xr)≤2r\Delta^S(x_1, \dots, x_r) \le 2^rΔS(x1​,…,xr​)≤2r.
  2. The closed form of Φ\PhiΦ (p. 266): Φ(n,r)=∑k=0n(rk)\Phi(n, r) = \sum_{k=0}^{n} \binom{r}{k}Φ(n,r)=∑k=0n​(kr​) for r>nr > nr>n, and Φ(n,r)=2r\Phi(n, r) = 2^rΦ(n,r)=2r for r≤nr \le nr≤n.
  3. The polynomial bound (p. 266): Φ(n,r)≤rn+1\Phi(n, r) \le r^n + 1Φ(n,r)≤rn+1 for n>0n > 0n>0, r≥0r \ge 0r≥0.
  4. Lemma 1 (p. 266): if 1≤n≤i1 \le n \le i1≤n≤i and ΔS(x1,…,xi)≥Φ(n,i)\Delta^S(x_1, \dots, x_i) \ge \Phi(n, i)ΔS(x1​,…,xi​)≥Φ(n,i), some subsample xi1,…,xinx_{i_1}, \dots, x_{i_n}xi1​​,…,xin​​ of size nnn satisfies ΔS(xi1,…,xin)=2n\Delta^S(x_{i_1}, \dots, x_{i_n}) = 2^nΔS(xi1​​,…,xin​​)=2n.
  5. The first display of the proof of Theorem 1 (p. 268): if mS(n)≠2nm^S(n) \ne 2^nmS(n)=2n, then ΔS(x1,…,xr)<Φ(n,r)\Delta^S(x_1, \dots, x_r) < \Phi(n, r)ΔS(x1​,…,xr​)<Φ(n,r) for every sample of size r>nr > nr>n.

Significance

Theorem 1 converts the distribution-free bound P{π(l)>ε}≤4mS(2l)e−ε2l/8\mathbf P\{\pi^{(l)} > \varepsilon\} \le 4 m^S(2l) e^{-\varepsilon^2 l/8}P{π(l)>ε}≤4mS(2l)e−ε2l/8 of Theorem 2 of the same paper into a convergence statement: whenever the growth function is not identically 2r2^r2r, the right-hand side is a polynomial times a decaying exponential, so relative frequencies converge to probabilities uniformly over SSS. The same dichotomy underlies sample-complexity bounds for PAC learning, covering-number bounds for VC classes, and the notion of VC dimension itself; the exponent nnn is the VC dimension plus one.

The results are classical and proved. Mathlib contains the Sauer–Shelah lemma for finite set families (Finset.card_shatterer_le_sum_vcDim in Mathlib/Combinatorics/SetFamily/Shatter.lean). The platform has several open formal statements of Sauer's lemma for growth functions over finite point sets (ComputationalLearning.sauer_lemma, FoundationsML.RademacherVC.sauer_lemma, HighDimProb.Chaining.sauer_shelah) and a closed form for Kearns–Vazirani's Φ\PhiΦ (ComputationalLearning.phi_closed_form, the same recurrence). No statement of Theorem 1, and none over the paper's sequence model of samples, is formalized. This mission formalizes the paper's own route: Lemma 1 in the paper's form, the polynomial bound on Φ\PhiΦ, and the dichotomy with the minimal exponent. It also provides the growth function over sequences that the companion missions (Theorem 2, and the entropy criterion Theorem 4) are stated with.

Difficulty

The obvious argument has two steps: bound ΔS\Delta^SΔS by Φ(n,r)\Phi(n, r)Φ(n,r) whenever no subsample of size nnn is fully split, then bound Φ(n,r)\Phi(n, r)Φ(n,r) by rn+1r^n + 1rn+1. The first step is the Sauer–Shelah lemma, and it does not follow from counting alone. A class can induce many subsamples on rrr points without inducing all 2n2^n2n on any fixed nnn of them, and no counting of subsamples one position at a time rules this out. The second step is elementary but must hold uniformly for all rrr, including r≤nr \le nr≤n, where Φ(n,r)=2r\Phi(n, r) = 2^rΦ(n,r)=2r and the bound 2r≤rn+12^r \le r^n + 12r≤rn+1 uses r≤nr \le nr≤n.

Samples are sequences, not sets. With repeated points, two positions carrying the same point can never be separated, so Lemma 1 must be applied to position sets rather than point sets. Transferring Mathlib's set-family lemma to this setting is a bookkeeping step that does not reduce to a citation.

Formalization scope

  • A sample of size rrr is x : Fin r → X with positions 0,…,r−10, \dots, r-10,…,r−1; repetitions are allowed. A subsample of size nnn is x ∘ e with e : Fin n → Fin i strictly increasing.
  • index S x counts distinct Finset (Fin r) of positions {i | x i ∈ A} with A ∈ S. Counting point sets A ∩ {x_1, …, x_r} instead would be a different object when points repeat; the growth function over finite sets of points (as in ComputationalLearning_VC) differs from mSm^SmS when XXX has fewer than rrr elements.
  • growthFunction S r is the supremum in ℕ of index S x over all samples; the family is bounded by 2r2^r2r, so it is a maximum. When XXX is empty and r≥1r \ge 1r≥1 its value is 000; mS(0)=1m^S(0) = 1mS(0)=1 exactly when SSS is nonempty.
  • Phi is defined by the recurrence (1). The paper introduces Φ(n,r)\Phi(n, r)Φ(n,r) as the maximal number of components into which rrr hyperplanes cut nnn-space; that geometric identity (Example 3) is not part of this mission.
  • Hypothesis added to Theorem 1: SSS nonempty. The paper calls nnn "a positive constant"; for S=∅S = \emptysetS=∅ every index is 000, the first violation is at r=0r = 0r=0 and nnn is not positive.
  • Corrections of the printed text. (a) The closed form of Φ\PhiΦ is printed with summand (rn)\binom{r}{n}(nr​); it is formalized with (rk)\binom{r}{k}(kr​) (the printed version already fails at Φ(1,2)=3\Phi(1, 2) = 3Φ(1,2)=3). (b) The proof of Theorem 1 ends "for r>0r > 0r>0, Φ(n,r)<rn+1\Phi(n, r) < r^n + 1Φ(n,r)<rn+1", which fails at n=r=1n = r = 1n=r=1; the milestone is the non-strict bound stated on p. 266. The milestone texts are verbatim from the page.
  • Milestone 5 states the first display of the proof of Theorem 1 with its hypothesis as printed: nnn is the first value of rrr with mS(r)≠2rm^S(r) \ne 2^rmS(r)=2r.
  • The goal keeps the minimality of nnn. A version stating mS(r)≤rn+1m^S(r) \le r^n + 1mS(r)≤rn+1 for an arbitrary nnn with mS(n)≠2nm^S(n) \ne 2^nmS(n)=2n would be a different theorem, and a version that drops the first disjunct or allows n=0n = 0n=0 would trivialize.

No measure, σ-algebra or probability appears: the class SSS is an arbitrary collection of subsets of a bare type. Needed infrastructure: basic API for index (monotonicity in the sample, behaviour under restriction to a subsample) and a bridge between samples and Mathlib's set families (Finset.Shatters, Finset.vcDim). Both are reusable by the two companion missions of this paper, and contributions of either are welcome.

Selected references

  • V. N. Vapnik and A. Ya. Chervonenkis, On the uniform convergence of relative frequencies of events to their probabilities, Theory of Probability and Its Applications 16(2) (1971) 264–280 (English translation by B. Seckler). https://doi.org/10.1137/1116025
  • N. Sauer, On the density of families of sets, Journal of Combinatorial Theory, Series A 13 (1972) 145–147. https://doi.org/10.1016/0097-3165(72)90019-2
  • S. Shelah, A combinatorial problem; stability and order for models and theories in infinitary languages, Pacific Journal of Mathematics 41 (1972) 247–261. https://doi.org/10.2140/pjm.1972.41.247
  • A. Blumer, A. Ehrenfeucht, D. Haussler and M. K. Warmuth, Learnability and the Vapnik–Chervonenkis dimension, Journal of the ACM 36(4) (1989) 929–965. https://doi.org/10.1145/76359.76371
9 thms2 active usersReviewed
🏆Completed
Linear OptimizationOperations ResearchOptimal Transport+2·Captain: mikedeng1

Distributionally Robust Logistic Regression II: Worst- and Best-Case Misclassification Risks over a Wasserstein Ball Are Linear ProgramsResearch Paper

Motivation

A logistic regression model is fitted on finitely many samples, and the quantity a practitioner cares about is the misclassification risk of the fitted classifier on new data. Its empirical counterpart, the training error, is biased downwards, and classical generalization bounds give it an additive margin that depends on a complexity measure of the model class rather than on the data at hand.

Shafieezadeh-Abadeh, Mohajerin Esfahani and Kuhn (NIPS 2015) take a distributionally robust route. They surround the empirical distribution of the training data by a ball of distributions in the Wasserstein metric and, for a given weight vector, compute the largest and the smallest misclassification probability over that ball. Their Theorem 3 shows that both extremes are optimal values of explicit linear programs. Combined with a measure-concentration result for the empirical distribution in the Wasserstein metric (Fournier and Guillin, PTRF 2015), the two values bracket the true risk with a prescribed confidence. The same Wasserstein-ball construction underlies the data-driven optimization framework of Mohajerin Esfahani and Kuhn (Math. Program. 2018).

Setting

Let VVV be the feature space Rn\mathbb R^nRn with an arbitrary norm ∥⋅∥\|\cdot\|∥⋅∥, and let labels take the values y∈{−1,+1}y\in\{-1,+1\}y∈{−1,+1}. The feature-label space is Ξ=V×{−1,+1}\Xi = V\times\{-1,+1\}Ξ=V×{−1,+1} with points ξ=(x,y)\xi=(x,y)ξ=(x,y). A weight vector β\betaβ acts on features by x↦⟨β,x⟩x\mapsto\langle\beta,x\ranglex↦⟨β,x⟩; its dual norm is ∥β∥∗=sup⁡∥x∥≤1⟨β,x⟩\|\beta\|_* = \sup_{\|x\|\le1}\langle\beta,x\rangle∥β∥∗​=sup∥x∥≤1​⟨β,x⟩.

Metric (Definition 2). For a weight κ>0\kappa>0κ>0,

d((x,y),(x′,y′))=∥x−x′∥+κ ∣y−y′∣/2.d\big((x,y),(x',y')\big) = \|x-x'\| + \kappa\,|y-y'|/2 .d((x,y),(x′,y′))=∥x−x′∥+κ∣y−y′∣/2.

Changing a label costs κ\kappaκ; moving a feature costs its norm distance.

Wasserstein distance (Definition 1). For distributions Q,P\mathbb Q,\mathbb PQ,P on Ξ\XiΞ, W(Q,P)W(\mathbb Q,\mathbb P)W(Q,P) is the infimum of ∫d(ξ,ξ′) Π(dξ,dξ′)\int d(\xi,\xi')\,\Pi(d\xi,d\xi')∫d(ξ,ξ′)Π(dξ,dξ′) over all couplings Π\PiΠ of Q\mathbb QQ and P\mathbb PP. The Wasserstein ball of radius ε≥0\varepsilon\ge0ε≥0 is Bε(P)={Q:W(Q,P)≤ε}\mathbb B_\varepsilon(\mathbb P) = \{\mathbb Q : W(\mathbb Q,\mathbb P)\le\varepsilon\}Bε​(P)={Q:W(Q,P)≤ε}.

Data. Training samples (x^i,y^i)(\hat x_i,\hat y_i)(x^i​,y^​i​), i=1,…,Ni=1,\dots,Ni=1,…,N, define the empirical distribution P^N=1N∑i=1Nδ(x^i,y^i)\hat{\mathbb P}_N = \frac1N\sum_{i=1}^N\delta_{(\hat x_i,\hat y_i)}P^N​=N1​∑i=1N​δ(x^i​,y^​i​)​.

Classifier and risk. Logistic regression models Prob⁡(y∣x)=[1+exp⁡(−y⟨β,x⟩)]−1\operatorname{Prob}(y\mid x) = [1+\exp(-y\langle\beta,x\rangle)]^{-1}Prob(y∣x)=[1+exp(−y⟨β,x⟩)]−1 (eq. (1)). The classifier is fβ(x)=+1f_\beta(x)=+1fβ​(x)=+1 if Prob⁡(+1∣x)>0.5\operatorname{Prob}(+1\mid x)>0.5Prob(+1∣x)>0.5 and −1-1−1 otherwise, and its risk under the data-generating distribution P\mathbb PP is R(β)=P[y≠fβ(x)]\mathfrak R(\beta) = \mathbb P[y\ne f_\beta(x)]R(β)=P[y=fβ​(x)].

Worst- and best-case risks.

Rmax⁡(β)=sup⁡Q∈Bε(P^N)EQ[1{y⟨β,x⟩≤0}],Rmin⁡(β)=inf⁡Q∈Bε(P^N)EQ[1{y⟨β,x⟩<0}].\mathfrak R_{\max}(\beta) = \sup_{\mathbb Q\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)}\mathbb E^{\mathbb Q}\big[\mathbb 1_{\{y\langle\beta,x\rangle\le0\}}\big],\qquad \mathfrak R_{\min}(\beta) = \inf_{\mathbb Q\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)}\mathbb E^{\mathbb Q}\big[\mathbb 1_{\{y\langle\beta,x\rangle<0\}}\big].Rmax​(β)=Q∈Bε​(P^N​)sup​EQ[1{y⟨β,x⟩≤0}​],Rmin​(β)=Q∈Bε​(P^N​)inf​EQ[1{y⟨β,x⟩<0}​].

The worst case counts a nonpositive margin, the best case a strictly negative one.

The linear programs. For data (x^i,y^i)(\hat x_i,\hat y_i)(x^i​,y^​i​), a weight vector β^\hat\betaβ^​ and variables λ∈R\lambda\in\mathbb Rλ∈R, s,r,t∈RNs,r,t\in\mathbb R^Ns,r,t∈RN, program (10a) minimizes λε+1N∑isi\lambda\varepsilon + \frac1N\sum_i s_iλε+N1​∑i​si​ subject to, for every iii,

1−riy^i⟨β^,x^i⟩≤si,1+tiy^i⟨β^,x^i⟩−λκ≤si,ri∥β^∥∗≤λ,ti∥β^∥∗≤λ,ri,ti,si≥0.1 - r_i\hat y_i\langle\hat\beta,\hat x_i\rangle\le s_i,\quad 1 + t_i\hat y_i\langle\hat\beta,\hat x_i\rangle - \lambda\kappa\le s_i,\quad r_i\|\hat\beta\|_*\le\lambda,\quad t_i\|\hat\beta\|_*\le\lambda,\quad r_i,t_i,s_i\ge0 .1−ri​y^​i​⟨β^​,x^i​⟩≤si​,1+ti​y^​i​⟨β^​,x^i​⟩−λκ≤si​,ri​∥β^​∥∗​≤λ,ti​∥β^​∥∗​≤λ,ri​,ti​,si​≥0.

Program (10b) has the same objective and bounds, with the signs of the two margin terms exchanged.

Formalization targets

Goal: Theorem 3 (i)–(ii)

For every κ>0\kappa>0κ>0, ε≥0\varepsilon\ge0ε≥0, N≥1N\ge1N≥1, all samples and every weight vector β^\hat\betaβ^​, both programs attain their minima vvv and www, and

Rmax⁡(β^)=v,Rmin⁡(β^)=1−w.\mathfrak R_{\max}(\hat\beta) = v,\qquad \mathfrak R_{\min}(\hat\beta) = 1-w .Rmax​(β^​)=v,Rmin​(β^​)=1−w.

The identities hold for each fixed β^\hat\betaβ^​, so they apply to any β^\hat\betaβ^​ computed from the data.

Milestone: Theorem 3(i) alone

Rmax⁡(β^)\mathfrak R_{\max}(\hat\beta)Rmax​(β^​) equals the minimum of (10a).

Milestones: the confidence clauses

If the training samples are i.i.d. from P\mathbb PP and the radius is such that PN{P∈Bε(P^N)}≥1−η\mathbb P^N\{\mathbb P\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)\}\ge1-\etaPN{P∈Bε​(P^N​)}≥1−η, then for any sample-dependent β^\hat\betaβ^​

PN{R(β^)≤Rmax⁡(β^)}≥1−η,PN{Rmin⁡(β^)≤R(β^)}≥1−η,\mathbb P^N\{\mathfrak R(\hat\beta)\le\mathfrak R_{\max}(\hat\beta)\}\ge1-\eta,\qquad \mathbb P^N\{\mathfrak R_{\min}(\hat\beta)\le\mathfrak R(\hat\beta)\}\ge1-\eta,PN{R(β^​)≤Rmax​(β^​)}≥1−η,PN{Rmin​(β^​)≤R(β^​)}≥1−η, PN{Rmin⁡(β^)≤R(β^)≤Rmax⁡(β^)}≥1−2η.\mathbb P^N\{\mathfrak R_{\min}(\hat\beta)\le\mathfrak R(\hat\beta)\le\mathfrak R_{\max}(\hat\beta)\}\ge1-2\eta .PN{Rmin​(β^​)≤R(β^​)≤Rmax​(β^​)}≥1−2η.

Significance

The result. Theorem 3 replaces an optimization over an infinite-dimensional set of distributions by a linear program with 3N+13N+13N+1 variables and 4N4N4N constraints plus sign constraints. That makes the worst- and best-case misclassification probabilities computable at the scale of the training set, for any norm on the features whose dual norm can be evaluated. With the confidence clauses, the two values are data-driven upper and lower confidence bounds on the out-of-sample risk of the classifier actually deployed, including one fitted on the same data.

Formalizing it. The paper states Theorem 3 without proof in the main text; the argument is deferred to a technical appendix. No part of it is machine-checked. A formal proof needs the evaluation of a worst-case probability of a closed set over a type-1 Wasserstein ball around a discrete distribution, and the analogous best-case probability of an open set. Both are reusable in any Wasserstein-robust treatment of chance constraints or classification error.

Difficulty

The objective 1{y⟨β,x⟩≤0}\mathbf 1_{\{y\langle\beta,x\rangle\le0\}}1{y⟨β,x⟩≤0}​ is neither continuous nor concave, so the duality theorems for Wasserstein balls stated for continuous or Lipschitz losses do not apply directly. Upper semicontinuity of the indicator of a closed set is what matters, and the strict inequality in Rmin⁡\mathfrak R_{\min}Rmin​ has to be handled as the complement of a closed set. The transport cost couples a norm on the features with a discrete label-flip cost, so a sample can reach the misclassification region either by moving its feature to the hyperplane ⟨β^,x⟩=0\langle\hat\beta,x\rangle=0⟨β^​,x⟩=0 or by flipping its label, and the two options interact through the shared budget ε\varepsilonε. Distances to the hyperplane are measured in the given norm and produce the dual norm ∥β^∥∗\|\hat\beta\|_*∥β^​∥∗​. The degenerate weight β^=0\hat\beta=0β^​=0 (every point on the hyperplane) must come out correctly without any division by ∥β^∥∗\|\hat\beta\|_*∥β^​∥∗​.

Formalization scope

The feature space is a finite-dimensional real normed space V with an arbitrary norm, standing for (Rn,∥⋅∥)(\mathbb R^n,\|\cdot\|)(Rn,∥⋅∥); the Euclidean norm is not assumed. A weight vector is a continuous linear functional V →L[ℝ] ℝ, and ∥β^∥∗\|\hat\beta\|_*∥β^​∥∗​ is its operator norm, which is exactly the dual norm. Labels are Bool with an explicit embedding true↦+1\text{true}\mapsto+1true↦+1, false↦−1\text{false}\mapsto-1false↦−1; the metric of Definition 2 is written literally. The Wasserstein distance is ℝ≥0∞-valued, probabilities and expectations of indicators are measure values in [0,∞][0,\infty][0,∞], and suprema and infima range exactly over the probability measures in the ball. "min" in (10a)/(10b) is formalized as attainment (IsLeast) of the objective over the feasible set. Samples are indexed by Fin N with N≥1N\ge1N≥1.

The following choices differ from a literal reading of the page:

  • The paper says the risk "can be expressed as" EP[1{y⟨β,x⟩≤0}]\mathbb E^{\mathbb P}[\mathbb 1_{\{y\langle\beta,x\rangle\le0\}}]EP[1{y⟨β,x⟩≤0}​]. This fails on the hyperplane ⟨β,x⟩=0\langle\beta,x\rangle=0⟨β,x⟩=0, where fβ(x)=−1f_\beta(x)=-1fβ​(x)=−1 is correct for y=−1y=-1y=−1. The mission defines R(β)=P[y≠fβ(x)]\mathfrak R(\beta)=\mathbb P[y\ne f_\beta(x)]R(β)=P[y=fβ​(x)] from (1) and includes the true statement EP[1{y⟨β,x⟩<0}]≤R(β)≤EP[1{y⟨β,x⟩≤0}]\mathbb E^{\mathbb P}[\mathbb 1_{\{y\langle\beta,x\rangle<0\}}]\le\mathfrak R(\beta)\le\mathbb E^{\mathbb P}[\mathbb 1_{\{y\langle\beta,x\rangle\le0\}}]EP[1{y⟨β,x⟩<0}​]≤R(β)≤EP[1{y⟨β,x⟩≤0}​] as a helper item.
  • The choice ε=εN(η)\varepsilon=\varepsilon_N(\eta)ε=εN​(η) of (8) and the measure-concentration theorem behind it (Theorem 2) are not formalized. The confidence clauses take their conclusion, PN{P∈Bε(P^N)}≥1−η\mathbb P^N\{\mathbb P\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)\}\ge1-\etaPN{P∈Bε​(P^N​)}≥1−η, as a hypothesis, and "with probability 1−η1-\eta1−η" is read as "with probability at least 1−η1-\eta1−η". The printed level 1−2η1-2\eta1−2η is kept for the two-sided bound.

Swapping the strict and non-strict inequalities in Rmax⁡\mathfrak R_{\max}Rmax​ and Rmin⁡\mathfrak R_{\min}Rmin​, restricting the supremum to measures supported on the sample points, or replacing the ball by a set that excludes non-discrete distributions would each change the theorem. None of these is an acceptable reformulation of the goal.

Useful infrastructure: couplings of a discrete measure with an arbitrary one, the distance from a point to a closed half-space in a general norm, and LP-duality arguments for fractional-knapsack-type programs. Proofs of the helper and confidence items, and any reusable lemma about worst-case probabilities of closed sets over Wasserstein balls, are welcome.

Selected references

  • S. Shafieezadeh-Abadeh, P. Mohajerin Esfahani, D. Kuhn, Distributionally Robust Logistic Regression, Advances in Neural Information Processing Systems 28 (NIPS 2015). https://papers.nips.cc/paper/2015/hash/cc1aa436277138f61cda703991069eaf-Abstract.html
  • N. Fournier, A. Guillin, On the rate of convergence in Wasserstein distance of the empirical measure, Probability Theory and Related Fields 162 (2015). https://doi.org/10.1007/s00440-014-0583-7
  • P. Mohajerin Esfahani, D. Kuhn, Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations, Mathematical Programming 171 (2018). https://doi.org/10.1007/s10107-017-1172-1
8 thms2 active usersReviewed
🏆Completed
Convex OptimizationOperations ResearchOptimal Transport+1·Captain: mikedeng1

Distributionally Robust Logistic Regression I: The Worst-Case Expected Logloss over a Wasserstein Ball Is a Tractable Convex ProgramResearch Paper

Motivation

Logistic regression is among the most widely used classification methods in statistics and machine learning. Its maximum-likelihood estimator minimizes the average logloss on the training data and is known to overfit when data are scarce; practitioners respond with ad hoc regularization, typically a norm penalty on the weight vector. Shafieezadeh-Abadeh, Mohajerin Esfahani and Kuhn (NIPS 2015, arXiv:1509.09259) replace the empirical average by a worst case over all distributions within a Wasserstein ball around the empirical distribution. The resulting model has a finite convex reformulation, contains classical and norm-regularized logistic regression as special cases, and comes with out-of-sample guarantees. It is one of the early instances of Wasserstein distributionally robust optimization in learning, building on the duality theory of Mohajerin Esfahani and Kuhn (Math. Program. 2018, arXiv:1505.05116); the regularization interpretation was later extended to general losses by Shafieezadeh-Abadeh, Kuhn and Mohajerin Esfahani (JMLR 2019, arXiv:1710.10016).

Setting

Let VVV be the feature space Rn\mathbb R^nRn with an arbitrary norm ∥⋅∥\|\cdot\|∥⋅∥, and let ∥β∥∗=sup⁡∥x∥≤1⟨β,x⟩\|\beta\|_* = \sup_{\|x\|\le1}\langle\beta,x\rangle∥β∥∗​=sup∥x∥≤1​⟨β,x⟩ be the dual norm of a weight vector β\betaβ. Labels are y∈{−1,+1}y\in\{-1,+1\}y∈{−1,+1}, and the feature-label space is Ξ=V×{−1,+1}\Xi = V\times\{-1,+1\}Ξ=V×{−1,+1}. The logloss of β\betaβ at (x,y)(x,y)(x,y) is

lβ(x,y)=log⁡(1+exp⁡(−y⟨β,x⟩)).l_\beta(x,y) = \log\big(1+\exp(-y\langle\beta,x\rangle)\big).lβ​(x,y)=log(1+exp(−y⟨β,x⟩)).

For a label weight κ>0\kappa>0κ>0, the metric of Definition 2 on Ξ\XiΞ is

d((x,y),(x′,y′))=∥x−x′∥+κ ∣y−y′∣/2,d\big((x,y),(x',y')\big) = \|x-x'\| + \kappa\,|y-y'|/2 ,d((x,y),(x′,y′))=∥x−x′∥+κ∣y−y′∣/2,

so that changing a label costs κ\kappaκ. The Wasserstein distance W(Q,P)W(\mathbb Q,\mathbb P)W(Q,P) between probability distributions on Ξ\XiΞ (Definition 1) is the infimum of ∫d(ξ,ξ′) Π(dξ,dξ′)\int d(\xi,\xi')\,\Pi(d\xi,d\xi')∫d(ξ,ξ′)Π(dξ,dξ′) over all couplings Π\PiΠ of Q\mathbb QQ and P\mathbb PP, and Bε(P)={Q:W(Q,P)≤ε}\mathbb B_\varepsilon(\mathbb P) = \{\mathbb Q : W(\mathbb Q,\mathbb P)\le\varepsilon\}Bε​(P)={Q:W(Q,P)≤ε}. Given training samples (x^i,y^i)i=1N(\hat x_i,\hat y_i)_{i=1}^N(x^i​,y^​i​)i=1N​, the empirical distribution is P^N=1N∑iδ(x^i,y^i)\hat{\mathbb P}_N = \frac1N\sum_i\delta_{(\hat x_i,\hat y_i)}P^N​=N1​∑i​δ(x^i​,y^​i​)​, and the distributionally robust logistic regression problem (6) is

J^=inf⁡β sup⁡Q∈Bε(P^N)EQ[lβ(x,y)].\hat J = \inf_\beta\ \sup_{\mathbb Q\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)} \mathbb E^{\mathbb Q}\big[l_\beta(x,y)\big].J^=βinf​ Q∈Bε​(P^N​)sup​EQ[lβ​(x,y)].

Program (7) has variables β\betaβ, λ∈R\lambda\in\mathbb Rλ∈R, s∈RNs\in\mathbb R^Ns∈RN, objective λε+1N∑isi\lambda\varepsilon + \frac1N\sum_i s_iλε+N1​∑i​si​, and constraints lβ(x^i,y^i)≤sil_\beta(\hat x_i,\hat y_i)\le s_ilβ​(x^i​,y^​i​)≤si​, lβ(x^i,−y^i)−λκ≤sil_\beta(\hat x_i,-\hat y_i)-\lambda\kappa\le s_ilβ​(x^i​,−y^​i​)−λκ≤si​ for all iii, and ∥β∥∗≤λ\|\beta\|_*\le\lambda∥β∥∗​≤λ.

Formalization targets

Goal: Theorem 1 (tractable reformulation)

For every ε≥0\varepsilon\ge0ε≥0, κ>0\kappa>0κ>0, N≥1N\ge1N≥1 and every norm on the feature space,

inf⁡β sup⁡Q∈Bε(P^N)EQ[lβ]  =  inf⁡{λε+1N∑isi:(β,λ,s) feasible for (7)},\inf_\beta\ \sup_{\mathbb Q\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)}\mathbb E^{\mathbb Q}[l_\beta] \;=\; \inf\Big\{\lambda\varepsilon+\tfrac1N\textstyle\sum_i s_i : (\beta,\lambda,s)\text{ feasible for (7)}\Big\},βinf​ Q∈Bε​(P^N​)sup​EQ[lβ​]=inf{λε+N1​∑i​si​:(β,λ,s) feasible for (7)},

and for ε>0\varepsilon>0ε>0 the infimum of (7) is attained.

Milestones

  1. §3.1 — the feasible set of (7) is convex.
  2. §2 — for ε=0\varepsilon=0ε=0 the worst-case expected logloss is the empirical average logloss, so (6) reduces to classical logistic regression (2).
  3. Theorem 1 for fixed β\betaβ — sup⁡Q∈Bε(P^N)EQ[lβ]\sup_{\mathbb Q\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)}\mathbb E^{\mathbb Q}[l_\beta]supQ∈Bε​(P^N​)​EQ[lβ​] equals the attained minimum of (7) over (λ,s)(\lambda,s)(λ,s) with β\betaβ fixed.
  4. Remark 2, eq. (9) — at an optimal solution (β^,λ^,s^)(\hat\beta,\hat\lambda,\hat s)(β^​,λ^,s^),
J^=λ^ε+EP^N[lβ^]+1N∑imax⁡{0,y^i⟨β^,x^i⟩−λ^κ}.\hat J = \hat\lambda\varepsilon + \mathbb E^{\hat{\mathbb P}_N}[l_{\hat\beta}] + \tfrac1N\textstyle\sum_i\max\{0,\hat y_i\langle\hat\beta,\hat x_i\rangle-\hat\lambda\kappa\}.J^=λ^ε+EP^N​[lβ^​​]+N1​∑i​max{0,y^​i​⟨β^​,x^i​⟩−λ^κ}.
  1. Remark 1 — as κ→∞\kappa\to\inftyκ→∞ the optimal value of (7) converges to inf⁡βε∥β∥∗+1N∑ilβ(x^i,y^i)\inf_\beta \varepsilon\|\beta\|_* + \frac1N\sum_i l_\beta(\hat x_i,\hat y_i)infβ​ε∥β∥∗​+N1​∑i​lβ​(x^i​,y^​i​).
  2. Theorem 2, implication — if PN{P∈Bε(P^N)}≥1−η\mathbb P^N\{\mathbb P\in\mathbb B_\varepsilon(\hat{\mathbb P}_N)\}\ge1-\etaPN{P∈Bε​(P^N​)}≥1−η, then PN{EP[lβ^]≤J^}≥1−η\mathbb P^N\{\mathbb E^{\mathbb P}[l_{\hat\beta}]\le\hat J\}\ge1-\etaPN{EP[lβ^​​]≤J^}≥1−η.

Significance

Theorem 1 turns a minimax problem over an infinite-dimensional family of distributions into a finite convex program whose size grows linearly in NNN; with the ℓ1\ell_1ℓ1​, ℓ2\ell_2ℓ2​ or ℓ∞\ell_\inftyℓ∞​ norm it is a standard exponential-cone or conic program. Remark 1 explains norm-regularized logistic regression as a distributionally robust model: the regularizer is the dual norm of the transport cost on features, and the regularization weight is the radius of the ambiguity set. Remark 2 exposes an additional term that accounts for label noise and vanishes as label changes become prohibitively expensive. Theorem 2 makes the optimal value J^\hat JJ^ a certificate on the out-of-sample logloss whenever the ball contains the true distribution.

The paper's proofs are in a technical appendix and have not been machine-checked. Mathlib contains no Wasserstein distributionally robust duality. This mission produces a formal statement of the reformulation with an arbitrary norm and a label-dependent cost, together with formal versions of the paper's printed consequences of it (Remarks 1 and 2, the ε=0\varepsilon=0ε=0 reduction, and the implication in Theorem 2).

Difficulty

The worst-case expectation ranges over every Borel probability distribution within transport distance ε\varepsilonε of the empirical distribution, including distributions with unbounded support and distributions that move mass across labels. Exhibiting good distributions in the ball shows only that the robust value is at least the value of (7); the reverse inequality must control every distribution in the ball at once, and nothing in the definition of the ball bounds its elements' supports. The obvious simplification, restricting attention to distributions supported on finitely many points, again yields only a one-sided bound unless the supremum is shown to be approached by such distributions. The label term of the metric couples the two label classes, so results for a pure norm cost on the features do not apply directly, and the dual norm enters through an arbitrary norm rather than the Euclidean one.

Formalization scope

  • The feature space is an abstract finite-dimensional real normed space V standing for (Rn,∥⋅∥)(\mathbb R^n,\|\cdot\|)(Rn,∥⋅∥) with an arbitrary norm; weights are continuous linear functionals V →L[ℝ] ℝ, and ∥β∥∗\|\beta\|_*∥β∥∗​ is their operator norm, which is exactly the dual norm. Labels are Bool, embedded as ±1\pm1±1; the label −y-y−y is Boolean negation. The metric of Definition 2 is written literally.
  • The Wasserstein distance is of type 1, valued in [0,∞][0,\infty][0,∞], with couplings ranging over all probability measures on Ξ×Ξ\Xi\times\XiΞ×Ξ with the two prescribed marginals. The ball consists of probability measures.
  • Expectations of the positive logloss are lower Lebesgue integrals in [0,∞][0,\infty][0,∞], and the supremum over the ball is taken there; the optimal value of (7) is the infimum of its (nonnegative) objective over the feasible set, also in [0,∞][0,\infty][0,∞]. A Bochner integral, which vanishes on non-integrable functions, would make the worst case trivially finite and is not used.
  • The standing hypotheses are κ>0\kappa>0κ>0, ε≥0\varepsilon\ge0ε≥0, N≥1N\ge1N≥1.
  • Correction. The paper prints "min" in (7) for all ε≥0\varepsilon\ge0ε≥0. At ε=0\varepsilon=0ε=0 the minimum can fail to be attained (V=RV=\mathbb RV=R, N=1N=1N=1, x^1=1\hat x_1=1x^1​=1, y^1=+1\hat y_1=+1y^​1​=+1: the value is 000 but every feasible point has positive objective). The goal states the value identity for ε≥0\varepsilon\ge0ε≥0 and attainment for ε>0\varepsilon>0ε>0.
  • Remark 1 is formalized as convergence of optimal values as κ→∞\kappa\to\inftyκ→∞; a metric with κ=∞\kappa=\inftyκ=∞ is not formalized. Only convexity, not tractability, of (7) is stated. The first claim of Theorem 2 (the radius (8) and the light-tail assumption) is not formalized; the confidence of the ball event is a hypothesis of milestone 6.
  • A formalization in which the ball is taken only over distributions supported on the training samples, or in which the label term of the metric is dropped, trivializes the second constraint group of (7) and is ruled out: the ball here contains every Borel probability distribution on Ξ\XiΞ within the prescribed distance.
  • Infrastructure needed and reusable beyond this mission: type-1 optimal transport on product spaces with a label component, couplings and their marginals, and elementary properties of the logloss as a function of β\betaβ. Contributions of such supporting lemmas as independent theorems are welcome.

Selected references

  • S. Shafieezadeh-Abadeh, P. Mohajerin Esfahani, D. Kuhn, Distributionally Robust Logistic Regression, Advances in Neural Information Processing Systems 28 (NIPS 2015). https://arxiv.org/abs/1509.09259
  • P. Mohajerin Esfahani, D. Kuhn, Data-driven distributionally robust optimization using the Wasserstein metric: performance guarantees and tractable reformulations, Mathematical Programming 171 (2018). https://arxiv.org/abs/1505.05116
  • N. Fournier, A. Guillin, On the rate of convergence in Wasserstein distance of the empirical measure, Probability Theory and Related Fields 162 (2015). https://arxiv.org/abs/1312.2128
  • S. Shafieezadeh-Abadeh, D. Kuhn, P. Mohajerin Esfahani, Regularization via Mass Transportation, Journal of Machine Learning Research 20 (2019). https://arxiv.org/abs/1710.10016
9 thms2 active usersReviewed
🏆Completed
ProbabilityStatistics·Captain: mikedeng1

Adversarially Robust Generalization Requires More Data 3: Robust Learning in the Gaussian Model with Enough SamplesResearch Paper

Motivation

Classifiers trained by standard methods can be fooled by small, carefully chosen perturbations of their inputs. Adversarial training reduces this vulnerability on the training set, but on image benchmarks such as CIFAR10 the robust accuracy on held-out data remains far below the training accuracy. Schmidt, Santurkar, Tsipras, Talwar and Mądry (arXiv:1804.11285) asked whether this gap is a failure of current algorithms or an intrinsic statistical phenomenon, and answered it in two simple data models: learning a classifier that is robust to ℓ∞\ell_\inftyℓ∞​-bounded perturbations can require provably more samples than learning a classifier with small standard error.

The paper's separation has two halves in its Gaussian model. The lower half (every learner needs many samples) is the subject of the companion mission Adversarially Robust Generalization Requires More Data 1. This mission formalizes the upper half: a concrete, simple estimator reaches small robust error once the number of samples is of order ε2d\varepsilon^2\sqrt dε2d​, so the lower bound is tight up to logarithmic factors.

Setting

Write ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle⟨⋅,⋅⟩ and ∥⋅∥2\|\cdot\|_2∥⋅∥2​ for the Euclidean inner product and norm on Rd\mathbb R^dRd, and ∥v∥∞=max⁡i∣vi∣\|v\|_\infty=\max_i|v_i|∥v∥∞​=maxi​∣vi​∣. Labels are y∈{±1}y\in\{\pm1\}y∈{±1}.

The (θ⋆,σ)(\theta^\star,\sigma)(θ⋆,σ)-Gaussian model (Definition 1) is the distribution of a pair (x,y)∈Rd×{±1}(x,y)\in\mathbb R^d\times\{\pm1\}(x,y)∈Rd×{±1} obtained by drawing the label yyy uniformly at random and then the point xxx from the spherical Gaussian Nd(y θ⋆,σ2I)\mathcal N_d(y\,\theta^\star,\sigma^2I)Nd​(yθ⋆,σ2I), where θ⋆∈Rd\theta^\star\in\mathbb R^dθ⋆∈Rd is the per-class mean and σ>0\sigma>0σ>0 the standard deviation of each coordinate. The paper works in the regime ∥θ⋆∥2=d\|\theta^\star\|_2=\sqrt d∥θ⋆∥2​=d​, which every statement of this mission assumes explicitly.

A classifier is a map f:Rd→{±1}f:\mathbb R^d\to\{\pm1\}f:Rd→{±1}. Its classification error (Definition 2) under a distribution P\mathcal PP is P(x,y)∼P[f(x)≠y]\mathbb P_{(x,y)\sim\mathcal P}[f(x)\ne y]P(x,y)∼P​[f(x)=y]. Given the perturbation set B∞ε(x)={x′:∥x′−x∥∞≤ε}\mathcal B_\infty^\varepsilon(x)=\{x':\|x'-x\|_\infty\le\varepsilon\}B∞ε​(x)={x′:∥x′−x∥∞​≤ε}, its ℓ∞ε\ell_\infty^\varepsilonℓ∞ε​-robust classification error (Definition 3) is

P(x,y)∼P[∃ x′∈B∞ε(x): f(x′)≠y].\mathbb P_{(x,y)\sim\mathcal P}\big[\exists\,x'\in\mathcal B_\infty^\varepsilon(x):\ f(x')\ne y\big].P(x,y)∼P​[∃x′∈B∞ε​(x): f(x′)=y].

The ℓpε\ell_p^\varepsilonℓpε​-robust error is defined the same way with the ℓp\ell_pℓp​ ball, and ∥w∥p∗=sup⁡{⟨w,v⟩:∥v∥p≤1}\|w\|_p^*=\sup\{\langle w,v\rangle:\|v\|_p\le1\}∥w∥p∗​=sup{⟨w,v⟩:∥v∥p​≤1} is the dual norm.

For w∈Rdw\in\mathbb R^dw∈Rd the linear classifier is fw(x)=sgn⁡⟨w,x⟩f_w(x)=\operatorname{sgn}\langle w,x\ranglefw​(x)=sgn⟨w,x⟩. The estimator studied here is built from nnn i.i.d. samples (x1,y1),…,(xn,yn)(x_1,y_1),\dots,(x_n,y_n)(x1​,y1​),…,(xn​,yn​) of the model: the class-weighted sample mean

zˉ=1n∑i=1nyixi,w^=zˉ∥zˉ∥2,\bar z=\frac1n\sum_{i=1}^ny_ix_i,\qquad \widehat w=\frac{\bar z}{\|\bar z\|_2},zˉ=n1​i=1∑n​yi​xi​,w=∥zˉ∥2​zˉ​,

and the classifier is fw^f_{\widehat w}fw​.

Formalization targets

Goal: Corollary 22

If ∥θ⋆∥2=d\|\theta^\star\|_2=\sqrt d∥θ⋆∥2​=d​ and σ≤132d1/4\sigma\le\frac1{32}d^{1/4}σ≤321​d1/4, then with probability at least 1−2exp⁡ ⁣(−d8(σ2+1))1-2\exp\!\big(-\frac{d}{8(\sigma^2+1)}\big)1−2exp(−8(σ2+1)d​) over the sample, fw^f_{\widehat w}fw​ has ℓ∞ε\ell_\infty^\varepsilonℓ∞ε​-robust classification error at most 0.010.010.01 provided

n≥{1ε≤14d−1/4,64 ε2d14d−1/4≤ε≤14.n\ge\begin{cases}1 & \varepsilon\le\frac14d^{-1/4},\\ 64\,\varepsilon^2\sqrt d & \frac14d^{-1/4}\le\varepsilon\le\frac14.\end{cases}n≥{164ε2d​​ε≤41​d−1/4,41​d−1/4≤ε≤41​.​

The general bound: Theorem 21

For every β>0\beta>0β>0 and every ε≤2n−12n+4σ−σ2log⁡(1/β)d\varepsilon\le\frac{2\sqrt n-1}{2\sqrt n+4\sigma}-\frac{\sigma\sqrt{2\log(1/\beta)}}{\sqrt d}ε≤2n​+4σ2n​−1​−d​σ2log(1/β)​​, with the same probability the ℓ∞ε\ell_\infty^\varepsilonℓ∞ε​-robust error of fw^f_{\widehat w}fw​ is at most β\betaβ.

Milestones on the way

The milestones follow the paper's Appendix A.1: Fact 12 (Gaussian norm tail); Lemmas 13 and 14 (norm of a Gaussian sample mean); Lemma 15 (inner product of the sample mean with the mean); Lemma 16 (alignment ⟨w^,μ⟩≥2n−12n+4σd\langle\widehat w,\mu\rangle\ge\frac{2\sqrt n-1}{2\sqrt n+4\sigma}\sqrt d⟨w,μ⟩≥2n​+4σ2n​−1​d​ with high probability); Lemma 17 (Gaussian margin tail for a fixed unit vector); Lemma 20 (the ℓpε\ell_p^\varepsilonℓpε​-robust error of a fixed linear classifier, for every p∈[1,∞]p\in[1,\infty]p∈[1,∞]); and Theorem 21. The mission also contains Theorem 18, the corresponding standard-generalization bound, as a companion item.

Significance

The result. Corollary 22 shows that the ℓ∞\ell_\inftyℓ∞​ lower bound of the paper is essentially attained by an elementary estimator: in the regime σ≈d1/4\sigma\approx d^{1/4}σ≈d1/4 a single sample gives small standard error, while ℓ∞\ell_\inftyℓ∞​-robustness at level ε\varepsilonε is obtained with O(ε2d)O(\varepsilon^2\sqrt d)O(ε2d​) samples, matching the lower bound Ω(ε2d/log⁡d)\Omega(\varepsilon^2\sqrt d/\log d)Ω(ε2d​/logd) up to a logarithm. The separation between standard and robust sample complexity is therefore a property of the data distribution and not of a weak learning procedure. Lemma 20 is of independent use: it gives the exact form of the robust error of any linear classifier in a Gaussian model for every ℓp\ell_pℓp​ adversary.

Formalizing it. The results are proved in the paper; to the best of current knowledge none of them has a machine-checked proof. A formalization produces a checked instance of a statistical-versus-robust separation, and along the way checked versions of dimension-explicit Gaussian tail bounds (norm and inner-product tails of sample means) that Mathlib states only in partial form.

Difficulty

The estimator is explicit, so the difficulty is analytic and quantitative. Two obstacles stand out. First, the robust error involves a supremum over an uncountable perturbation set for every test point, so it is not a margin probability until the worst case over the ℓp\ell_pℓp​ ball has been identified exactly; any slack there changes the constants. Second, the estimator w^\widehat ww is random, and its alignment with θ⋆\theta^\starθ⋆ depends on two concentration events at once, a norm upper bound and an inner-product lower bound, with dimension-explicit constants. Generic sub-Gaussian bounds with unspecified constants, the usual first attempt, do not yield the stated 0.010.010.01, 646464 and 1/321/321/32: the constants have to be tracked through the final numerical case analysis. Gaussian norm concentration in the dimension-free form of Fact 12 is not available in Mathlib.

Formalization scope

Everything is stated in the namespace RobustGeneralization.GaussUpper. The data space is EuclideanSpace ℝ (Fin d); labels are Bool with true =+1=+1=+1. Nd(m,s2I)\mathcal N_d(m,s^2I)Nd​(m,s2I) is the push-forward of Mathlib's stdGaussian under v↦m+s vv\mapsto m+s\,vv↦m+sv, with sss the standard deviation (Definition 1 calls σ\sigmaσ the "variance parameter" but samples from N(yθ⋆,σ2I)\mathcal N(y\theta^\star,\sigma^2I)N(yθ⋆,σ2I)). The model is a measure on Rd×{±1}\mathbb R^d\times\{\pm1\}Rd×{±1} and the errors are literally the measures of the events of Definitions 2–3; since the robust event need not be Borel, the measure of it is its outer measure, i.e. its probability under the completed measure. The ℓ∞\ell_\inftyℓ∞​ ball is written coordinatewise. The linear classifier labels the tie ⟨w,x⟩=0\langle w,x\rangle=0⟨w,x⟩=0 as +1+1+1; no statement depends on this. w^\widehat ww is ∥zˉ∥2−1zˉ\|\bar z\|_2^{-1}\bar z∥zˉ∥2−1​zˉ, equal to 000 on the null event zˉ=0\bar z=0zˉ=0. The nnn samples are a product measure on Fin n → ℝ^d × Bool.

"With probability at least 1−q1-q1−q the error is at most β\betaβ" is stated as an upper bound on the probability of the failure set, which is the strong form under outer measures.

Added hypotheses, each disclosed in its item: t≥0t\ge0t≥0 (Fact 12), n≥1n\ge1n≥1 (Lemmas 13, 15 and Theorem 18), μ≠0\mu\ne0μ=0 (Lemma 15, false as printed at μ=0\mu=0μ=0), and β>0\beta>0β>0 (Theorem 21). The constants 1/321/321/32, 1/41/41/4, 646464, 0.010.010.01, 222 and 8(σ2+1)8(\sigma^2+1)8(σ2+1) are kept exactly.

A formalization that states the robust error bound for a fixed unit vector instead of the estimator w^\widehat ww, that replaces the robust error by its closed-form margin expression, or that uses the ℓ2\ell_2ℓ2​ ball instead of the ℓ∞\ell_\inftyℓ∞​ ball, proves a different and weaker statement and is excluded.

A complete development needs: Gaussian concentration for Lipschitz functions (or a direct χ\chiχ-type tail for ∥z∥2\|z\|_2∥z∥2​), the law of a sample mean of Gaussian vectors and of a one-dimensional projection of a spherical Gaussian, and the dual-norm identity for linear functionals over ℓp\ell_pℓp​ balls. These pieces are reusable beyond this mission. Proofs of any milestone, and reusable lemmas on spherical Gaussians under stdGaussian, are welcome. Related platform work: the other missions of this series, Adversarially Robust Generalization Requires More Data 1, 2 and 4.

Selected references

  • L. Schmidt, S. Santurkar, D. Tsipras, K. Talwar, A. Mądry, Adversarially Robust Generalization Requires More Data, arXiv:1804.11285v2, 2018 (NeurIPS 2018). https://arxiv.org/abs/1804.11285
  • S. Boucheron, G. Lugosi, P. Massart, Concentration Inequalities: A Nonasymptotic Theory of Independence, Oxford University Press, 2013 (Example 5.7 is the source of Fact 12). https://doi.org/10.1093/acprof:oso/9780199535255.001.0001
10 thms2 active usersReviewed
🏆Completed
Bandit AlgorithmsOptimization·Captain: mikedeng1

Taming the Monster: A Fast and Simple Algorithm for Contextual Bandits II: The Iteration Bound of Coordinate DescentResearch Paper

Motivation

In the contextual bandit problem a learner repeatedly observes a context, picks one of KKK actions, and sees the reward of that action only. Against a finite class Π\PiΠ of policies, statistically optimal regret of order KTln⁡∣Π∣\sqrt{KT\ln|\Pi|}KTln∣Π∣​ has been known since EXP4 (Auer et al., 2002), but EXP4 maintains a weight per policy and costs Ω(∣Π∣)\Omega(|\Pi|)Ω(∣Π∣) time per round. For the large policy classes used in practice (linear classifiers, trees), that is prohibitive.

The oracle-efficient line of work accesses Π\PiΠ only through a cost-sensitive classification oracle (an arg max oracle, AMO). The RandomizedUCB algorithm of Dudík et al. (2011) obtains optimal regret with polynomially many oracle calls by solving a convex program in each round, but the number of calls is large. Agarwal, Hsu, Kale, Langford, Li and Schapire (2014) replace that solver by a coordinate descent method whose number of iterations, and hence of oracle calls, is bounded independently of ∣Π∣|\Pi|∣Π∣. Their algorithm, ILOVETOCONBANDITS, and its practical variant are now standard references for oracle-based exploration.

This mission formalizes the optimization half of that paper: Algorithm 2 solves the per-epoch problem (OP) after at most 4ln⁡(1/(Kμ))/μ4\ln(1/(K\mu))/\mu4ln(1/(Kμ))/μ coordinate steps.

Setting

Let A={0,…,K−1}A=\{0,\dots,K-1\}A={0,…,K−1} be the actions, XXX any set of contexts, and Π⊆AX\Pi\subseteq A^XΠ⊆AX a finite nonempty set of policies. A history HtH_tHt​ is a sequence of t≥1t\ge1t≥1 records (xi,ai,ri(ai),pi(ai))(x_i,a_i,r_i(a_i),p_i(a_i))(xi​,ai​,ri​(ai​),pi​(ai​)) with ri(ai)∈[0,1]r_i(a_i)\in[0,1]ri​(ai​)∈[0,1] the observed reward and pi(ai)∈(0,1]p_i(a_i)\in(0,1]pi​(ai​)∈(0,1] the probability with which aia_iai​ was chosen. Write E^x∼Ht[f(x)]=1t∑if(xi)\widehat{\mathbb E}_{x\sim H_t}[f(x)]=\frac1t\sum_i f(x_i)Ex∼Ht​​[f(x)]=t1​∑i​f(xi​).

The inverse propensity scoring estimate (Eq. (1)) is

R^t(π)=1t∑i=1tri(ai) 1{π(xi)=ai}pi(ai),\widehat{\mathcal R}_t(\pi)=\frac1t\sum_{i=1}^t\frac{r_i(a_i)\,\mathbb 1\{\pi(x_i)=a_i\}}{p_i(a_i)},Rt​(π)=t1​i=1∑t​pi​(ai​)ri​(ai​)1{π(xi​)=ai​}​,

the estimated regret is Reg^t(π)=max⁡π′∈ΠR^t(π′)−R^t(π)\widehat{\mathrm{Reg}}_t(\pi)=\max_{\pi'\in\Pi}\widehat{\mathcal R}_t(\pi')-\widehat{\mathcal R}_t(\pi)Reg​t​(π)=maxπ′∈Π​Rt​(π′)−Rt​(π), and for a minimum probability μ\muμ one sets bπ=Reg^t(π)/(ψμ)b_\pi=\widehat{\mathrm{Reg}}_t(\pi)/(\psi\mu)bπ​=Reg​t​(π)/(ψμ) with ψ=100\psi=100ψ=100.

Weights are vectors Q∈RΠQ\in\mathbb R^\PiQ∈RΠ; ΔΠ\Delta^\PiΔΠ is the set of nonnegative QQQ with ∑πQ(π)≤1\sum_\pi Q(\pi)\le1∑π​Q(π)≤1. The smoothed projection of QQQ is

Qμ(a∣x)=(1−Kμ)∑π: π(x)=aQ(π)+μ.Q^\mu(a\mid x)=(1-K\mu)\sum_{\pi:\ \pi(x)=a}Q(\pi)+\mu .Qμ(a∣x)=(1−Kμ)π: π(x)=a∑​Q(π)+μ.

The optimization problem (OP) asks for Q∈ΔΠQ\in\Delta^\PiQ∈ΔΠ with

∑π∈ΠQ(π)bπ≤2K(2),E^x∼Ht[1Qμ(π(x)∣x)]≤2K+bπ  ∀π∈Π(3).\sum_{\pi\in\Pi}Q(\pi)b_\pi\le2K\quad(2),\qquad \widehat{\mathbb E}_{x\sim H_t}\Bigl[\frac1{Q^\mu(\pi(x)\mid x)}\Bigr]\le2K+b_\pi\ \ \forall\pi\in\Pi\quad(3).π∈Π∑​Q(π)bπ​≤2K(2),Ex∼Ht​​[Qμ(π(x)∣x)1​]≤2K+bπ​  ∀π∈Π(3).

Algorithm 2 starts from QinitQ_{\mathrm{init}}Qinit​ and loops. With Vπ(Q)=E^[1/Qμ(π(x)∣x)]V_\pi(Q)=\widehat{\mathbb E}[1/Q^\mu(\pi(x)\mid x)]Vπ​(Q)=E[1/Qμ(π(x)∣x)], Sπ(Q)=E^[1/Qμ(π(x)∣x)2]S_\pi(Q)=\widehat{\mathbb E}[1/Q^\mu(\pi(x)\mid x)^2]Sπ​(Q)=E[1/Qμ(π(x)∣x)2] and Dπ(Q)=Vπ(Q)−(2K+bπ)D_\pi(Q)=V_\pi(Q)-(2K+b_\pi)Dπ​(Q)=Vπ​(Q)−(2K+bπ​): if ∑πQ(π)(2K+bπ)>2K\sum_\pi Q(\pi)(2K+b_\pi)>2K∑π​Q(π)(2K+bπ​)>2K it rescales QQQ by c=2K/∑πQ(π)(2K+bπ)c=2K/\sum_\pi Q(\pi)(2K+b_\pi)c=2K/∑π​Q(π)(2K+bπ​) (Eq. (4)); then, if some π\piπ has Dπ(Q)>0D_\pi(Q)>0Dπ​(Q)>0, it adds

απ(Q)=Vπ(Q)+Dπ(Q)2(1−Kμ)Sπ(Q)\alpha_\pi(Q)=\frac{V_\pi(Q)+D_\pi(Q)}{2(1-K\mu)S_\pi(Q)}απ​(Q)=2(1−Kμ)Sπ​(Q)Vπ​(Q)+Dπ​(Q)​

to Q(π)Q(\pi)Q(π) (Step 8) and repeats; otherwise it halts and outputs QQQ.

The analysis uses the potential (Eq. (6)), with τ=t\tau=tτ=t and UA\mathcal U_AUA​ uniform on AAA,

Φm(Q)=τμ(E^x[RE(UA ∥ Qμ(⋅∣x))]1−Kμ+∑πQ(π)bπ2K),RE(p∥q)=∑a(paln⁡paqa+qa−pa).\Phi_m(Q)=\tau\mu\left(\frac{\widehat{\mathbb E}_x[\mathrm{RE}(\mathcal U_A\,\|\,Q^\mu(\cdot\mid x))]}{1-K\mu}+\frac{\sum_\pi Q(\pi)b_\pi}{2K}\right),\qquad \mathrm{RE}(p\|q)=\sum_a\bigl(p_a\ln\tfrac{p_a}{q_a}+q_a-p_a\bigr).Φm​(Q)=τμ(1−KμEx​[RE(UA​∥Qμ(⋅∣x))]​+2K∑π​Q(π)bπ​​),RE(p∥q)=a∑​(pa​lnqa​pa​​+qa​−pa​).

Formalization targets

Goal: Theorem 3 (p. 6)

For 0<μ≤1/(2K)0<\mu\le1/(2K)0<μ≤1/(2K), Algorithm 2 with Qinit=0Q_{\mathrm{init}}=\mathbf 0Qinit​=0 satisfies: every run executes Step 8 at most

4ln⁡(1/(Kμ))μ\frac{4\ln(1/(K\mu))}{\mu}μ4ln(1/(Kμ))​

times, whatever policy each Step 8 chooses among those with Dπ>0D_\pi>0Dπ​>0; and when it halts, its output solves (OP). The bound depends on KμK\muKμ only, not on ∣Π∣|\Pi|∣Π∣ or ttt.

Milestones

  1. Lemma 5 (p. 10). If Algorithm 2 halts and outputs QQQ, then QQQ satisfies (2), (3) and ∑πQ(π)≤1\sum_\pi Q(\pi)\le1∑π​Q(π)≤1.
  2. Lemma 6 (p. 10). If ∑πQ(π)(2K+bπ)>2K\sum_\pi Q(\pi)(2K+b_\pi)>2K∑π​Q(π)(2K+bπ​)>2K and ccc is as in Eq. (4), then Φm(cQ)≤Φm(Q)\Phi_m(cQ)\le\Phi_m(Q)Φm​(cQ)≤Φm​(Q).
  3. Lemma 7 (p. 10). If Dπ(Q)>0D_\pi(Q)>0Dπ​(Q)>0 and Q′Q'Q′ adds απ(Q)\alpha_\pi(Q)απ​(Q) to Q(π)Q(\pi)Q(π), then
Φm(Q)−Φm(Q′)≥τμ24(1−Kμ).\Phi_m(Q)-\Phi_m(Q')\ge\frac{\tau\mu^2}{4(1-K\mu)}.Φm​(Q)−Φm​(Q′)≥4(1−Kμ)τμ2​.

Significance

The result. Theorem 3 is what makes ILOVETOCONBANDITS computationally efficient: each call of Algorithm 2 is implemented with one AMO call per iteration (Lemma 1 of the paper), so the oracle complexity of an epoch is O(ln⁡(1/(Kμ))/μ)O(\ln(1/(K\mu))/\mu)O(ln(1/(Kμ))/μ). Combined with the epoch schedule and warm start, this gives the paper's total of O~(KT/ln⁡(∣Π∣/δ))\tilde O(\sqrt{KT/\ln(|\Pi|/\delta)})O~(KT/ln(∣Π∣/δ)​) oracle calls over TTT rounds. Theorem 3 also gives a constructive proof that (OP) is feasible for every history, which the regret analysis (a separate mission in this series) assumes.

Formalizing it. The result is proved in the paper, with complete proofs of Lemmas 5–7 in Appendix D. No machine-checked version is known. The formalization would give a checked termination bound for a coordinate descent method on a non-smooth feasibility problem, with a fully explicit constant, and a verified definition of the unnormalized relative entropy potential that is reusable for other smoothed-projection analyses (e.g. RandomizedUCB-type convex programs).

Difficulty

Termination cannot be read off the constraints. Step 8 raises one weight and can push the total weight above 1, after which Step 5 shrinks every coordinate, so no constraint and no single weight moves monotonically along a run. The number of policies that violate (3) can also go up after a step. Bounding the number of iterations therefore needs a global quantity that tracks progress through both kinds of step. The rescaling step is the harder of the two: it lowers every Qμ(a∣x)Q^\mu(a\mid x)Qμ(a∣x) at once, which pushes the relative-entropy term the wrong way, and it must be offset by the drop in the regret term. Knowing that (OP) is feasible, or that some convex function has a minimizer, bounds nothing about how many steps a particular method takes; that is the obvious approach, and it gives no count.

Formalization scope

  • Actions are Fin K with K≥1K\ge1K≥1; contexts form an arbitrary type (no measure is needed: Theorem 3 is deterministic). Π\PiΠ is a nonempty Finset (X → Fin K); weights are real functions on its subtype.
  • Histories are indexed by Fin t with t≥1t\ge1t≥1 (0-based indices). The paper allows pi(ai)∈[0,1]p_i(a_i)\in[0,1]pi​(ai​)∈[0,1]; the formalization requires pi(ai)∈(0,1]p_i(a_i)\in(0,1]pi​(ai​)∈(0,1], since Eq. (1) divides by it.
  • Reg^t(π)\widehat{\mathrm{Reg}}_t(\pi)Reg​t​(π) is written as max⁡π′R^t(π′)−R^t(π)\max_{\pi'}\widehat{\mathcal R}_t(\pi')-\widehat{\mathcal R}_t(\pi)maxπ′​Rt​(π′)−Rt​(π), which equals R^t(πt)−R^t(π)\widehat{\mathcal R}_t(\pi_t)-\widehat{\mathcal R}_t(\pi)Rt​(πt​)−Rt​(π) for any maximizer πt\pi_tπt​; ψ=100\psi=100ψ=100 is hard-wired in bπb_\pibπ​.
  • QμQ^\muQμ, VπV_\piVπ​, SπS_\piSπ​, (OP) and Φm\Phi_mΦm​ all use the smoothed projection of the unnormalized weights; there is no default policy in this mission.
  • μ\muμ ranges over (0,1/(2K)](0,1/(2K)](0,1/(2K)], the range of μm\mu_mμm​ in Algorithm 1 that the printed theorem refers to. τ\tauτ in Φm\Phi_mΦm​ is the history length ttt.
  • Algorithm 2 is encoded relationally. A run of length nnn from QinitQ_{\mathrm{init}}Qinit​ is a sequence Q(0)=Qinit,…,Q(n)Q^{(0)}=Q_{\mathrm{init}},\dots,Q^{(n)}Q(0)=Qinit​,…,Q(n) in which each Q(k+1)Q^{(k+1)}Q(k+1) is Step 8, for some policy with Dπ>0D_\pi>0Dπ​>0, applied to the rescaled Q(k)Q^{(k)}Q(k). It halts at Q(n)Q^{(n)}Q(n) when no policy has Dπ>0D_\pi>0Dπ​>0 after rescaling, and it then outputs the rescaled Q(n)Q^{(n)}Q(n). "Iterations" means executions of Step 8. The last pass, which halts at Step 10, is not counted: the paper's proof bounds "the number of times Step 8 is executed". The bound is compared in R\mathbb RR, without rounding.
  • Lemmas 5–7 are stated for nonnegative weight vectors without a bound on their sum, because Algorithm 2 rescales vectors whose sum may exceed 1. Lemma 7's "α=απ(Q)>0\alpha=\alpha_\pi(Q)>0α=απ​(Q)>0" is part of its conclusion.
  • A trivializing formalization is ruled out: the goal quantifies over every run from 0\mathbf 00 and every choice in Step 8, not over some run, and the potential, bπb_\pibπ​ and DπD_\piDπ​ are computed from the history rather than taken as free parameters.
  • The auxiliary facts Φm≥0\Phi_m\ge0Φm​≥0 and Φm(0)≤τμln⁡(1/(Kμ))/(1−Kμ)\Phi_m(\mathbf 0)\le\tau\mu\ln(1/(K\mu))/(1-K\mu)Φm​(0)≤τμln(1/(Kμ))/(1−Kμ) are inline claims in the paper and are not stated separately; contributions stating and proving them are welcome, as are general lemmas on the unnormalized relative entropy.
  • Out of scope: the regret bound (Theorem 2) and the probabilistic model (mission I of this series), the AMO implementation (Lemma 1), warm start and epoch-level oracle counts (Lemmas 2, 3, 8), and the support lower bound (Theorem 4).

Selected references

  • A. Agarwal, D. Hsu, S. Kale, J. Langford, L. Li, R. E. Schapire, Taming the Monster: A Fast and Simple Algorithm for Contextual Bandits, ICML 2014; arXiv:1402.0555v2. https://arxiv.org/abs/1402.0555
  • M. Dudík, D. Hsu, S. Kale, N. Karampatziakis, J. Langford, L. Reyzin, T. Zhang, Efficient Optimal Learning for Contextual Bandits, UAI 2011. https://arxiv.org/abs/1106.2369
  • P. Auer, N. Cesa-Bianchi, Y. Freund, R. E. Schapire, The Nonstochastic Multiarmed Bandit Problem, SIAM J. Comput. 32(1), 2002. https://doi.org/10.1137/S0097539701398375
7 thms2 active usersReviewed
🏆Completed
Bandit AlgorithmsOperations ResearchProbability·Captain: mikedeng1

Stochastic Linear Optimization under Bandit Feedback 2: A Regret Lower Bound on the CircleResearch Paper

Motivation

In stochastic linear optimization under bandit feedback a learner repeatedly chooses a point xtx_txt​ from a compact decision set D⊂RnD\subset\mathbb R^nD⊂Rn and observes only the random cost ℓt\ell_tℓt​ of that point, whose mean is μ⋅xt\mu\cdot x_tμ⋅xt​ for an unknown vector μ\muμ. The problem models online routing, ad placement and other sequential decisions with linearly structured costs. The quality of a learner is measured by its regret against the best fixed decision.

For the KKK-armed bandit the achievable regret for a fixed instance is logarithmic in the horizon TTT (Lai and Robbins 1985; Auer, Cesa-Bianchi and Fischer 2002). Dani, Hayes and Kakade (COLT 2008) showed that for linear costs the picture depends on the geometry of DDD. Their Theorem 1 gives polylogarithmic regret when the decision set has a positive gap between the best and second-best extreme point (a polytope, for instance), and their Theorem 2 gives O∗(nT)O^*(n\sqrt T)O∗(nT​) regret for every decision set. Their Theorem 3 shows that the second rate cannot be improved in general: on a decision set with zero gap, every algorithm pays Ω(T)\Omega(\sqrt T)Ω(T​) in expectation.

Timeline:

  • 2002: Auer, Using confidence bounds for exploitation–exploration trade-offs (JMLR 3), introduces confidence-bound algorithms for linear bandits on finite decision sets.
  • 2008: Dani, Hayes and Kakade prove the O∗(nT)O^*(n\sqrt T)O∗(nT​) upper bound for ConfidenceBall₂ and the Ω(T)\Omega(\sqrt T)Ω(T​) lower bound on a product of circles, the subject of this mission. A hypercube lower bound for the adversarial setting appears in their NIPS 2007 paper.
  • 2010: Rusmevichientong and Tsitsiklis, Linearly parameterized bandits (Math. OR 35), give Ω(nT)\Omega(n\sqrt T)Ω(nT​) lower bounds on the unit sphere.
  • 2020: Lattimore and Szepesvári, Bandit Algorithms, Theorems 24.1 and 24.2, give minimax lower bounds on the hypercube and the unit ball with Gaussian noise.

Setting

The decision set is the unit circle D2=S1={x∈R2:x12+x22=1}D_2=S^1=\{x\in\mathbb R^2: x_1^2+x_2^2=1\}D2​=S1={x∈R2:x12​+x22​=1}. An unknown mean vector μ∈R2\mu\in\mathbb R^2μ∈R2 is drawn once, uniformly from the circle D2/2D_2/2D2​/2 of radius 1/21/21/2; concretely μ=μ(θ)=12(cos⁡θ,sin⁡θ)\mu=\mu(\theta)=\tfrac12(\cos\theta,\sin\theta)μ=μ(θ)=21​(cosθ,sinθ) with θ\thetaθ uniform on [0,2π)[0,2\pi)[0,2π).

On each round t=1,…,Tt=1,\dots,Tt=1,…,T the algorithm plays xt∈D2x_t\in D_2xt​∈D2​ and observes a cost ℓt∈{−1,+1}\ell_t\in\{-1,+1\}ℓt​∈{−1,+1} with Pr⁡(ℓt=+1)=(1+μ⋅xt)/2\Pr(\ell_t=+1)=(1+\mu\cdot x_t)/2Pr(ℓt​=+1)=(1+μ⋅xt​)/2, so that E[ℓt]=μ⋅xt\mathbb E[\ell_t]=\mu\cdot x_tE[ℓt​]=μ⋅xt​. Given the decision, the cost is independent of the past.

An algorithm may be randomised. It draws a seed sss once from a probability measure ρ\rhoρ on a measurable space SSS, and chooses xtx_txt​ as a function of sss and the costs ℓ1,…,ℓt−1\ell_1,\dots,\ell_{t-1}ℓ1​,…,ℓt−1​ observed so far, measurably in sss.

The regret over TTT rounds is

R=∑t=1T(μ⋅xt−μ⋅x∗),μ⋅x∗=min⁡x∈D2μ⋅x,R=\sum_{t=1}^T(\mu\cdot x_t-\mu\cdot x^*),\qquad \mu\cdot x^*=\min_{x\in D_2}\mu\cdot x,R=t=1∑T​(μ⋅xt​−μ⋅x∗),μ⋅x∗=x∈D2​min​μ⋅x,

so each round costs rt=μ⋅xt+12≥0r_t=\mu\cdot x_t+\tfrac12\ge0rt​=μ⋅xt​+21​≥0 when ∥μ∥=1/2\|\mu\|=1/2∥μ∥=1/2. The expected regret ER=Eμ E(R∣μ)\mathbb E R=\mathbb E_\mu\,\mathbb E(R\mid\mu)ER=Eμ​E(R∣μ) averages over the seed, the prior and the costs.

In the Lean development these objects are unitCircle, meanVec, optCost, RandomizedPolicy and expectedRegret in the namespace StochLinOpt.LowerBound.

Formalization targets

Goal: Theorem 3 for n=2n=2n=2

There is a universal constant c>0c>0c>0 such that for every randomised algorithm and every T≥1T\ge1T≥1,

ER ≥ cT.\mathbb E R\ \ge\ c\sqrt T.ER ≥ cT​.

The constant is left existential, which is the form that survives any later improvement of the constant; it is chosen before the algorithm and before TTT.

Milestones

  1. Section 6.1, Eq. (3). For ∥μ1∥=∥μ2∥=1/2\|\mu_1\|=\|\mu_2\|=1/2∥μ1​∥=∥μ2​∥=1/2, x∈S1x\in S^1x∈S1, a posterior probability p∈[0,1]p\in[0,1]p∈[0,1] of μ=μ1\mu=\mu_1μ=μ1​ and a cost ℓ∈{±1}\ell\in\{\pm1\}ℓ∈{±1}, the Bayes-updated bias bt+1b_{t+1}bt+1​ satisfies ∣bt+1−bt∣≤∣(μ1−μ2)⋅x∣|b_{t+1}-b_t|\le|(\mu_1-\mu_2)\cdot x|∣bt+1​−bt​∣≤∣(μ1​−μ2​)⋅x∣, where bt=2p−1b_t=2p-1bt​=2p−1.
  2. Lemma 15. With ε=∥μ1−μ2∥>0\varepsilon=\|\mu_1-\mu_2\|>0ε=∥μ1​−μ2​∥>0 and the same data,
Eμ(rt∣Ht)≥116(ε2+∣bt+1−bt∣2ε2)1{∣bt∣≤1/2}.\mathbb E_\mu(r_t\mid\mathcal H_t)\ge\frac1{16}\Big(\varepsilon^2+\frac{|b_{t+1}-b_t|^2}{\varepsilon^2}\Big)\mathbf 1\{|b_t|\le1/2\}.Eμ​(rt​∣Ht​)≥161​(ε2+ε2∣bt+1​−bt​∣2​)1{∣bt​∣≤1/2}.
  1. Theorem 4 (Freedman). For a martingale difference sequence X1,…,XTX_1,\dots,X_TX1​,…,XT​ bounded above by bbb, with conditional variance sum VVV, and all a,v>0a,v>0a,v>0,
Pr⁡(∑iXi≥a, V≤v)≤exp⁡(−a22v+2ab/3).\Pr\Big(\sum_i X_i\ge a,\ V\le v\Big)\le\exp\Big(\frac{-a^2}{2v+2ab/3}\Big).Pr(i∑​Xi​≥a, V≤v)≤exp(2v+2ab/3−a2​).

Significance

The lower bound shows that the T\sqrt TT​ dependence of the problem-independent upper bound (Theorem 2 of the same paper) is necessary. It also shows that the gap-dependent polylogarithmic rate of Theorem 1 cannot extend to decision sets without a gap, such as the sphere. Together with the upper bound it characterises the minimax regret of stochastic linear bandits in TTT up to logarithmic factors, and in the paper's general-nnn form it also underlies the claim that the price of bandit information is Θ∗(n)\Theta^*(\sqrt n)Θ∗(n​).

The result is proved in the paper for n=2n=2n=2 and has not been machine-checked. The mission produces a checked Bayesian lower bound over all randomised algorithms, with an explicit probability model for the protocol. Two related platform results are different theorems: BanditAlgorithm.linear_bandit_unit_ball_minimax_lower_bound (Lattimore–Szepesvári Theorem 24.2: unit ball, Gaussian noise, a worst-case μ\muμ) and BanditAlgorithm.linear_bandit_hypercube_minimax_lower_bound (Theorem 24.1: hypercube). The {−1,+1}\{-1,+1\}{−1,+1} costs, the circle and the uniform prior used here are not covered by either.

Difficulty

The obvious attempt is a two-point change-of-measure argument with a fixed pair of means at distance ε\varepsilonε. It fails as stated because the decision set has no gap: an algorithm that plays close to the optimum of both candidates learns slowly but also pays little. The per-round trade-off between regret and information (Lemma 15) is exact only while the posterior is undecided, ∣bt∣≤1/2|b_t|\le1/2∣bt​∣≤1/2. Turning it into a bound on the whole horizon requires controlling how long the posterior stays undecided, which is a statement about a martingale whose step sizes are chosen by the algorithm; a concentration bound that ignores the accumulated conditional variance (Azuma–Hoeffding with worst-case steps) is too weak for this. The averaging step from a two-point prior to the uniform prior on the circle is also part of the formal work.

Formalization scope

Vectors are Fin 2 → ℝ with the dot product ⬝ᵥ; Euclidean norms are written through dot products, never with Lean's sup norm. Rounds are 0-indexed internally: the Lean index ttt is the paper's round t+1t+1t+1. The expected regret is the exact finite expectation

ER=∫S12π∫02π∑ℓ∈{±1}T∏t=1T1+ℓt μ(θ)⋅xt2  R  dθ dρ(s),\mathbb E R=\int_S\frac1{2\pi}\int_0^{2\pi}\sum_{\ell\in\{\pm1\}^T}\prod_{t=1}^T\frac{1+\ell_t\,\mu(\theta)\cdot x_t}{2}\;R\;d\theta\,d\rho(s),ER=∫S​2π1​∫02π​ℓ∈{±1}T∑​t=1∏T​21+ℓt​μ(θ)⋅xt​​Rdθdρ(s),

so no infinite product of measures is needed. A randomised algorithm is a seeded policy, which covers every randomised algorithm. The optimal cost is the infimum of μ⋅x\mu\cdot xμ⋅x over the compact circle and is attained. Every junk value in the model (a non-integrable integrand) could only make the lower bound harder to prove, never easier.

A statement over deterministic algorithms only, over a worst-case μ\muμ instead of the uniform prior, or with the constant allowed to depend on the algorithm or on TTT would be a weaker theorem. The goal quantifies ∃c>0\exists c>0∃c>0 before the algorithm and TTT, and fixes the prior.

Corrections relative to the printed paper:

  • General nnn is not stated. Theorem 3 as printed claims ER≥110nT\mathbb E R\ge\frac1{10}n\sqrt TER≥101​nT​ for every even nnn. It is false for n>10n>10n>10: on DnD_nDn​ with μ∈Dn/n\mu\in D_n/nμ∈Dn​/n each round has regret at most 111, so at T=1T=1T=1 the claim would need ER≥n/10>1\mathbb E R\ge n/10>1ER≥n/10>1. The general case rests on Lemma 16, which has no proof. The goal is the n=2n=2n=2 case, which Section 6.1 proves.
  • The constant. For n=2n=2n=2 the paper prints 15T\frac15\sqrt T51​T​; its proof gives c=116min⁡(12−1e,164)=11024c=\frac1{16}\min(\frac12-\frac1e,\frac1{64})=\frac1{1024}c=161​min(21​−e1​,641​)=10241​. The proof's Freedman step prints 2exp⁡(−1/41/8+ε/3)≤2/e22\exp(-\frac{1/4}{1/8+\varepsilon/3})\le 2/e^22exp(−1/8+ε/31/4​)≤2/e2; with v=1/32v=1/32v=1/32 the denominator is 1/16+ε/31/16+\varepsilon/31/16+ε/3, and the bound 2/e22/e^22/e2 then needs ε=T−1/4≤3/16\varepsilon=T^{-1/4}\le3/16ε=T−1/4≤3/16. Small TTT is covered by the first round, whose expected regret is 1/21/21/2. The goal leaves ccc existential.
  • Theorem 4. The printed variance sum runs to nnn; it runs to TTT. The conditioning is on a general filtration, and square-integrability of the steps is assumed so that the conditional variance is defined.
  • Lemma 15. Its right side depends on the round-ttt cost ℓt\ell_tℓt​, which is not part of Ht\mathcal H_tHt​; the Lean statement holds for either value of ℓt\ell_tℓt​.

Welcome contributions: a Lean proof of Freedman's inequality (reusable across the bandit and concentration missions on the platform); the averaging argument from two-point priors to the uniform prior; and the stopped-martingale bookkeeping for the bias sequence.

Selected references

  • Varsha Dani, Thomas P. Hayes, Sham M. Kakade, Stochastic Linear Optimization under Bandit Feedback, Proceedings of the 21st Annual Conference on Learning Theory (COLT), 2008.
  • David A. Freedman, On tail probabilities for martingales, The Annals of Probability 3(1):100–118, 1975. https://doi.org/10.1214/aop/1176996452
  • Colin McDiarmid, Concentration, in Probabilistic Methods for Algorithmic Discrete Mathematics, Springer, 1998. https://doi.org/10.1007/978-3-662-12788-9_6
  • Peter Auer, Using confidence bounds for exploitation–exploration trade-offs, JMLR 3:397–422, 2002. https://www.jmlr.org/papers/v3/auer02a.html
  • Paat Rusmevichientong, John N. Tsitsiklis, Linearly parameterized bandits, Mathematics of Operations Research 35(2):395–411, 2010. https://doi.org/10.1287/moor.1100.0446
  • Tor Lattimore, Csaba Szepesvári, Bandit Algorithms, Cambridge University Press, 2020, Chapter 24. https://doi.org/10.1017/9781108571401
5 thms2 active usersReviewed
🏆Completed
Optimization·Captain: ajax

Vathek I: Tiled graft training preserves the mathematical updateResearch Paper

Motivation

Modern machine-learning systems are routinely assembled by grafting: pretrained components (an encoder, a decoder) are re-used inside a new architecture, parts of them are frozen, and only selected coordinates are trained. When the full computation does not fit in memory, practitioners cut the loss into tiles (microbatches, row blocks, vocabulary shards), accumulate gradient contributions, and apply the optimizer once. Every memory-constrained trainer assumes this tiled schedule computes the same update as the monolithic one — but the folklore proof hides real failure modes: updating parameters after each tile, averaging tile means, clipping per tile, detaching a frozen component's input, or saving a weights-only checkpoint all silently change the learner.

This mission turns that folklore into a theorem with explicit hypotheses. The design source is the Vathek Graft white paper (Davis, 2026), which proposes an open-predicate extractor trained as a graft and makes the schedule-preservation claim its first proof obligation (Theorem T0). The architectural precedents are established: parallel set-based extraction (DetIE), set-prediction objectives, pointer-generator copying, and low-rank adaptation of frozen bases. What none of them supplies is the exact-arithmetic statement that the memory-saving row schedule preserves the mathematical update — that is the target here.

Setting

Fix finite-dimensional spaces: logical parameters w∈W=Rdw \in W = \mathbb{R}^dw∈W=Rd, of which only coordinates j∈Tj \in Tj∈T are trainable (PTP_TPT​ zeroes frozen coordinates), and a shared-state space V=RmV = \mathbb{R}^mV=Rm. One training frame ξ\xiξ carries a differentiable shared computation hξ:W→Vh_\xi : W \to Vhξ​:W→V (the donor encoder plus shared projections), finitely many occurrence losses fi:W×V→Rf_i : W \times V \to \mathbb{R}fi​:W×V→R with fixed coefficients αi\alpha_iαi​ over a finite occurrence set III, and all discrete choices, fixed during one logical update. The monolithic objective is

Lξ(w)=∑i∈Iαi fi(w,hξ(w)).L_\xi(w) = \sum_{i \in I} \alpha_i\, f_i\big(w, h_\xi(w)\big).Lξ​(w)=i∈I∑​αi​fi​(w,hξ​(w)).

A tile partition B=(B1,…,Bq)\mathcal{B} = (B_1, \dots, B_q)B=(B1​,…,Bq​) splits III into pairwise-disjoint tiles. The tiled evaluator streams the tiles through an accumulator of three slots — running loss, direct parameter-gradient contribution AAA, shared cotangent CCC — everything read at the same pre-update point w0w_0w0​, and finishes with one reverse pass:

gtile=A+Dhξ(w0)⊤C.g_{\mathrm{tile}} = A + Dh_\xi(w_0)^{\top} C.gtile​=A+Dhξ​(w0​)⊤C.

Then the gradient is projected to trainable coordinates, globally clipped at radius ccc, and a deterministic optimizer UUU is applied exactly once: Step⁡(S,ξ)=U(S,Cc(PT g))\operatorname{Step}(S, \xi) = U\big(S, C_c(P_T\, g)\big)Step(S,ξ)=U(S,Cc​(PT​g)), where SSS is the complete transition-relevant state (parameters, optimizer moments, step counter). One concrete masked-optimizer instance (masked AdamW) is included so "no decay on frozen coordinates" is a theorem, not a hope.

Formalization targets

The goal theorem packages exact one-step, trajectory, and restart preservation:

Ltile(w0)=Lξ(w0),gtile=∇Lξ(w0),Step⁡tile(S,ξ)=Step⁡mono(S,ξ),L_{\mathrm{tile}}(w_0) = L_\xi(w_0), \qquad g_{\mathrm{tile}} = \nabla L_\xi(w_0), \qquad \operatorname{Step}_{\mathrm{tile}}(S,\xi) = \operatorname{Step}_{\mathrm{mono}}(S,\xi),Ltile​(w0​)=Lξ​(w0​),gtile​=∇Lξ​(w0​),Steptile​(S,ξ)=Stepmono​(S,ξ),

and, by induction over a deterministic frame sequence, equality of the tiled and monolithic state trajectories, plus restart equality: saving at any completed update boundary a≤na \le na≤n and reloading the round-tripped structural snapshot preserves the remaining trajectory,

Run⁡tile(reload⁡(Sa), a:n)=Run⁡mono(S0, 0:n).\operatorname{Run}_{\mathrm{tile}}\big(\operatorname{reload}(S_a),\, a{:}n\big) = \operatorname{Run}_{\mathrm{mono}}(S_0,\, 0{:}n).Runtile​(reload(Sa​),a:n)=Runmono​(S0​,0:n).

Twelve milestones build the result: partition flattening; weighted partition sums; the shared-path chain rule ∇[f∘(id,h)]=∇1f+Dh⊤∇2f\nabla[f \circ (\mathrm{id}, h)] = \nabla_1 f + Dh^{\top} \nabla_2 f∇[f∘(id,h)]=∇1​f+Dh⊤∇2​f; linearity of the reverse pass over summed cotangents; the streaming-accumulator invariant and order independence; frozen-input differentiation with a concrete nonzero witness (θ↦6θ\theta \mapsto 6\thetaθ↦6θ through a frozen donor gives gradient 666666 at θ=2\theta = 2θ=2); projection–clipping–optimizer congruence; one-step equivalence; trajectory equivalence; checkpoint round trip; restart equivalence; and the full two-tile non-vacuity witness, whose tiled gradient is the nonzero 105/2105/2105/2 while its detached (input-frozen) variant falsely gives 000.

Significance

The result itself. Each clause rules out a real implementation bug: per-tile means change the objective on uneven tiles; updating after each tile reads moved parameters; clipping per tile differs from global clipping (gradients 101010 and −9-9−9 sum to 111, but clipped-then-summed give 000); a weights-only checkpoint loses optimizer state and changes the resumed trajectory. A verified tiled trainer — or a verified compiler schedule for one — can cite this mission's lemmas as its exactness certificate.

What formalizing it adds. The paper states Theorem T0 informally with a proof sketch; no machine-checked version exists. The load-bearing content is precisely the discipline of hypotheses: the certificates that per-occurrence gradients are genuine derivatives (partial derivatives alone do not give the chain rule), the single pre-update point for all tiles, and the complete transition state. Follow-on missions in the same vocabulary (source-byte integrity, masked normalization, matching invariance, numerical refinement, resource bounds) can import these definitions.

Difficulty

The analysis is elementary; the danger is vacuity and silent strengthening. A statement that hypothesizes "the tiled gradient is correct" proves nothing; one that hypothesizes differentiability of every branch at every point in a way no real frame satisfies proves nothing either. The encoding must let tiles be empty and uneven, let the occurrence set be empty (zero objective, not division by zero), quantify certificates only at the points used, and keep the optimizer deterministic-but-arbitrary. The counterexamples above are disproof fixtures: a correct statement survives all of them without ad-hoc exclusions.

Formalization scope

Parameters are EuclideanSpace ℝ (Fin d); gradients use HasGradientAt with genuine Fréchet derivatives paired by inner-product duality, and the reverse pass is ContinuousLinearMap.adjoint — no uninterpreted gradient oracle appears anywhere. Partitions are lists of Finsets; the accumulator is an executable fold. The checkpoint is a real-valued structural snapshot (coordinate lists); finite-byte codecs and floating-point associativity are explicitly out of scope — the theorem is exact-arithmetic. A trivializing formalization (defining the tiled gradient as the monolithic one, or hypothesizing the conclusion) is ruled out: milestone M12 exhibits a concrete instance with nonzero gradient that satisfies every hypothesis, and the detachment mutant shows the hypotheses have teeth.

Definitions are shared across the whole mission series under the VathekProof namespace: the frame, derivative-certificate, state, and optimizer files are reusable beyond this mission. Contributions welcome on any milestone; the witness computations (M06, M12) are self-contained entry points.

Selected references

  • Davis, Vathek Graft: A Proof and Evidence Programme, mission-source white paper v1.0, 2026 (§4–6, Appendix A) — the theorem source; private document, cited by section.
  • Vasilkovsky et al., DetIE: Multilingual Open Information Extraction Inspired by Object Detection, 2022. https://arxiv.org/abs/2206.12514
  • See, Liu, Manning, Get To The Point: Summarization with Pointer-Generator Networks, ACL 2017. https://aclanthology.org/P17-1099/
  • Hu et al., LoRA: Low-Rank Adaptation of Large Language Models, 2021. https://arxiv.org/abs/2106.09685
  • Loshchilov, Hutter, Decoupled Weight Decay Regularization, ICLR 2019. https://arxiv.org/abs/1711.05101
17 thms2 active usersReviewed
🏆Completed
CombinatoricsProbability·Captain: naimengye

Understanding Machine Learning XXIV: Compression BoundsTextbook

Motivation

The book has characterized learnability through uniform convergence and through stability; Chapter 30 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), gives a third sufficient condition, compression: if a learning algorithm's output can be reconstructed from a small subsequence of kkk training examples, then the error on the remaining examples estimates the true error, and the algorithm generalizes with a bound of order klog⁡(m/δ)/mk\log(m/\delta)/mklog(m/δ)/m (Theorem 30.2, Littlestone and Warmuth). The bound is a union bound over the mkm^kmk possible index sequences of a held-out estimate that follows from Bernstein's inequality (Lemma 30.1), and in the consistent case it gives LD≤8klog⁡(m/δ)/mL_D \le 8k\log(m/\delta)/mLD​≤8klog(m/δ)/m (Corollary 30.3). Classes admitting such compression schemes include axis-aligned rectangles (k=2dk = 2dk=2d), homogeneous halfspaces (k=dk = dk=d, through the minimal-norm point of the convex hull and Carathéodory's theorem), separating polynomials by reduction, and any margin-separable data (k≤1/γ2k \le 1/\gamma^2k≤1/γ2, through the Perceptron). Whether every class of finite VC dimension has a compression scheme of size O(d)O(d)O(d) is Warmuth's problem, open when the book was written.

Setting

A sample S=(z1,…,zm)S = (z_1, \dots, z_m)S=(z1​,…,zm​) is drawn i.i.d. from DDD; a selection rule picks (i1,…,ik)∈[m]k(i_1, \dots, i_k) \in [m]^k(i1​,…,ik​)∈[m]k (repetitions allowed), a reconstruction map B:Zk→HB : Z^k \to HB:Zk→H produces A(S)=B(zi1,…,zik)A(S) = B(z_{i_1}, \dots, z_{i_k})A(S)=B(zi1​​,…,zik​​), and VVV is the set of positions not selected, with LVL_VLV​ the average loss over them. The loss takes values in [0,1][0,1][0,1]. A class HHH has a compression scheme of size kkk (Definition 30.4) if for every m≥1m \ge 1m≥1 there are such AAA and BBB with B(SA(S))B(S_{A(S)})B(SA(S)​) correct on every sample labeled by a member of HHH; the unrealizable version (Definition 30.5) asks B(SA(S))B(S_{A(S)})B(SA(S)​) to be an empirical risk minimizer on every sample.

Formalization targets

Goal: Theorem 30.2

For a [0,1][0,1][0,1]-valued loss, k≥1k \ge 1k≥1, m≥2km \ge 2km≥2k, any reconstruction map BBB and any selection rule, with probability at least 1−δ1 - \delta1−δ over S∼DmS \sim D^mS∼Dm,

LD(A(S))≤LV(A(S))+LV(A(S)) 4klog⁡(m/δ)m+8klog⁡(m/δ)m.L_D(A(S)) \le L_V(A(S)) + \sqrt{L_V(A(S))\,\frac{4k\log(m/\delta)}{m}} + \frac{8k\log(m/\delta)}{m}.LD​(A(S))≤LV​(A(S))+LV​(A(S))m4klog(m/δ)​​+m8klog(m/δ)​.

Milestones

Lemma 30.1 (the held-out Bernstein bound); Corollary 30.3 (the consistent case); Lemma 30.6 (realizable schemes give unrealizable schemes); the compression scheme of size 2d2d2d for axis-aligned rectangles (§30.2.1); the separation property of the minimal-norm point of the convex hull (§30.2.2). Further items: the size-ddd scheme for homogeneous halfspaces and the margin scheme of §30.2.4.

Significance

Compression bounds are the cleanest generalization argument in the book: no complexity measure of the class enters, only the number of examples needed to encode the output, and the resulting bound is data-dependent through LVL_VLV​. They explain why support vector machines and the Perceptron generalize in terms of the number of support vectors or updates, and they underlie the sample-compression view of learning that connects to Chapters 9 and 15. Lemma 30.6 shows that compression is robust to label noise in the binary case. The halfspace scheme is a small piece of convex geometry of independent interest, and Warmuth's question about VC classes, settled in the affirmative for finite size by Moran and Yehudayoff after the book appeared, remains open in the form O(d)O(d)O(d).

Difficulty

Lemma 30.1 is Bernstein's inequality for the nnn held-out losses with variance at most LD(hT)L_D(h_T)LD​(hT​), followed by solving the resulting quadratic in LD\sqrt{L_D}LD​​ to move the risk from the right-hand side to LVL_VLV​; the constant 444 comes out of that step (the exact value is about 3.193.193.19). Theorem 30.2 is a union bound over the mkm^kmk index sequences with δ′=mkδ\delta' = m^k\deltaδ′=mkδ, using ∣V∣≥m−k≥m/2|V| \ge m - k \ge m/2∣V∣≥m−k≥m/2 and log⁡(mk/δ′)≤klog⁡(m/δ′)\log(m^k/\delta') \le k\log(m/\delta')log(mk/δ′)≤klog(m/δ′), which needs k≥1k \ge 1k≥1; formally the event for the learner is contained in the union of the events of Lemma 30.1 for each fixed index sequence, so no measurability of the selection rule is needed. Corollary 30.3 is immediate. Lemma 30.6 applies the realizable scheme to the subsample on which an ERM hypothesis is correct. The rectangle scheme is bookkeeping about extremal coordinates. The halfspace scheme needs three facts: the minimal-norm point of the hull separates (a one-line perturbation argument), it lies on a face and hence is a convex combination of ddd sample points (Carathéodory's theorem, in Mathlib, applied to a face), and it is the minimal-norm point of the hull of those ddd points (uniqueness of the projection onto a convex set); the existence of the minimizer uses compactness of the hull. The margin scheme is the Perceptron convergence theorem of Mission VI applied to the batch algorithm, whose output is the sum of the updated examples.

Formalization scope

Samples are Fin m-indexed under Mission I's iidLaw, and probability statements bound the outer measure of the failure event. Lemma 30.1 splits a sample of size k+nk + nk+n into its first kkk and last nnn entries; Theorem 30.2 takes an arbitrary selection rule sel:Zm→[m]k\mathrm{sel} : Z^m \to [m]^ksel:Zm→[m]k and reconstruction map BBB, the held-out set being the positions not in the range of the selection, and requires k≥1k \ge 1k≥1 and m≥1m \ge 1m≥1 in addition to the book's m≥2km \ge 2km≥2k: for k=0k = 0k=0 the bound reads LD≤LVL_D \le L_VLD​≤LV​, which fails, and the book's derivation uses k≥1k \ge 1k≥1 in log⁡(mk/δ′)≤klog⁡(m/δ′)\log(m^k/\delta') \le k\log(m/\delta')log(mk/δ′)≤klog(m/δ′). Compression schemes are defined for every m≥1m \ge 1m≥1, since for m=0m = 0m=0 there is no index to select, with indices allowed to repeat as in [m]k[m]^k[m]k and with BBB's outputs in HHH; the unrealizable version uses Mission XXIII's multiclass 0–1 loss. The halfspace results are stated for strictly separable ±1\pm1±1-labeled samples, yi⟨w⋆,xi⟩>0y_i\langle w^\star, x_i\rangle > 0yi​⟨w⋆,xi​⟩>0, the book's "w.l.o.g. all labels positive" normalization; this avoids the boundary negatives that a realizable sample may contain under the sign⁡(0)\operatorname{sign}(0)sign(0) convention of Mission VI, and it is the setting in which the minimal-norm argument works. The scheme is stated as the existence of ddd indices whose signed examples have a minimal-norm hull point separating the whole sample, which is the content of AAA and BBB without fixing how ties among faces are broken. Rectangles are closed boxes. The margin scheme uses Theorem 9.1's normalization.

Not stated: §30.2.3 (polynomials, a reduction), the bibliographic remarks, and the intermediate Carathéodory step as a separate item.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 30. doi:10.1017/CBO9781107298019
  • N. Littlestone, M. K. Warmuth, Relating data compression and learnability, technical report, University of California, Santa Cruz, 1986.
  • S. Floyd, M. K. Warmuth, Sample compression, learnability, and the Vapnik-Chervonenkis dimension, Machine Learning 21, 1995. doi:10.1007/BF00993593
  • S. Ben-David, A. Litman, Combinatorial variability of Vapnik-Chervonenkis classes with applications to sample compression schemes, Discrete Applied Mathematics 86, 1998. doi:10.1016/S0166-218X(98)00000-6
  • S. Moran, A. Yehudayoff, Sample compression schemes for VC classes, Journal of the ACM 63(3), 2016. doi:10.1145/2890490
10 thms2 active usersReviewed
🏆Completed
CombinatoricsProbability·Captain: naimengye

Understanding Machine Learning XXIII: Multiclass LearnabilityTextbook

Motivation

Chapter 17 introduced multiclass prediction; Chapter 29 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), asks the two questions the fundamental theorem answered for binary classes: which classes of multiclass predictors are PAC learnable with respect to the 0–1 loss, and with what sample complexity. Natarajan's dimension generalizes the VC dimension by shattering with two disagreeing label functions, and the multiclass fundamental theorem (Theorem 29.3) bounds the uniform-convergence, agnostic and realizable sample complexities in terms of it, up to logarithmic factors in the number of labels kkk; the only new ingredient in its proof is Natarajan's lemma, the multiclass substitute for Sauer's lemma. The chapter then computes or bounds the Natarajan dimension of the classes that matter, One-versus-All and general reductions to binary classifiers, and linear multiclass predictors (Theorem 29.7). Its last section is a warning: unlike the binary case, not all ERMs are equal, and with infinitely many labels a class can be learnable by one ERM and not by another, so learnability and uniform convergence come apart (Claim 29.9).

Setting

HHH is a class of functions from XXX to a finite label set YYY with ∣Y∣=k|Y| = k∣Y∣=k. C⊆XC \subseteq XC⊆X is shattered by HHH if there are f0,f1:C→Yf_0, f_1 : C \to Yf0​,f1​:C→Y with f0(x)≠f1(x)f_0(x) \ne f_1(x)f0​(x)=f1​(x) everywhere on CCC such that every B⊆CB \subseteq CB⊆C is realized by some h∈Hh \in Hh∈H agreeing with f0f_0f0​ on BBB and with f1f_1f1​ on C∖BC \setminus BC∖B (Definition 29.1); Ndim⁡(H)\operatorname{Ndim}(H)Ndim(H) is the largest size of a shattered set (Definition 29.2). One-versus-All builds T(hˉ)(x)=argmax⁡ihi(x)T(\bar h)(x) = \operatorname{argmax}_i h_i(x)T(hˉ)(x)=argmaxi​hi​(x) from kkk binary classifiers, the smaller label on ties; a general reduction applies a rule r:{0,1}l→[k]r : \{0,1\}^l \to [k]r:{0,1}l→[k] to lll binary classifiers; the linear class HΨH_\PsiHΨ​ predicts argmax⁡i⟨w,Ψ(x,i)⟩\operatorname{argmax}_i\langle w, \Psi(x, i)\rangleargmaxi​⟨w,Ψ(x,i)⟩ for a class-sensitive feature map Ψ:X×[k]→Rd\Psi : X \times [k] \to \mathbb{R}^dΨ:X×[k]→Rd (29.1). The class of §29.4 has labels Pf(X)∪{∗}P_f(X) \cup \{\ast\}Pf​(X)∪{∗}, the finite and cofinite subsets of XXX plus a special label, and hypotheses hA(x)=Ah_A(x) = AhA​(x)=A if x∈Ax \in Ax∈A and ∗\ast∗ otherwise; AgoodA_{good}Agood​ returns h∅h_\emptyseth∅​ on an all-∗\ast∗ sample and AbadA_{bad}Abad​ returns h{x1,…,xm}ch_{\{x_1, \dots, x_m\}^c}h{x1​,…,xm​}c​.

Formalization targets

Goal: Theorem 29.3

There are absolute constants C1,C2>0C_1, C_2 > 0C1​,C2​>0 such that every class H⊆YXH \subseteq Y^XH⊆YX with Ndim⁡(H)=d\operatorname{Ndim}(H) = dNdim(H)=d satisfies

C1d+log⁡(1/δ)ϵ2≤mHUC(ϵ,δ), mH(ϵ,δ)≤C2dlog⁡k+log⁡(1/δ)ϵ2,C1d+log⁡(1/δ)ϵ≤mHreal(ϵ,δ)≤C2dlog⁡(kd/ϵ)+log⁡(1/δ)ϵ,C_1\frac{d + \log(1/\delta)}{\epsilon^2} \le m^{UC}_H(\epsilon,\delta),\ m_H(\epsilon,\delta) \le C_2\frac{d\log k + \log(1/\delta)}{\epsilon^2}, \qquad C_1\frac{d + \log(1/\delta)}{\epsilon} \le m^{\mathrm{real}}_H(\epsilon,\delta) \le C_2\frac{d\log(kd/\epsilon) + \log(1/\delta)}{\epsilon},C1​ϵ2d+log(1/δ)​≤mHUC​(ϵ,δ), mH​(ϵ,δ)≤C2​ϵ2dlogk+log(1/δ)​,C1​ϵd+log(1/δ)​≤mHreal​(ϵ,δ)≤C2​ϵdlog(kd/ϵ)+log(1/δ)​,

the upper bounds by every ERM learner and the lower bounds for small ϵ,δ\epsilon, \deltaϵ,δ and d≥2d \ge 2d≥2, in the format of Mission IV's Theorem 6.8.

Milestones

Lemma 29.4 (Natarajan: ∣H∣≤∣X∣Ndim⁡(H)k2Ndim⁡(H)|H| \le |X|^{\operatorname{Ndim}(H)}k^{2\operatorname{Ndim}(H)}∣H∣≤∣X∣Ndim(H)k2Ndim(H)); Lemma 29.5 (the Natarajan dimension of One-versus-All is O(kdlog⁡(kd))O(kd\log(kd))O(kdlog(kd))); Theorem 29.7 (Ndim⁡(HΨ)≤d\operatorname{Ndim}(H_\Psi) \le dNdim(HΨ​)≤d); Claim 29.9(1) (AgoodA_{good}Agood​ needs 1ϵlog⁡1δ\frac1\epsilon\log\frac1\deltaϵ1​logδ1​ examples); Claim 29.9(2) (AbadA_{bad}Abad​ fails with constant probability on (∣X∣−1)/(6ϵ)(|X|-1)/(6\epsilon)(∣X∣−1)/(6ϵ) examples). Further items: the equality Ndim⁡=VCdim⁡\operatorname{Ndim} = \operatorname{VCdim}Ndim=VCdim for two classes, and Lemma 29.6 for general reductions.

Significance

Theorem 29.3 is the multiclass fundamental theorem of Natarajan (1989) and Ben-David, Cesa-Bianchi, Haussler and Long (1995): finite Natarajan dimension characterizes multiclass learnability, and the sample complexity is linear in it, with the dependence on kkk confined to logarithms. Natarajan's lemma is the combinatorial core, and the dimension bounds of §29.3 are what make the theorem usable: a One-versus-All scheme over a class of VC dimension ddd costs O~(kd)\tilde O(kd)O~(kd), and a linear multiclass predictor costs at most its number of parameters, so the multivector construction of Chapter 17 is learnable with O~(nk/ϵ2)\tilde O(nk/\epsilon^2)O~(nk/ϵ2) examples. Claim 29.9 is a genuine phenomenon of Daniely, Sabato, Ben-David and Shalev-Shwartz (2011): in multiclass classification the choice of ERM matters, and the equivalence "learnable iff uniform convergence" of the binary theory is false, which is why Conjecture 29.10 about good ERMs is open in the form the chapter states it.

Difficulty

The equality with the VC dimension for two labels is a direct comparison of the two shattering definitions. Natarajan's lemma is a Sauer-type induction on ∣X∣|X|∣X∣, in which a shattered set must be produced from two hypotheses that differ at a point; the exercise-level proof of the book becomes a careful double induction formally. Theorem 29.3's upper bounds follow the binary proof of Chapter 28 with Natarajan's lemma in place of Sauer's, hence Massart's lemma and Theorem 26.5 for the agnostic case and the double-sample argument for the realizable case; the lower bounds reduce to the binary ones by embedding a binary class into a multiclass one on a shattered set. These are long formal developments, and the theorem is stated with unspecified constants for that reason. Lemmas 29.5 and 29.6 are counting: a shattered CCC has 2∣C∣≤∣HC∣≤∣(Hbin)C∣k2^{|C|} \le |H_C| \le |(H_{bin})_C|^k2∣C∣≤∣HC​∣≤∣(Hbin​)C​∣k, Sauer's lemma bounds the right side by (∑i≤d(∣C∣i))k\big(\sum_{i \le d}\binom{|C|}{i}\big)^{k}(∑i≤d​(i∣C∣​))k, and the resulting inequality is solved. For Lemma 29.5's printed 3kdlog⁡(kd)3kd\log(kd)3kdlog(kd) this fails only at (k,d)=(2,1),(3,1)(k, d) = (2, 1), (3, 1)(k,d)=(2,1),(3,1). There a shattered set splits by the label pair {f0(x),f1(x)}\{f_0(x), f_1(x)\}{f0​(x),f1​(x)} into parts shattered by {B∖A:A,B∈Hbin}\{B \setminus A : A, B \in H_{bin}\}{B∖A:A,B∈Hbin​} (pairs {0,b}\{0, b\}{0,b}) or by HbinH_{bin}Hbin​ (other pairs). The first class has at most 313131 traces on 555 points. Theorem 29.7 maps a shattered set into Rd\mathbb{R}^dRd by ρ(x)=Ψ(x,f0(x))−Ψ(x,f1(x))\rho(x) = \Psi(x, f_0(x)) - \Psi(x, f_1(x))ρ(x)=Ψ(x,f0​(x))−Ψ(x,f1​(x)), up to sign, and shows the image is shattered by homogeneous halfspaces; the tie-breaking rule decides which sign and which halfspace convention to use. Claim 29.9(1) is the bound (1−ϵ)m≤δ(1-\epsilon)^m \le \delta(1−ϵ)m≤δ; Claim 29.9(2) needs only that at most (d−1)/2(d-1)/2(d−1)/2 of the d−1d-1d−1 light points appear in the sample, an event of probability at least 1/31/31/3 by Markov's inequality when m≤(d−1)/(6ϵ)m \le (d-1)/(6\epsilon)m≤(d−1)/(6ϵ), which exceeds the claimed e−1/6e^{-1}/6e−1/6.

Formalization scope

Labels are an arbitrary finite type, shattering and the Natarajan dimension are stated with witnesses f0,f1f_0, f_1f0​,f1​ defined on all of XXX, and the dimension is a supremum in N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞}. The multiclass 0–1 loss, the ERM property, agnostic PAC learnability and uniform convergence are Mission I's generic notions; the realizable multiclass PAC property is defined here in the shape of Definition 3.1 with D({h≠f})D(\{h \ne f\})D({h=f}) as the error, since Mission I's binary version is {0,1}\{0,1\}{0,1}-specific. Theorem 29.3 is stated exactly as Mission IV states Theorem 6.8, with existential constants, upper bounds for every ERM learner of a nonempty measurable class with the countable-approximation property (the measurability device of Remark 3.1), and lower bounds for ϵ<ϵ0\epsilon < \epsilon_0ϵ<ϵ0​, δ<δ0\delta < \delta_0δ<δ0​, d≥2d \ge 2d≥2. Argmax predictors, both One-versus-All and HΨH_\PsiHΨ​, break ties towards the smallest label; the book states this rule for One-versus-All, and some fixed rule is necessary for Theorem 29.7, since with arbitrary tie-breaking every function is an argmax predictor of the zero mapping. Lemmas 29.5 and 29.6 are stated per shattered set. Lemma 29.5 keeps the printed 3kdlog⁡(kd)3kd\log(kd)3kdlog(kd), which is true although the book's step ∣(Hbin)C∣≤∣C∣d|(H_{bin})_C| \le |C|^d∣(Hbin​)C​∣≤∣C∣d fails for small ∣C∣|C|∣C∣. Lemma 29.6 uses 2ldlog⁡2(2ld)2ld\log_2(2ld)2ldlog2​(2ld), which the counting supports, because the printed 3ldlog⁡(ld)3ld\log(ld)3ldlog(ld) is false at l=d=1l = d = 1l=d=1. Theorem 29.3's uniform-convergence upper bound is stated for d≥1d \ge 1d≥1. At d=0d = 0d=0 the confidence term log⁡(1/δ)\log(1/\delta)log(1/δ) vanishes as δ→1\delta \to 1δ→1, the bound reaches m=1m = 1m=1, and a single example is not representative. The class of §29.4 has labels Option of the subtype of finite-or-cofinite sets, with the discrete σ-algebra, and the two ERMs are predicates fixing the output on all-∗\ast∗ samples; Claim 29.9(1) is stated for countable XXX with measurable singletons and Claim 29.9(2) for finite XXX of size at least 222, with the proof's own distribution, h∅h_\emptyseth∅​ as target, and every ϵ∈(0,1/2)\epsilon \in (0, 1/2)ϵ∈(0,1/2) in place of the book's unspecified constant aaa.

Not stated: Corollary 29.8 (its lower bound (k−1)(n−1)(k-1)(n-1)(k−1)(n−1) is cited, not proved), Conjecture 29.10, the exercises.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 29. doi:10.1017/CBO9781107298019
  • B. K. Natarajan, On learning sets and functions, Machine Learning 4, 1989. doi:10.1007/BF00114804
  • S. Ben-David, N. Cesa-Bianchi, D. Haussler, P. M. Long, Characterizations of learnability for classes of {0, …, n}-valued functions, Journal of Computer and System Sciences 50(1), 1995. doi:10.1006/jcss.1995.1008
  • D. Haussler, P. M. Long, A generalization of Sauer's lemma, Journal of Combinatorial Theory A 71(2), 1995. doi:10.1016/0097-3165(95)90001-2
  • A. Daniely, S. Sabato, S. Ben-David, S. Shalev-Shwartz, Multiclass learnability and the ERM principle, COLT 2011; Journal of Machine Learning Research 16, 2015.
  • A. Daniely, S. Sabato, S. Shalev-Shwartz, Multiclass learning approaches: a theoretical comparison with implications, NIPS 2012.
15 thms2 active usersReviewed
🏆Completed
CombinatoricsProbability·Captain: naimengye

Understanding Machine Learning XXII: Proof of the Fundamental TheoremTextbook

Motivation

Chapter 6 stated the fundamental theorem of statistical learning: a binary class is learnable if and only if its VC dimension is finite, with sample complexity Θ((d+ln⁡(1/δ))/ϵ2)\Theta((d + \ln(1/\delta))/\epsilon^2)Θ((d+ln(1/δ))/ϵ2) in the agnostic case and Θ((dln⁡(1/ϵ)+ln⁡(1/δ))/ϵ)\Theta((d\ln(1/\epsilon) + \ln(1/\delta))/\epsilon)Θ((dln(1/ϵ)+ln(1/δ))/ϵ) in the realizable case. Chapter 28 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), proves it. The agnostic upper bound is obtained from the Rademacher machinery of Chapter 26 with Sauer's lemma and Massart's lemma, up to a log⁡(d/ϵ)\log(d/\epsilon)log(d/ϵ) factor that only chaining removes (28.1). The agnostic lower bound comes in two parts: a two-point construction giving m≥0.5log⁡(1/(4δ))/ϵ2m \ge 0.5\log(1/(4\delta))/\epsilon^2m≥0.5log(1/(4δ))/ϵ2, and a ddd-point construction giving m≥d/(512ϵ2)m \ge d/(512\epsilon^2)m≥d/(512ϵ2) at confidence 1/81/81/8, whose heart is Lemma 28.1, the optimality of the Maximum-Likelihood rule against the family of noisy distributions DbD_bDb​. The realizable upper bound is proved through ϵ\epsilonϵ-nets: with m≥8ϵ(2dlog⁡(16e/ϵ)+log⁡(2/δ))m \ge \frac8\epsilon(2d\log(16e/\epsilon) + \log(2/\delta))m≥ϵ8​(2dlog(16e/ϵ)+log(2/δ)) examples a random sample hits every set of measure at least ϵ\epsilonϵ in the class (Theorem 28.3), so any hypothesis consistent with the sample has error below ϵ\epsilonϵ. Mission IV states these bounds with unnamed constants; this mission gives the chapter's explicit ones.

Setting

HHH is a class of functions X→{0,1}X \to \{0,1\}X→{0,1} with the 0–1 loss and VCdim⁡(H)=d\operatorname{VCdim}(H) = dVCdim(H)=d. For the upper bound, A={(1[h(xi)≠yi])i:h∈H}A = \{(\mathbb{1}[h(x_i) \ne y_i])_i : h \in H\}A={(1[h(xi​)=yi​])i​:h∈H} is the loss set of a sample and R(A)R(A)R(A) its Rademacher complexity. For the lower bounds, C={c1,…,cd}C = \{c_1, \dots, c_d\}C={c1​,…,cd​} is a set shattered by HHH and, for b∈{±1}db \in \{\pm1\}^db∈{±1}d and ρ∈(0,1)\rho \in (0,1)ρ∈(0,1), DbD_bDb​ draws cic_ici​ uniformly and labels it bib_ibi​ with probability (1+ρ)/2(1+\rho)/2(1+ρ)/2; for d=1d = 1d=1 these are the distributions D±D_\pmD±​ of §28.2.1. The Maximum-Likelihood rule AMLA_{ML}AML​ predicts at each cic_ici​ the majority of the labels seen at cic_ici​. An ϵ\epsilonϵ-net for HHH with respect to DDD is a sample meeting every h∈Hh \in Hh∈H with D(h)≥ϵD(h) \ge \epsilonD(h)≥ϵ (Definition 28.2).

Formalization targets

Goal: Theorem 28.3

Let VCdim⁡(H)=d\operatorname{VCdim}(H) = dVCdim(H)=d, ϵ∈(0,1)\epsilon \in (0,1)ϵ∈(0,1), δ∈(0,1/4)\delta \in (0, 1/4)δ∈(0,1/4) and m≥8ϵ(2dlog⁡16eϵ+log⁡2δ)m \ge \frac8\epsilon\big(2d\log\frac{16e}{\epsilon} + \log\frac2\delta\big)m≥ϵ8​(2dlogϵ16e​+logδ2​). Then with probability at least 1−δ1 - \delta1−δ over S∼DmS \sim D^mS∼Dm, SSS is an ϵ\epsilonϵ-net for HHH.

Milestones

The two-sided deviation bound of §28.1 (∣LD(h)−LS(h)∣≤2(8dlog⁡(em/d)+2log⁡(4/δ))/m|L_D(h) - L_S(h)| \le 2\sqrt{(8d\log(em/d) + 2\log(4/\delta))/m}∣LD​(h)−LS​(h)∣≤2(8dlog(em/d)+2log(4/δ))/m​ uniformly over HHH); the lower bound m(ϵ,δ)≥0.5log⁡(1/(4δ))/ϵ2m(\epsilon,\delta) \ge 0.5\log(1/(4\delta))/\epsilon^2m(ϵ,δ)≥0.5log(1/(4δ))/ϵ2 of §28.2.1; Lemma 28.1; the lower bound m(ϵ,1/8)≥d/(512ϵ2)m(\epsilon, 1/8) \ge d/(512\epsilon^2)m(ϵ,1/8)≥d/(512ϵ2) of §28.2.2; the realizable upper bound of §28.3 (ERM has error at most ϵ\epsilonϵ with probability 1−δ1 - \delta1−δ for the sample size of Theorem 28.3). Further items: the Rademacher bound R(A)≤2dlog⁡(em/d)/mR(A) \le \sqrt{2d\log(em/d)/m}R(A)≤2dlog(em/d)/m​, the explicit uniform-convergence sample complexity of §28.1, and the expectation lower bound ρ/4\rho/4ρ/4 of §28.2.2.

Significance

These are the theorems that make the VC dimension the right measure of learnability, with constants. The upper bounds show what the abstract machinery of Missions II, IV, XX buys when instantiated: Sauer plus Massart plus Theorem 26.5 gives the agnostic rate, and the double-sample symmetrization plus Sauer gives the realizable rate, sharper by a factor 1/ϵ1/\epsilon1/ϵ because ϵ\epsilonϵ-nets need only one-sided control. The lower bounds are the No-Free-Lunch argument refined to quantify ϵ\epsilonϵ and δ\deltaδ: the two-point distribution shows that confidence costs log⁡(1/δ)/ϵ2\log(1/\delta)/\epsilon^2log(1/δ)/ϵ2, and the ddd-point family with Lemma 28.1 shows that the dimension costs d/ϵ2d/\epsilon^2d/ϵ2, through the exact optimality of majority voting and a binomial anti-concentration bound. Theorem 28.3 is also the basic ϵ\epsilonϵ-net theorem of Haussler and Welzl, a result of independent importance in computational geometry.

Difficulty

The Rademacher bound is Sauer's lemma (Mission IV) plus Massart's lemma (Mission XX) with ∥a−aˉ∥≤m\|a - \bar a\| \le \sqrt m∥a−aˉ∥≤m​; the deviation bound is Theorem 26.5 applied to ℓ\ellℓ and −ℓ-\ell−ℓ with a union bound; the explicit sample complexity is Lemma A.2, x≥4alog⁡(2a)+2b⇒x≥alog⁡x+bx \ge 4a\log(2a) + 2b \Rightarrow x \ge a\log x + bx≥4alog(2a)+2b⇒x≥alogx+b, which a formal proof must establish (the tangent inequality for log⁡\loglog at 2a2a2a). The two-point lower bound requires the binomial lower-tail estimate of Lemma B.11 and the algebra 12(1−1−4δ)≥δ\frac12(1 - \sqrt{1 - \sqrt{4\delta}}) \ge \delta21​(1−1−4δ​​)≥δ, valid for δ<1/4\delta < 1/4δ<1/4, the only nonvacuous range. Lemma 28.1 is a conditioning argument: fixing the instance indices and the labels off cic_ici​, the contribution of cic_ici​ is minimized by predicting the more likely bib_ibi​ given the labels at cic_ici​, which is the majority; the formal proof must decompose the product measure DbmD_b^mDbm​ over the positions rrr with xr=cix_r = c_ixr​=ci​. The expectation bound ρ/4\rho/4ρ/4 then needs Lemma B.11 again, 1−e−a≤a1 - e^{-a} \le a1−e−a≤a, Jensen for ⋅\sqrt{\cdot}⋅​ and E[ni]=m/d\mathbb{E}[n_i] = m/dE[ni​]=m/d, and the probability bound 1/81/81/8 follows by Mission III's reverse Markov inequality with ρ=8ϵ\rho = 8\epsilonρ=8ϵ. Theorem 28.3 is the double-sample argument: Claim 1 (P[S∈B]≤2P[(S,T)∈B′]P[S \in B] \le 2P[(S,T) \in B']P[S∈B]≤2P[(S,T)∈B′], via a Chernoff bound that only needs mϵ≥2log⁡2m\epsilon \ge 2\log 2mϵ≥2log2), Claim 2 (symmetrization by a random half, P[(S,T)∈B′]≤e−ϵm/4τH(2m)P[(S,T) \in B'] \le e^{-\epsilon m/4}\tau_H(2m)P[(S,T)∈B′]≤e−ϵm/4τH​(2m)), Sauer's lemma, and Lemma A.2 once more. The realizable upper bound applies Theorem 28.3 to the error sets {x:h(x)≠f(x)}\{x : h(x) \ne f(x)\}{x:h(x)=f(x)}, a class of the same VC dimension.

Formalization scope

All objects are those of the earlier missions: risks, samples and learners from Mission I, vcDim and the countable-approximation property PointwiseSeparable from Mission IV (the measurability device for suprema over HHH, used wherever a symmetrization or Rademacher argument is invoked), condLaw from Mission XIV for the distributions DbD_bDb​, and rademacher, evalSet, lossClass from Mission XX. Probability statements bound the outer measure of the failure event under iidLaw. The Rademacher and deviation items require m>d+1m > d + 1m>d+1, the range in which Mission IV states Sauer's lemma in the form (em/d)d(em/d)^d(em/d)d; the explicit sample complexity of §28.1 implies this range, since its first term 432dlog⁡(64d/ϵ2)/ϵ2432d\log(64d/\epsilon^2)/\epsilon^2432dlog(64d/ϵ2)/ϵ2 dominates the possibly negative 8dlog⁡(e/d)8d\log(e/d)8dlog(e/d), and Lemma A.2 holds for any real bbb, so the book's constants are used verbatim. The lower bounds take a shattered set as an injective c:Fin d→Xc : \mathrm{Fin}\ d \to Xc:Fin d→X with the shattering property written out, use DbD_bDb​ as condLaw of the uniform law on CCC, and state the excess risk against min⁡h∈HLDb(h)\min_{h \in H}L_{D_b}(h)minh∈H​LDb​​(h) as ∃h∈H\exists h \in H∃h∈H with L(h)+ϵ≤L(A(S))L(h) + \epsilon \le L(A(S))L(h)+ϵ≤L(A(S)), or as a real infimum over HHH in the expectation item; no measurability of the learner is needed because DbmD_b^mDbm​ is atomic. Lemma 28.1 compares the sums over bbb of the expected risks, the common term min⁡hLDb\min_h L_{D_b}minh​LDb​​ cancelling, for every majority rule with arbitrary tie-breaking. Theorem 28.3 and the realizable bound are stated for δ∈(0,1/4)\delta \in (0, 1/4)δ∈(0,1/4), the theorem's own range; the realizable bound is the inner clause of Mission I's IsPACWith on that range rather than a sample-complexity function, since the theorem does not cover δ≥1/4\delta \ge 1/4δ≥1/4 with its formula.

Not stated: the realizable lower bound (an exercise), the remark that chaining removes the logarithm in (28.1), and the intermediate claims of the proof of Theorem 28.3 as separate items.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 28. doi:10.1017/CBO9781107298019
  • V. N. Vapnik, A. Ya. Chervonenkis, On the uniform convergence of relative frequencies of events to their probabilities, Theory of Probability and its Applications 16(2), 1971. doi:10.1137/1116025
  • A. Blumer, A. Ehrenfeucht, D. Haussler, M. K. Warmuth, Learnability and the Vapnik-Chervonenkis dimension, Journal of the ACM 36(4), 1989. doi:10.1145/76359.76371
  • D. Haussler, E. Welzl, ε-nets and simplex range queries, Discrete and Computational Geometry 2, 1987. doi:10.1007/BF02187876
  • M. Anthony, P. L. Bartlett, Neural Network Learning: Theoretical Foundations, Cambridge University Press, 1999. doi:10.1017/CBO9780511624216
11 thms2 active usersReviewed
🏆Completed
ProbabilityStatistics·Captain: naimengye

Understanding Machine Learning XX: Rademacher ComplexitiesTextbook

Motivation

Chapter 4 showed that uniform convergence suffices for learnability; Chapter 26 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), measures its rate. The representativeness of a sample, sup⁡h∈H(LD(h)−LS(h))\sup_{h \in H}(L_D(h) - L_S(h))suph∈H​(LD​(h)−LS​(h)), is the quantity that controls the excess risk of ERM, and the Rademacher complexity R(F∘S)=1mEσsup⁡f∈F∑iσif(zi)R(F \circ S) = \frac1m\mathbb{E}_\sigma\sup_{f \in F}\sum_i\sigma_i f(z_i)R(F∘S)=m1​Eσ​supf∈F​∑i​σi​f(zi​) estimates it from the sample itself: the symmetrization argument gives ERep⁡≤2 ER\mathbb{E}\operatorname{Rep} \le 2\,\mathbb{E}RERep≤2ER (Lemma 26.2), and McDiarmid's bounded-differences inequality turns expectations into high-probability statements, yielding the generalization bounds of Theorem 26.5, including the data-dependent ones in which the complexity is computed on the training set. A small calculus of Rademacher complexities follows, affine images, convex hulls, Massart's lemma for finite sets and the contraction lemma for Lipschitz compositions, and it is applied to linear classes with ℓ2\ell_2ℓ2​ and ℓ1\ell_1ℓ1​ constraints. The chapter's payoff is dimension-free generalization bounds for linear predictors with Lipschitz losses (Theorem 26.12), for hard-SVM (Theorems 26.13–26.14), and for predictors with low ℓ1\ell_1ℓ1​ norm (Theorem 26.15).

Setting

For a loss class F=ℓ∘HF = \ell \circ HF=ℓ∘H and a sample S=(z1,…,zm)S = (z_1, \dots, z_m)S=(z1​,…,zm​), Rep⁡D(F,S)=sup⁡f∈F(LD(f)−LS(f))\operatorname{Rep}_D(F, S) = \sup_{f \in F}(L_D(f) - L_S(f))RepD​(F,S)=supf∈F​(LD​(f)−LS​(f)) (26.1), F∘S={(f(z1),…,f(zm)):f∈F}F \circ S = \{(f(z_1), \dots, f(z_m)) : f \in F\}F∘S={(f(z1​),…,f(zm​)):f∈F}, and for A⊆RmA \subseteq \mathbb{R}^mA⊆Rm, R(A)=1mEσ[sup⁡a∈A∑iσiai]R(A) = \frac1m\mathbb{E}_\sigma[\sup_{a \in A}\sum_i\sigma_i a_i]R(A)=m1​Eσ​[supa∈A​∑i​σi​ai​] with σ\sigmaσ uniform on {±1}m\{\pm1\}^m{±1}m (26.5). The linear classes are H2∘S={(⟨w,xi⟩)i:∥w∥2≤1}H_2 \circ S = \{(\langle w, x_i\rangle)_i : \|w\|_2 \le 1\}H2​∘S={(⟨w,xi​⟩)i​:∥w∥2​≤1} in a Hilbert space and H1∘SH_1 \circ SH1​∘S with ∥w∥1≤1\|w\|_1 \le 1∥w∥1​≤1 in Rn\mathbb{R}^nRn (26.14). Losses of the form ℓ(w,(x,y))=φ(⟨w,x⟩,y)\ell(w, (x, y)) = \varphi(\langle w, x\rangle, y)ℓ(w,(x,y))=φ(⟨w,x⟩,y) with a↦φ(a,y)a \mapsto \varphi(a, y)a↦φ(a,y) ρ\rhoρ-Lipschitz (26.18) cover the hinge and absolute losses.

Formalization targets

Goal: Theorem 26.5

Assume ∣ℓ(h,z)∣≤c|\ell(h, z)| \le c∣ℓ(h,z)∣≤c for all zzz and h∈Hh \in Hh∈H. Then, each with probability at least 1−δ1 - \delta1−δ over S∼DmS \sim D^mS∼Dm:

  1. for all h∈Hh \in Hh∈H, LD(h)−LS(h)≤2 ES′∼DmR(ℓ∘H∘S′)+c2ln⁡(2/δ)/mL_D(h) - L_S(h) \le 2\,\mathbb{E}_{S' \sim D^m}R(\ell \circ H \circ S') + c\sqrt{2\ln(2/\delta)/m}LD​(h)−LS​(h)≤2ES′∼Dm​R(ℓ∘H∘S′)+c2ln(2/δ)/m​;
  2. for all h∈Hh \in Hh∈H, LD(h)−LS(h)≤2R(ℓ∘H∘S)+4c2ln⁡(4/δ)/mL_D(h) - L_S(h) \le 2R(\ell \circ H \circ S) + 4c\sqrt{2\ln(4/\delta)/m}LD​(h)−LS​(h)≤2R(ℓ∘H∘S)+4c2ln(4/δ)/m​;
  3. for any h⋆∈Hh^\star \in Hh⋆∈H, LD(ERMH(S))−LD(h⋆)≤2R(ℓ∘H∘S)+5c2ln⁡(8/δ)/mL_D(\mathrm{ERM}_H(S)) - L_D(h^\star) \le 2R(\ell \circ H \circ S) + 5c\sqrt{2\ln(8/\delta)/m}LD​(ERMH​(S))−LD​(h⋆)≤2R(ℓ∘H∘S)+5c2ln(8/δ)/m​.

Milestones

Lemma 26.2 (symmetrization); Lemma 26.8 (Massart); Lemma 26.9 (contraction); Theorem 26.12 (linear predictors with ℓ2\ell_2ℓ2​ constraints); Theorem 26.13 (hard-SVM). Further items: Theorem 26.3, Lemma 26.4 (McDiarmid), Lemmas 26.6, 26.7, 26.10, 26.11, Theorem 26.14 and Theorem 26.15.

Significance

Rademacher complexity is the modern language of uniform convergence: it is data-dependent, it is dimension-free for linear classes, and it composes with Lipschitz losses, which is why the SVM bounds of this chapter do not depend on the dimension of www and apply verbatim to kernel methods (Remark 26.2). Theorem 26.5 is the template every such bound follows, symmetrization plus McDiarmid, and the two data-dependent parts are the first bounds in the book that use the training set both to learn and to certify. Massart's lemma and the contraction lemma are the two tools that make the calculus work, the first converting finiteness into a logarithmic dependence, the second removing the loss function from the picture. Theorem 26.13 finally justifies the margin-based sample complexity R2∥w⋆∥2/ϵ2R^2\|w^\star\|^2/\epsilon^2R2∥w⋆∥2/ϵ2 of hard-SVM, and Theorem 26.14 gives a bound computable from the output alone.

Difficulty

Lemma 26.2 is the symmetrization argument: a ghost sample, the exchange of zjz_jzj​ and zj′z'_jzj′​ (26.7), the introduction of one Rademacher sign at a time (26.8)–(26.9), and the split of the supremum. Formally it needs Fubini over the product of 2m2m2m copies of DDD and the sign average, and the measurability of the suprema, which the statements assume. McDiarmid's inequality is a martingale argument with Hoeffding's lemma at each step; it is the substantial probabilistic input, and Theorem 26.5 combines it with Lemma 26.2, a union bound and Hoeffding's inequality along the decomposition (26.10). Lemma 26.6 is the symmetry σ↦−σ\sigma \mapsto -\sigmaσ↦−σ; Lemma 26.7 is the fact that a linear functional on the simplex is maximized at a vertex; Massart's lemma is the exponential-moment bound Eeσa≤ea2/2\mathbb{E}e^{\sigma a} \le e^{a^2/2}Eeσa≤ea2/2 with Jensen and an optimized scaling; the contraction lemma is Kakade and Tewari's coordinate-by-coordinate argument (26.12)–(26.13), which in a formal proof must be run as an induction over the coordinates. Lemmas 26.10 and 26.11 are Cauchy–Schwarz and Hölder followed by Jensen, respectively Massart on the 2n2n2n coordinate vectors. Theorem 26.12 chains contraction, Lemma 26.10 and Theorem 26.5 on the almost-sure event ∥x∥≤R\|x\| \le R∥x∥≤R; Theorem 26.13 specializes it to the ramp loss with B=∥w⋆∥B = \|w^\star\|B=∥w⋆∥, where the hard-SVM output has zero empirical ramp loss; Theorem 26.14 is a union bound over the nested classes ∥w∥≤2i\|w\| \le 2^i∥w∥≤2i with δi=δ/(2i2)\delta_i = \delta/(2i^2)δi​=δ/(2i2); Theorem 26.15 repeats Theorem 26.12 with Lemma 26.11.

Formalization scope

The Rademacher complexity is a finite average over the 2m2^m2m sign vectors, so no measure on {±1}m\{\pm1\}^m{±1}m is needed, and the supremum over AAA is the real supremum over the subtype AAA; the theorems assume AAA nonempty and bounded, which every evaluation set of a bounded loss class satisfies. Risks are Mission I's risk and empRisk, samples are Fin m-indexed under iidLaw, and probability statements bound the outer measure of the failure event. Expectations of suprema over uncountable classes are Bochner integrals, so Lemma 26.2, Theorem 26.3 and Theorem 26.5 carry explicit hypotheses that S↦Rep⁡D(F,S)S \mapsto \operatorname{Rep}_D(F, S)S↦RepD​(F,S) and S↦R(F∘S)S \mapsto R(F \circ S)S↦R(F∘S) are measurable, the book's Remark 3.1 made visible; for the linear classes of §26.3–§26.4 these hold automatically when the Hilbert space is separable (the supremum over the ball is a supremum over a countable dense subset), which is why Theorems 26.12–26.14 assume SecondCountableTopology. McDiarmid's inequality is stated for a measurable function on a product of arbitrary probability measures. Theorem 26.13's error is P[y⟨wS,x⟩≤0]P[y\langle w_S, x\rangle \le 0]P[y⟨wS​,x⟩≤0], which dominates P[y≠sign⁡⟨wS,x⟩]P[y \ne \operatorname{sign}\langle w_S, x\rangle]P[y=sign⟨wS​,x⟩] whatever sign⁡(0)\operatorname{sign}(0)sign(0) is, and the hard-SVM learner is any map returning a minimum-norm margin-1 separator on separable samples; measurability of the learner is not needed because the bound is uniform over the ball. Theorem 26.14 is given with the constants of its proof, 4(ln⁡(4log⁡2∥wS∥)+ln⁡(1/δ))/m\sqrt{4(\ln(4\log_2\|w_S\|) + \ln(1/\delta))/m}4(ln(4log2​∥wS​∥)+ln(1/δ))/m​ rather than the printed ln⁡(4log⁡2∥wS∥/δ)/m\sqrt{\ln(4\log_2\|w_S\|/\delta)/m}ln(4log2​∥wS​∥/δ)/m​, and for ∥wS∥≥2\|w_S\| \ge 2∥wS​∥≥2, where i=⌈log⁡2∥wS∥⌉i = \lceil\log_2\|w_S\|\rceili=⌈log2​∥wS​∥⌉ satisfies 1≤i≤2log⁡2∥wS∥1 \le i \le 2\log_2\|w_S\|1≤i≤2log2​∥wS​∥ as the proof requires; the item text records this. Norms on Rn\mathbb{R}^nRn as Fin n → ℝ are sup norms (Lemma 26.11, Theorem 26.15), Euclidean norms are written out (Massart), and inner product spaces carry the Euclidean norm.

Not stated: Definition 26.1 (already Mission II's IsRepresentative), the validation heuristic (26.2)–(26.3), Remark 26.1 (the improved rate under separability, no proof), Remark 26.2.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 26. doi:10.1017/CBO9781107298019
  • P. L. Bartlett, S. Mendelson, Rademacher and Gaussian complexities: risk bounds and structural results, Journal of Machine Learning Research 3, 2002.
  • V. Koltchinskii, D. Panchenko, Rademacher processes and bounding the risk of function learning, in High Dimensional Probability II, Birkhäuser, 2000. doi:10.1007/978-1-4612-1358-1_29
  • C. McDiarmid, On the method of bounded differences, in Surveys in Combinatorics, Cambridge University Press, 1989. doi:10.1017/CBO9781107359949.008
  • S. M. Kakade, K. Sridharan, A. Tewari, On the complexity of linear prediction: risk bounds, margin bounds, and regularization, NIPS 2008.
  • S. Boucheron, O. Bousquet, G. Lugosi, Theory of classification: a survey of some recent advances, ESAIM: Probability and Statistics 9, 2005. doi:10.1051/ps:2005018
10 thms2 active usersReviewed
🏆Completed
CombinatoricsOptimization·Captain: naimengye

Understanding Machine Learning XVI: Online LearningTextbook

Motivation

In PAC learning the learner receives a batch of examples, learns, and only then predicts. Online learning has no such separation: on each round the learner receives an instance, predicts its label, and then sees the true label, and the goal is to make few mistakes over the whole sequence, with no statistical assumption whatsoever on how the sequence is generated, adversarially if need be. Chapter 21 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), develops this model along the same lines as the PAC theory. In the realizable case, mistake bounds replace sample complexity, and a combinatorial dimension due to Littlestone, Ldim⁡(H)\operatorname{Ldim}(H)Ldim(H), characterizes the best achievable bound exactly (Lemmas 21.6 and 21.7), playing the role the VC dimension plays for PAC learning, with VCdim⁡(H)≤Ldim⁡(H)\operatorname{VCdim}(H) \le \operatorname{Ldim}(H)VCdim(H)≤Ldim(H) and an arbitrarily large gap (Theorem 21.9). In the unrealizable case regret replaces excess risk; deterministic learners can be forced to regret T/2T/2T/2 (Cover), but randomized predictions restore sublinear regret through the Weighted-Majority algorithm of Littlestone, Warmuth and Vovk (Theorem 21.11). The chapter closes with online convex optimization, where Online Gradient Descent (Zinkevich) attains regret O(T)O(\sqrt T)O(T​) (Theorem 21.15), and with the online Perceptron, whose mistake bound follows from a round-specific surrogate loss (Theorem 21.16).

Setting

An online algorithm is a deterministic map from the history of past examples and the current instance to a prediction. For a sequence SSS labeled by some h⋆∈Hh^\star \in Hh⋆∈H, MA(S)M_A(S)MA​(S) is the number of mistakes and MA(H)M_A(H)MA​(H) the supremum over all such sequences (Definition 21.1). The Consistent algorithm predicts with any hypothesis of the version space VtV_tVt​ (the hypotheses consistent with the past), Halving with its majority label, and SOA with the label rrr for which {h∈Vt:h(xt)=r}\{h \in V_t : h(x_t) = r\}{h∈Vt​:h(xt​)=r} has the larger Littlestone dimension, ties to 111. An HHH-shattered tree of depth ddd assigns an instance to every node of a complete binary tree so that every labeling (y1,…,yd)(y_1, \dots, y_d)(y1​,…,yd​) is realized by some h∈Hh \in Hh∈H along the path it determines; Ldim⁡(H)\operatorname{Ldim}(H)Ldim(H) is the maximal such depth (Definitions 21.4–21.5). In the unrealizable case predictions are pt∈[0,1]p_t \in [0,1]pt​∈[0,1], the loss is ∣pt−yt∣|p_t - y_t|∣pt​−yt​∣, and the regret against hhh is ∑t∣pt−yt∣−∑t∣h(xt)−yt∣\sum_t |p_t - y_t| - \sum_t |h(x_t) - y_t|∑t​∣pt​−yt​∣−∑t​∣h(xt​)−yt​∣ (21.1). Weighted-Majority maintains wi(t)∝exp⁡(−η∑s<tvs,i)w^{(t)}_i \propto \exp(-\eta\sum_{s<t} v_{s,i})wi(t)​∝exp(−η∑s<t​vs,i​) over ddd experts with costs vt∈[0,1]dv_t \in [0,1]^dvt​∈[0,1]d and pays ⟨w(t),vt⟩\langle w^{(t)}, v_t\rangle⟨w(t),vt​⟩. Online Gradient Descent on a closed convex HHH predicts w(t)w^{(t)}w(t), receives a convex ftf_tft​, takes a subgradient vtv_tvt​ at w(t)w^{(t)}w(t) and projects w(t)−ηvtw^{(t)} - \eta v_tw(t)−ηvt​ back onto HHH; the online Perceptron is the special case w(t+1)=w(t)+ytxtw^{(t+1)} = w^{(t)} + y_t x_tw(t+1)=w(t)+yt​xt​ on rounds with yt⟨w(t),xt⟩≤0y_t\langle w^{(t)}, x_t\rangle \le 0yt​⟨w(t),xt​⟩≤0.

Formalization targets

Goal: Theorem 21.11

For d≥1d \ge 1d≥1 experts, cost vectors vt∈[0,1]dv_t \in [0,1]^dvt​∈[0,1]d, T>2log⁡dT > 2\log dT>2logd and η=2log⁡(d)/T\eta = \sqrt{2\log(d)/T}η=2log(d)/T​,

∑t=1T⟨w(t),vt⟩−min⁡i∈[d]∑t=1Tvt,i≤2log⁡(d) T.\sum_{t=1}^T \langle w^{(t)}, v_t\rangle - \min_{i \in [d]}\sum_{t=1}^T v_{t,i} \le \sqrt{2\log(d)\,T}.t=1∑T​⟨w(t),vt​⟩−i∈[d]min​t=1∑T​vt,i​≤2log(d)T​.

Milestones

Theorem 21.3 (Halving makes at most log⁡2∣H∣\log_2|H|log2​∣H∣ mistakes); Lemma 21.6 (MA(H)≥Ldim⁡(H)M_A(H) \ge \operatorname{Ldim}(H)MA​(H)≥Ldim(H) for every AAA); Lemma 21.7 (MSOA(H)≤Ldim⁡(H)M_{\mathrm{SOA}}(H) \le \operatorname{Ldim}(H)MSOA​(H)≤Ldim(H)); Theorem 21.15 (the three regret bounds of Online Gradient Descent); Theorem 21.16 (the online Perceptron bound ∣M∣≤∑tft(w⋆)+R∥w⋆∥∑tft(w⋆)+R2∥w⋆∥2|M| \le \sum_t f_t(w^\star) + R\|w^\star\|\sqrt{\sum_t f_t(w^\star)} + R^2\|w^\star\|^2∣M∣≤∑t​ft​(w⋆)+R∥w⋆∥∑t​ft​(w⋆)​+R2∥w⋆∥2 and its separable case). Further items: Corollary 21.2, Theorem 21.9, Example 21.4, Cover's impossibility, Corollary 21.12 and the Ldim⁡\operatorname{Ldim}Ldim half of Theorem 21.10.

Significance

Corollary 21.8 is one of the cleanest characterizations in learning theory: the Littlestone dimension is exactly the optimal mistake bound, with SOA attaining it and Lemma 21.6 forbidding anything better. Theorem 21.11 is the engine of the unrealizable case and of a large part of online learning: the multiplicative-weights analysis with the potential log⁡Zt\log Z_tlogZt​ gives regret 2log⁡(d)T\sqrt{2\log(d)T}2log(d)T​ against the best of ddd experts, and with the experts of pp. 298–299 it yields Theorem 21.10, regret 2Ldim⁡(H)log⁡(eT) T\sqrt{2\operatorname{Ldim}(H)\log(eT)\,T}2Ldim(H)log(eT)T​ for any class of finite Littlestone dimension. Theorem 21.15 is the online counterpart of the SGD analysis of Chapter 14, and the derivation of Theorem 21.16 from it shows how a surrogate loss chosen per round turns a regret bound into a mistake bound, the Perceptron bound of Chapter 9 falling out as the separable case. On the platform, these items give the first online-learning model, reusing Mission X's subgradients and projections.

Difficulty

Corollary 21.2 and Theorem 21.3 are counting arguments on the version space, but formally they require tracking the version space along the history and the fact that a mistake by Halving halves it. Lemma 21.6 is the adversary argument: given a shattered tree, feed the instance at the current node and the label opposite to the prediction; the resulting sequence is labeled by some h∈Hh \in Hh∈H by the shattering property, and the algorithm errs on every round. Lemma 21.7 needs the combinatorial core of the chapter: if both restricted version spaces had Littlestone dimension equal to Ldim⁡(Vt)\operatorname{Ldim}(V_t)Ldim(Vt​), their shattered trees could be glued under a new root to a deeper tree. Theorem 21.9 builds a shattered tree with all nodes at depth iii equal to xix_ixi​; Example 21.4 builds the dyadic tree. Theorem 21.11's proof is the book's: e−a≤1−a+a2/2e^{-a} \le 1 - a + a^2/2e−a≤1−a+a2/2 for a≥0a \ge 0a≥0, log⁡(1−b)≤−b\log(1 - b) \le -blog(1−b)≤−b, the telescoping potential log⁡(Zt+1/Zt)\log(Z_{t+1}/Z_t)log(Zt+1​/Zt​), the lower bound log⁡ZT+1≥−ηmin⁡i∑tvt,i\log Z_{T+1} \ge -\eta\min_i\sum_t v_{t,i}logZT+1​≥−ηmini​∑t​vt,i​, and the choice of η\etaη; the hypothesis T>2log⁡dT > 2\log dT>2logd makes η<1\eta < 1η<1. Corollary 21.12 is the reduction of hypotheses to experts, and Theorem 21.10 is the expert construction with the counting bound (21.4) ∑L≤Ldim⁡(TL)≤(eT/Ldim⁡)Ldim⁡\sum_{L \le \operatorname{Ldim}} \binom{T}{L} \le (eT/\operatorname{Ldim})^{\operatorname{Ldim}}∑L≤Ldim​(LT​)≤(eT/Ldim)Ldim (Lemma A.5) and Lemma 21.13, which simulates SOA on the labels of hhh; small horizons are covered by the trivial bound regret≤T\text{regret} \le Tregret≤T. Theorem 21.15 is the telescoping argument of Lemma 14.1 with the projection lemma of Chapter 14 at every step; Theorem 21.16 applies it to ft=1[t∈M][1−yt⟨w,xt⟩]+f_t = \mathbb{1}[t \in M][1 - y_t\langle w, x_t\rangle]_+ft​=1[t∈M][1−yt​⟨w,xt​⟩]+​ with η=∥w⋆∥/(R∣M∣)\eta = \|w^\star\|/(R\sqrt{|M|})η=∥w⋆∥/(R∣M∣​) and solves the quadratic inequality (21.6).

Formalization scope

Online algorithms are deterministic functions List (X × Y) → X → Y; a sequence is Fin T-indexed and the history at round ttt is its first ttt examples. Mistake bounds and the Littlestone dimension are suprema in ℕ∞, so mistakeBound, ldim and their comparisons are meaningful when infinite. Shattered trees are indexed by paths rather than by the book's node numbers it=2t−1+∑j<tyj2t−1−ji_t = 2^{t-1} + \sum_{j<t} y_j 2^{t-1-j}it​=2t−1+∑j<t​yj​2t−1−j, whose binary expansion is exactly the path; the two descriptions are the same tree. Halving and SOA break ties towards 111 as in the book; Consistent is stated as a property of an algorithm. The unrealizable case uses real-valued predictions with the loss ∣pt−yt∣|p_t - y_t|∣pt​−yt​∣ as the book does, and the theorems of that section assert the existence of an algorithm for each horizon TTT, because Weighted-Majority takes TTT as input. Weighted-Majority's distribution is written in unrolled form, wi(t)∝exp⁡(−η∑s<tvs,i)w^{(t)}_i \propto \exp(-\eta\sum_{s<t}v_{s,i})wi(t)​∝exp(−η∑s<t​vs,i​), which is the update rule iterated from w~(1)=(1,…,1)\tilde w^{(1)} = (1, \dots, 1)w~(1)=(1,…,1). Theorem 21.10 is stated for classes with Ldim⁡(H)<∞\operatorname{Ldim}(H) < \inftyLdim(H)<∞ and in its Ldim⁡(H)log⁡(eT)\operatorname{Ldim}(H)\log(eT)Ldim(H)log(eT) form, the log⁡∣H∣\log|H|log∣H∣ form being Corollary 21.12; its lower bound, proved in Ben-David, Pál and Shalev-Shwartz (2009), is not stated. Online Gradient Descent is driven by a subgradient selector gt(w)∈∂ft(w)g_t(w) \in \partial f_t(w)gt​(w)∈∂ft​(w) (Mission X's global subgradients), from w(0)=0w^{(0)} = 0w(0)=0, on a closed convex HHH containing the comparator; the Lipschitz parts take LipschitzWith ρ (f t) and T≥1T \ge 1T≥1. The Perceptron's MMM is the set of update rounds yt⟨w(t),xt⟩≤0y_t\langle w^{(t)}, x_t\rangle \le 0yt​⟨w(t),xt​⟩≤0, which contains every prediction mistake whatever sign⁡(0)\operatorname{sign}(0)sign(0) is and is the set the book's derivation actually uses; RRR is any bound on ∥xt∥\|x_t\|∥xt​∥ for t<Tt < Tt<T. Cover's impossibility is stated for deterministic {0,1}\{0,1\}{0,1}-valued algorithms, the setting in which the book states it.

Not stated: the Doubling Trick (Exercise 4), Exercises 1–3 (specific tight examples), the SOA-based Expert algorithm as a separate definition (it is internal to the proof of Theorem 21.10), Lemma 21.13 and Corollary 21.14 as items, and the lower bound of Theorem 21.10.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 21. doi:10.1017/CBO9781107298019
  • N. Littlestone, Learning quickly when irrelevant attributes abound: a new linear-threshold algorithm, Machine Learning 2, 1988. doi:10.1007/BF00116827
  • N. Littlestone, M. K. Warmuth, The weighted majority algorithm, Information and Computation 108(2), 1994. doi:10.1006/inco.1994.1009
  • S. Ben-David, D. Pál, S. Shalev-Shwartz, Agnostic online learning, COLT 2009.
  • M. Zinkevich, Online convex programming and generalized infinitesimal gradient ascent, ICML 2003.
  • N. Cesa-Bianchi, G. Lugosi, Prediction, Learning, and Games, Cambridge University Press, 2006. doi:10.1017/CBO9780511546921
  • S. Shalev-Shwartz, Online learning and online convex optimization, Foundations and Trends in Machine Learning 4(2), 2011. doi:10.1561/2200000018
10 thms2 active usersReviewed
🏆Completed
ProbabilityStatistics·Captain: naimengye

Understanding Machine Learning XIV: Nearest NeighborTextbook

Motivation

Every learning paradigm of the book so far, ERM, SRM, MDL, RLM, is defined by a hypothesis class: the learner searches a predefined set of functions. Nearest Neighbor is the first method that is not. It memorizes the training set and labels a new point by the labels of its closest neighbors, on the assumption that the features are relevant to the labels in a way that makes close-by points likely to share a label. Chapter 19 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019), makes that assumption precise, a Lipschitz conditional probability, and proves a finite-sample guarantee: the expected error of the 1-NN rule on mmm examples is at most twice the Bayes error plus 4cd m−1/(d+1)4c\sqrt d\, m^{-1/(d+1)}4cd​m−1/(d+1) (Theorem 19.3). The classical results of Cover and Hart (1967) and Stone (1977) are asymptotic; the book insists, as it did in §7.4, on a bound that says what a finite sample buys under an explicit prior assumption. The chapter also proves that the exponential dependence on the dimension is not an artifact (Theorem 19.4, the curse of dimensionality) and, in its exercises, extends the analysis to the kkk-NN rule, whose error converges to (1+8/k)(1 + \sqrt{8/k})(1+8/k​) times the Bayes error (Theorem 19.5).

Setting

The instance domain XXX carries a metric ρ\rhoρ; for the analysis X=[0,1]dX = [0,1]^dX=[0,1]d with the Euclidean distance and Y={0,1}Y = \{0,1\}Y={0,1} with the 0–1 loss. For a sample S=(x1,y1),…,(xm,ym)S = (x_1, y_1), \dots, (x_m, y_m)S=(x1​,y1​),…,(xm​,ym​) and a point xxx, let π1(x),…,πm(x)\pi_1(x), \dots, \pi_m(x)π1​(x),…,πm​(x) reorder the sample by distance to xxx. The kkk-NN rule returns the majority label among yπ1(x),…,yπk(x)y_{\pi_1(x)}, \dots, y_{\pi_k(x)}yπ1​(x)​,…,yπk​(x)​; the 1-NN rule is hS(x)=yπ1(x)h_S(x) = y_{\pi_1(x)}hS​(x)=yπ1​(x)​; in general, for φ:(X×Y)k→Y\varphi : (X \times Y)^k \to Yφ:(X×Y)k→Y, the kkk-NN rule with respect to φ\varphiφ is hS(x)=φ((xπ1(x),yπ1(x)),…,(xπk(x),yπk(x)))h_S(x) = \varphi\big((x_{\pi_1(x)}, y_{\pi_1(x)}), \dots, (x_{\pi_k(x)}, y_{\pi_k(x)})\big)hS​(x)=φ((xπ1​(x)​,yπ1​(x)​),…,(xπk​(x)​,yπk​(x)​)) (19.1).

A distribution DDD over X×YX \times YX×Y has marginal DXD_XDX​ and conditional probability η(x)=P[y=1∣x]\eta(x) = P[y = 1 \mid x]η(x)=P[y=1∣x]; the Bayes optimal rule is h⋆(x)=1[η(x)>1/2]h^\star(x) = \mathbb{1}[\eta(x) > 1/2]h⋆(x)=1[η(x)>1/2], and the standing assumption is that η\etaη is ccc-Lipschitz: ∣η(x)−η(x′)∣≤c∥x−x′∥|\eta(x) - \eta(x')| \le c\|x - x'\|∣η(x)−η(x′)∣≤c∥x−x′∥. In the formalization a distribution with conditional probability η\etaη is written condLaw DX η: draw x∼DXx \sim D_Xx∼DX​, then y∼Bernoulli(η(x))y \sim \mathrm{Bernoulli}(\eta(x))y∼Bernoulli(η(x)). Every distribution with a regression function is of this form, so nothing is lost.

Formalization targets

Goal: Theorem 19.3

For X=[0,1]dX = [0,1]^dX=[0,1]d, Y={0,1}Y = \{0,1\}Y={0,1}, a distribution DDD over X×YX \times YX×Y whose conditional probability η\etaη is ccc-Lipschitz, and hSh_ShS​ the result of the 1-NN rule on S∼DmS \sim D^mS∼Dm,

ES∼Dm[LD(hS)]≤2LD(h⋆)+4cd m−1d+1.\mathbb{E}_{S \sim D^m}[L_D(h_S)] \le 2L_D(h^\star) + 4c\sqrt d\, m^{-\frac{1}{d+1}}.ES∼Dm​[LD​(hS​)]≤2LD​(h⋆)+4cd​m−d+11​.

Milestones

Lemma 19.1 (the Lipschitz reduction: ES[LD(hS)]≤2LD(h⋆)+c ES,x∥x−xπ1(x)∥\mathbb{E}_S[L_D(h_S)] \le 2L_D(h^\star) + c\,\mathbb{E}_{S,x}\|x - x_{\pi_1(x)}\|ES​[LD​(hS​)]≤2LD​(h⋆)+cES,x​∥x−xπ1​(x)​∥); Lemma 19.2 (the expected mass of the sets among C1,…,CrC_1, \dots, C_rC1​,…,Cr​ missed by an i.i.d. sample of size mmm is at most r/(me)r/(me)r/(me)); Theorem 19.4 (for integer c≥2c \ge 2c≥2 and every learning rule there is a distribution with ccc-Lipschitz η\etaη and Bayes error 000 on which the rule's expected error is at least 1/41/41/4 whenever 2m≤(c+1)d2m \le (c+1)^d2m≤(c+1)d); Lemma 19.7 (the majority of k≥10k \ge 10k≥10 independent Bernoulli labels errs, against a label drawn from their mean ppp, at most (1+8/k)(1 + \sqrt{8/k})(1+8/k​) times as often as 1[p>1/2]\mathbb{1}[p > 1/2]1[p>1/2]); Theorem 19.5 (the kkk-NN bound ES[LD(hS)]≤(1+8/k)LD(h⋆)+(6cd+k)m−1/(d+1)\mathbb{E}_S[L_D(h_S)] \le (1 + \sqrt{8/k})L_D(h^\star) + (6c\sqrt d + k)m^{-1/(d+1)}ES​[LD​(hS​)]≤(1+8/k​)LD​(h⋆)+(6cd​+k)m−1/(d+1)). Lemma 19.6, the kkk-fold version of Lemma 19.2 with bound 2rk/m2rk/m2rk/m, is a further item.

Significance

Theorem 19.3 is the book's answer to the question it raised in §7.4: consistency results say that the 1-NN error converges to twice the Bayes error, but not how fast, and the rate necessarily depends on the distribution. The Lipschitz constant ccc and the dimension ddd are exactly the prior knowledge the rule relies on, and Theorem 19.4 shows through the No-Free-Lunch theorem that a sample of size exponential in ddd is genuinely required for some distributions in the class. Theorem 19.5 quantifies what larger kkk buys, the factor 222 improving to 1+8/k1 + \sqrt{8/k}1+8/k​, at the price of the additive term growing linearly in kkk. On the platform, this mission introduces the conditional-probability model of a distribution over X×{0,1}X \times \{0,1\}X×{0,1} and the Bayes rule, which Chapters 24 (generative models) and the nonparametric parts of the book use again, and the box-cover argument of Lemma 19.2, a small combinatorial-probability tool of independent use.

Difficulty

Lemma 19.1 is a computation once the expectation over SSS and (x,y)(x, y)(x,y) is decomposed as the book does: sample the unlabeled points first, find the nearest neighbor, then draw the two labels; the identity P[y≠y′]=2η(x)(1−η(x))+(η(x)−η(x′))(2η(x)−1)P[y \ne y'] = 2\eta(x)(1 - \eta(x)) + (\eta(x) - \eta(x'))(2\eta(x) - 1)P[y=y′]=2η(x)(1−η(x))+(η(x)−η(x′))(2η(x)−1) and LD(h⋆)=Exmin⁡{η,1−η}≥Ex η(1−η)L_D(h^\star) = \mathbb{E}_x\min\{\eta, 1 - \eta\} \ge \mathbb{E}_x\,\eta(1 - \eta)LD​(h⋆)=Ex​min{η,1−η}≥Ex​η(1−η) finish it. Formally the work is in the decomposition itself, which is Fubini for condLaw and the product law, and in the measurability of the rule, which the statement assumes. Lemma 19.2 is E[1[Ci∩S=∅]]=(1−P[Ci])m≤e−P[Ci]m\mathbb{E}[\mathbb{1}[C_i \cap S = \emptyset]] = (1 - P[C_i])^m \le e^{-P[C_i]m}E[1[Ci​∩S=∅]]=(1−P[Ci​])m≤e−P[Ci​]m and max⁡aae−ma≤1/(me)\max_a ae^{-ma} \le 1/(me)maxa​ae−ma≤1/(me). Theorem 19.3 covers the cube by boxes of side ε\varepsilonε, applies Lemma 19.2 to the boxes and sets ε=2m−1/(d+1)\varepsilon = 2m^{-1/(d+1)}ε=2m−1/(d+1); a formal proof must handle 1/ε1/\varepsilon1/ε not being an integer (take T=⌈1/ε⌉T = \lceil 1/\varepsilon \rceilT=⌈1/ε⌉ boxes per side, so r≤(2/ε)dr \le (2/\varepsilon)^dr≤(2/ε)d when ε≤1\varepsilon \le 1ε≤1, which is what the book's 2dε−d2^d\varepsilon^{-d}2dε−d already allows for) and the regime m<2d+1m < 2^{d+1}m<2d+1, where the trivial bound E∥x−xπ1(x)∥≤d\mathbb{E}\|x - x_{\pi_1(x)}\| \le \sqrt dE∥x−xπ1​(x)​∥≤d​ suffices. Theorem 19.4 is the No-Free-Lunch theorem on the grid of spacing 1/c1/c1/c, plus the observation that any {0,1}\{0,1\}{0,1}-valued function on the grid extends to a ccc-Lipschitz [0,1][0,1][0,1]-valued function on the cube (McShane). Lemma 19.6 is Chernoff's bound below the mean; Lemma 19.7 is the delicate one: Chernoff with the function h(a)=(1+a)log⁡(1+a)−ah(a) = (1 + a)\log(1 + a) - ah(a)=(1+a)log(1+a)−a and the inequality (1−2p)e−kp+k2(log⁡(2p)+1)≤8/k p(1 - 2p)e^{-kp + \frac k2(\log(2p) + 1)} \le \sqrt{8/k}\,p(1−2p)e−kp+2k​(log(2p)+1)≤8/k​p for p∈[0,1/2]p \in [0, 1/2]p∈[0,1/2], k≥10k \ge 10k≥10, which the book states without proof. Theorem 19.5 assembles Lemmas 19.6 and 19.7 along the four steps of Exercise 4; to reach the book's constants with an integer number of boxes one takes T=⌈m1/(d+1)/2.07⌉T = \lceil m^{1/(d+1)}/2.07 \rceilT=⌈m1/(d+1)/2.07⌉ boxes per side and Chernoff at δ=1/3\delta = 1/3δ=1/3 in Lemma 19.6, or notes that the bound is trivial unless m1/(d+1)>6cd+km^{1/(d+1)} > 6c\sqrt d + km1/(d+1)>6cd​+k.

Formalization scope

Labels are Bool; bernoulliLaw p is the Bernoulli law on Bool, condLaw DX η the distribution with marginal DX and conditional probability η, and bayesRule η the Bayes rule. The cube is the subtype cube d of EuclideanSpace ℝ (Fin d), so its metric is Euclidean and its Borel structure is inherited; the Lipschitz hypothesis is LipschitzWith c η with c : ℝ≥0, together with η x ∈ [0,1] (a conditional probability). A kkk-NN rule is a learner h with IsKNNRuleWith k φ h: for every sample of size m≥km \ge km≥k and every xxx there is some reordering of the sample by distance to xxx whose first kkk entries feed φ\varphiφ; ties are therefore broken arbitrarily, and the theorems hold for every choice. Majority votes predict 111 iff strictly more than half of the kkk labels are 111, the book's 1[p′>1/2]\mathbb{1}[p' > 1/2]1[p′>1/2] of Lemma 19.7. The nearest-neighbor distance is nnDist S x = ⨅ i, dist x (S i).1. Expectations over S∼DmS \sim D^mS∼Dm are Bochner integrals against iidLaw D m (Mission I), and the expectation statements assume the rule is measurable in (S,x)(S, x)(S,x), the book's Remark 3.1; without it the integrals would be junk. Lemmas 19.2 and 19.6 are stated for arbitrary measurable subsets of an arbitrary measurable space, as in the book, with m≥1m \ge 1m≥1 (for m=0m = 0m=0 the left side is ∑iP[Ci]\sum_i P[C_i]∑i​P[Ci​] while Lean reads r/(0⋅e)r/(0 \cdot e)r/(0⋅e) as 000). Lemma 19.7 uses the product of Bernoulli laws on Fin k → Bool.

Two statements are given as their proofs support them, and the deviations are recorded in the item texts. Theorem 19.4 takes c≥2c \ge 2c≥2 an integer (the grid has spacing 1/c1/c1/c), fixes mmm with 2m≤(c+1)d2m \le (c+1)^d2m≤(c+1)d before choosing the distribution (Theorem 5.1 produces a distribution per mmm), and concludes that the expected true error is at least 1/41/41/4 (Equation (5.2) in the proof of Theorem 5.1; the book's "greater than 1/41/41/4" is what its proof gives for 2m<(c+1)d2m < (c+1)^d2m<(c+1)d only in the form of that expectation). Theorem 19.5 keeps the book's constants; the drafter checked that they are reachable with an integer number of boxes. Not stated: the general weighted-average rules of §19.1 beyond (19.1), the efficient implementation of §19.3, Exercise 3 (a one-line inequality, absorbed into the proof of Theorem 19.5).

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 19. doi:10.1017/CBO9781107298019
  • T. Cover, P. Hart, Nearest neighbor pattern classification, IEEE Transactions on Information Theory 13(1), 1967. doi:10.1109/TIT.1967.1053964
  • C. J. Stone, Consistent nonparametric regression, Annals of Statistics 5(4), 1977. doi:10.1214/aos/1176343886
  • L. Devroye, L. Györfi, G. Lugosi, A Probabilistic Theory of Pattern Recognition, Springer, 1996. doi:10.1007/978-1-4612-0711-5
  • L.-A. Gottlieb, A. Kontorovich, R. Krauthgamer, Efficient classification for metric data, COLT 2010; IEEE Transactions on Information Theory 60(9), 2014. doi:10.1109/TIT.2014.2339840
9 thms2 active usersReviewed
🏆Completed
CombinatoricsOptimization·Captain: naimengye

Understanding Machine Learning XIII: Multiclass Prediction and RankingTextbook

Motivation

Binary classification is the exception in practice; most prediction tasks have many labels, a structured label space, or ask for a ranking. Chapter 17 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) extends linear predictors to these settings through one idea: a class-sensitive feature mapping Ψ(x,y)\Psi(x, y)Ψ(x,y) that scores a candidate label, with the prediction hw(x)=argmax⁡y⟨w,Ψ(x,y)⟩h_w(x) = \operatorname{argmax}_y \langle w, \Psi(x, y)\ranglehw​(x)=argmaxy​⟨w,Ψ(x,y)⟩. A cost-sensitive loss Δ(y′,y)\Delta(y', y)Δ(y′,y) replaces the 0–1 loss, and the generalized hinge loss (17.3), max⁡y′(Δ(y′,y)+⟨w,Ψ(x,y′)−Ψ(x,y)⟩)\max_{y'}(\Delta(y', y) + \langle w, \Psi(x, y') - \Psi(x, y)\rangle)maxy′​(Δ(y′,y)+⟨w,Ψ(x,y′)−Ψ(x,y)⟩), is its convex surrogate: it upper bounds Δ(hw(x),y)\Delta(h_w(x), y)Δ(hw​(x),y), is tight under margin, and is convex and Lipschitz in www. Multiclass SVM is then regularized loss minimization for this loss, and Corollaries 17.1 and 17.2 transfer the guarantees of Chapters 13 and 14 with no dependence on the number of labels. The same construction handles ranking: a linear ranking predictor scores each item, the Kendall tau loss has a pairwise hinge surrogate, and the NDCG surrogate reduces to an assignment problem whose linear relaxation is exact by the Birkhoff–von Neumann theorem (Claim 17.3, Lemma 17.4).

Setting

Labels form a finite nonempty type YYY; the feature mapping takes values in Rd\mathbb{R}^dRd as in Mission VI, and the RLM rule and the SGD of Chapters 13 and 14 are those of Missions IX and X. An argmax predictor for (Ψ,w)(\Psi, w)(Ψ,w) is any hhh with h(x)h(x)h(x) maximizing ⟨w,Ψ(x,y)⟩\langle w, \Psi(x, y)\rangle⟨w,Ψ(x,y)⟩; a canonical one is fixed by choosing among the maximizers, and likewise a canonical maximizer y^\hat yy^​ in the generalized hinge loss, which gives the SGD direction Ψ(x,y^)−Ψ(x,y)\Psi(x, \hat y) - \Psi(x, y)Ψ(x,y^​)−Ψ(x,y). The cost Δ\DeltaΔ is nonnegative with Δ(y,y)=0\Delta(y, y) = 0Δ(y,y)=0. For ranking, an example is a list x1,…,xrx_1, \dots, x_rx1​,…,xr​ of instances with a score vector y∈Rry \in \mathbb{R}^ry∈Rr; the linear predictor is (⟨w,xi⟩)i(\langle w, x_i\rangle)_i(⟨w,xi​⟩)i​, the Kendall tau loss is the fraction of pairs ordered differently, using the three-valued real sign, and permutations of [r][r][r] are Mathlib's permutations of Fin r, with doubly stochastic and permutation matrices from Mathlib.

Formalization targets

Goal: Corollary 17.1

For DDD over X×YX \times YX×Y, ∥Ψ(x,y)∥≤ρ/2\|\Psi(x, y)\| \le \rho/2∥Ψ(x,y)∥≤ρ/2, B>0B > 0B>0, and the Multiclass SVM learner with λ=2ρ2/(B2m)\lambda = \sqrt{2\rho^2/(B^2 m)}λ=2ρ2/(B2m)​: ES[LDΔ(hw)]≤ES[LDg-hinge(w)]\mathbb{E}_S[L^\Delta_D(h_w)] \le \mathbb{E}_S[L^{g\text{-}hinge}_D(w)]ES​[LDΔ​(hw​)]≤ES​[LDg-hinge​(w)], and for every uuu with ∥u∥≤B\|u\| \le B∥u∥≤B, ES[LDg-hinge(w)]≤LDg-hinge(u)+8ρ2B2/m\mathbb{E}_S[L^{g\text{-}hinge}_D(w)] \le L^{g\text{-}hinge}_D(u) + \sqrt{8\rho^2B^2/m}ES​[LDg-hinge​(w)]≤LDg-hinge​(u)+8ρ2B2/m​.

Milestones

Equation (17.3). The generalized hinge loss bounds Δ(hw(x),y)\Delta(h_w(x), y)Δ(hw​(x),y) for every argmax predictor, equals it under the margin condition, and is convex and ρ\rhoρ-Lipschitz in www with ρ=max⁡y′∥Ψ(x,y′)−Ψ(x,y)∥\rho = \max_{y'}\|\Psi(x, y') - \Psi(x, y)\|ρ=maxy′​∥Ψ(x,y′)−Ψ(x,y)∥.

Corollary 17.2. SGD for multiclass learning with T≥B2ρ2/ϵ2T \ge B^2\rho^2/\epsilon^2T≥B2ρ2/ϵ2 examples has E[LDΔ(hwˉ)]≤E[LDg-hinge(wˉ)]≤LDg-hinge(u)+ϵ\mathbb{E}[L^\Delta_D(h_{\bar w})] \le \mathbb{E}[L^{g\text{-}hinge}_D(\bar w)] \le L^{g\text{-}hinge}_D(u) + \epsilonE[LDΔ​(hwˉ​)]≤E[LDg-hinge​(wˉ)]≤LDg-hinge​(u)+ϵ for every ∥u∥≤B\|u\| \le B∥u∥≤B.

Equation (17.7). The permutation induced by sorting yyy maximizes ∑iviyi\sum_i v_i y_i∑i​vi​yi​ over permutation vectors (the rearrangement inequality).

Claim 17.3. The doubly stochastic matrices are the convex hull of the permutation matrices.

Lemma 17.4. The assignment LP over doubly stochastic matrices has an optimal solution that is a permutation matrix.

Further items: Remark 17.2 (the binary case recovers the hinge loss) and the Kendall tau surrogate of §17.4.1 with its convexity and Lipschitz constant.

Significance

The generalized hinge loss is the device that lets the whole convex-learning machinery of Part II run on arbitrary finite label sets and on structured outputs, and Remark 17.3's observation that the bounds of Corollaries 17.1 and 17.2 do not depend on ∣Y∣|Y|∣Y∣ is what makes structured prediction (§17.3) and ranking with exponentially many labelings feasible. The ranking half of the chapter shows the pattern at work: the induced permutation is an argmax over a combinatorial set (17.7), so the NDCG loss admits a generalized hinge surrogate, and its subgradient is an assignment problem, solvable by the Hungarian method or, thanks to Birkhoff–von Neumann, by linear programming.

Nothing here is machine-checked except that Mathlib contains the Birkhoff–von Neumann theorem, which the corresponding item restates in the book's form. The statements are faithful with the clarifications that ties are broken canonically, that the Kendall tau surrogate is stated for tie-free score vectors (the book's rewriting of the pairwise indicator assumes sign⁡(yi−yj)≠0\operatorname{sign}(y_i - y_j) \ne 0sign(yi​−yj​)=0), and that Corollary 17.1 is stated with the measurability conventions of Mission IX.

Difficulty

Remark 17.2 is a two-element maximum and the entry point, and Equation (17.7) is Mathlib's rearrangement inequality for monovarying functions. The properties of the generalized hinge loss are elementary: the bound by choosing y′=hw(x)y' = h_w(x)y′=hw​(x), the equality by showing every term is at most 000 and the term y′=yy' = yy′=y is 000, convexity as a maximum of affine functions, and the Lipschitz bound by Cauchy–Schwarz on each term. Corollary 17.1 is Mission IX's Corollary 13.9 for the generalized hinge loss, which requires verifying convexity, the ρ\rhoρ-Lipschitz property from ∥Ψ∥≤ρ/2\|\Psi\| \le \rho/2∥Ψ∥≤ρ/2, nonnegativity and boundedness at the origin (by max⁡Δ\max\DeltamaxΔ, finite), the measurability of the loss and of the canonical argmax predictor as functions of (w,x)(w, x)(w,x), and the pointwise comparison with the Δ\DeltaΔ-loss; Corollary 17.2 is the same with Mission X's Corollary 14.12 and Claim 14.6 for the subgradient. The Kendall tau surrogate is the pairwise hinge bound under no ties, plus the convexity and Lipschitz constant of an average of hinge terms. Lemma 17.4 follows from Birkhoff–von Neumann by the averaging argument of the book, or directly from the finiteness of the permutation matrices together with the fact that a linear function on a convex hull is minimized at an extreme point.

Formalization scope

The label set is finite, so maxima over YYY are attained and the losses are well defined; maximizers are chosen canonically, and every statement about argmax predictors holds for any choice. The multivector and TF-IDF constructions of §17.2.1, the reductions of §17.1, structured output prediction (§17.3), the NDCG loss and its surrogate (17.8), and bipartite ranking (§17.5) are not stated; the NDCG construction would need the sorting permutation and the discount function and is left for a later revision. Exercises are not stated except 17.4 through Equation (17.7).

Trivializing readings are excluded: the Δ\DeltaΔ-risk in Corollaries 17.1 and 17.2 is that of a genuine argmax predictor, the Lipschitz constants are the book's, and the assignment lemma asserts optimality against every doubly stochastic matrix. Welcome contributions: the Lipschitz constant of a maximum of affine functions, the measurability of a canonical argmax over a finite label set, and the extreme-point argument of Lemma 17.4.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 17. doi:10.1017/CBO9781107298019
  • K. Crammer, Y. Singer, On the algorithmic implementation of multiclass kernel-based vector machines, Journal of Machine Learning Research 2, 2001.
  • I. Tsochantaridis, T. Joachims, T. Hofmann, Y. Altun, Large margin methods for structured and interdependent output variables, Journal of Machine Learning Research 6, 2005.
  • G. Birkhoff, Tres observaciones sobre el algebra lineal, Universidad Nacional de Tucumán, Revista A 5, 1946.
  • H. W. Kuhn, The Hungarian method for the assignment problem, Naval Research Logistics Quarterly 2, 1955. doi:10.1002/nav.3800020109
12 thms2 active usersReviewed
🏆Completed
Optimization·Captain: naimengye

Understanding Machine Learning XII: Kernel Methods and the Representer TheoremTextbook

Motivation

Chapter 15 bounded the sample complexity of large-margin halfspaces by the norms of the data and of the separator, independently of the dimension. Chapter 16 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) removes the remaining obstacle to using halfspaces in very high-dimensional feature spaces: computation. After embedding the data by a feature map ψ\psiψ into a Hilbert space, every SVM-like problem has the form min⁡wf(⟨w,ψ(x1)⟩,…,⟨w,ψ(xm)⟩)+R(∥w∥)\min_w f(\langle w, \psi(x_1)\rangle, \dots, \langle w, \psi(x_m)\rangle) + R(\|w\|)minw​f(⟨w,ψ(x1​)⟩,…,⟨w,ψ(xm​)⟩)+R(∥w∥) (16.2), and the representer theorem (Theorem 16.1) says that an optimal solution lies in the span of the mapped examples. Consequently the problem can be rewritten in terms of the mmm coefficients and the kernel K(x,x′)=⟨ψ(x),ψ(x′)⟩K(x, x') = \langle\psi(x), \psi(x')\rangleK(x,x′)=⟨ψ(x),ψ(x′)⟩ alone (16.3): this is the kernel trick. The chapter exhibits the polynomial and Gaussian kernels (Examples 16.1 and 16.2), characterizes the functions that are kernels as the positive semidefinite ones (Lemma 16.2), and shows that the SGD solver for Soft-SVM of §15.5 can be run entirely on kernel evaluations (Lemma 16.3).

Setting

A feature map ψ:X→F\psi : X \to Fψ:X→F takes values in a real Hilbert space, a complete real inner product space; its kernel is K(x,x′)=⟨ψ(x),ψ(x′)⟩K(x, x') = \langle\psi(x), \psi(x')\rangleK(x,x′)=⟨ψ(x),ψ(x′)⟩, and a function KKK implements an inner product in some Hilbert space if it is the kernel of some feature map into some Hilbert space, quantified existentially in the universe of the domain. The Gram matrix of a sample is Gij=K(xi,xj)G_{ij} = K(x_i, x_j)Gij​=K(xi​,xj​). The general objective (16.2) is f(⟨w,ψ(x1)⟩,…,⟨w,ψ(xm)⟩)+R(∥w∥)f(\langle w, \psi(x_1)\rangle, \dots, \langle w, \psi(x_m)\rangle) + R(\|w\|)f(⟨w,ψ(x1​)⟩,…,⟨w,ψ(xm​)⟩)+R(∥w∥) with fff arbitrary and RRR nondecreasing on [0,∞)[0, \infty)[0,∞). The SGD procedure of §15.5 in the feature space keeps θ(t)\theta^{(t)}θ(t) with w(t)=θ(t)/(λ(t+1))w^{(t)} = \theta^{(t)}/(\lambda(t+1))w(t)=θ(t)/(λ(t+1)) (iterates indexed from 000) and, at each step, for the chosen index iii, adds yiψ(xi)y_i\psi(x_i)yi​ψ(xi​) to θ\thetaθ when yi⟨w(t),ψ(xi)⟩<1y_i\langle w^{(t)}, \psi(x_i)\rangle < 1yi​⟨w(t),ψ(xi​)⟩<1; its kernelized version keeps coefficients β(t)\beta^{(t)}β(t) with α(t)=β(t)/(λ(t+1))\alpha^{(t)} = \beta^{(t)}/(\lambda(t+1))α(t)=β(t)/(λ(t+1)) and tests yi∑jαj(t)K(xj,xi)<1y_i\sum_j\alpha^{(t)}_j K(x_j, x_i) < 1yi​∑j​αj(t)​K(xj​,xi​)<1. Both are driven by the same sequence of chosen indices, which stands for the uniformly random choices of the book.

Formalization targets

Goal: Theorem 16.1 (Representer Theorem)

If RRR is nondecreasing on [0,∞)[0,\infty)[0,∞) and the problem (16.2) has an optimal solution, then there is α∈Rm\alpha \in \mathbb{R}^mα∈Rm such that ∑iαiψ(xi)\sum_i \alpha_i\psi(x_i)∑i​αi​ψ(xi​) is an optimal solution.

Milestones

Equation (16.3). For w=∑jαjψ(xj)w = \sum_j\alpha_j\psi(x_j)w=∑j​αj​ψ(xj​) the objective equals f(∑jαjK(xj,x1),…)+R(∑i,jαiαjK(xj,xi))f\big(\sum_j\alpha_jK(x_j, x_1), \dots\big) + R\big(\sqrt{\sum_{i,j}\alpha_i\alpha_jK(x_j, x_i)}\big)f(∑j​αj​K(xj​,x1​),…)+R(∑i,j​αi​αj​K(xj​,xi​)​).

Example 16.1. The polynomial kernel (1+⟨x,x′⟩)k(1 + \langle x, x'\rangle)^k(1+⟨x,x′⟩)k on Rn\mathbb{R}^nRn is ⟨ψ(x),ψ(x′)⟩\langle\psi(x), \psi(x')\rangle⟨ψ(x),ψ(x′)⟩ for the monomial map into R(n+1)k\mathbb{R}^{(n+1)^k}R(n+1)k.

Example 16.2. On R\mathbb{R}R, the map ψ(x)n=e−x2/2xn/n!\psi(x)_n = e^{-x^2/2}x^n/\sqrt{n!}ψ(x)n​=e−x2/2xn/n!​ into ℓ2\ell^2ℓ2 has ⟨ψ(x),ψ(x′)⟩=e−(x−x′)2/2\langle\psi(x), \psi(x')\rangle = e^{-(x-x')^2/2}⟨ψ(x),ψ(x′)⟩=e−(x−x′)2/2; the Gaussian kernel e−∥x−x′∥2/(2σ)e^{-\|x-x'\|^2/(2\sigma)}e−∥x−x′∥2/(2σ) on Rn\mathbb{R}^nRn is a kernel for every σ>0\sigma > 0σ>0.

Lemma 16.2. A symmetric KKK is a kernel iff all its Gram matrices are positive semidefinite.

Lemma 16.3. The kernelized SGD reproduces the feature-space SGD: θ(t)=∑jβj(t)ψ(xj)\theta^{(t)} = \sum_j\beta^{(t)}_j\psi(x_j)θ(t)=∑j​βj(t)​ψ(xj​) for all ttt, hence the outputs coincide.

Further items: Exercise 16.3 (kernel ridge regression: minimizers of the coefficient objective give minimizers of the ridge objective, and (2λmI+G)α=y(2\lambda mI + G)\alpha = y(2λmI+G)α=y gives one), Exercise 16.4 (min⁡{x,x′}\min\{x, x'\}min{x,x′} is a kernel), Exercise 16.6 (the nearest-class-mean rule is a halfspace).

Significance

The representer theorem is the reason kernel methods exist: it reduces an optimization over an arbitrary Hilbert space to one over Rm\mathbb{R}^mRm, and Lemma 16.2 says the reduction needs nothing but a positive semidefinite similarity function, so one may design the kernel directly, as in the string example of §16.2.1. Lemma 16.3 makes the connection to Chapter 14 concrete: a first-order method never leaves the span of the examples, so it too can be run on the Gram matrix. Together with Chapter 15, the chapter closes the book's treatment of linear predictors: expressive through the embedding, statistically controlled through the margin, and computable through the kernel.

Nothing here is machine-checked. The statements are faithful to the book with two clarifications: the representer theorem assumes the existence of an optimal solution, which the book's proof also assumes, and the kernel-SGD equivalence is stated for a fixed sequence of chosen indices, which is the content of the book's inductive proof.

Difficulty

Equation (16.3) and Exercise 16.6 are inner-product algebra and the entry points. The representer theorem needs the orthogonal decomposition w⋆=∑iαiψ(xi)+uw^\star = \sum_i\alpha_i\psi(x_i) + uw⋆=∑i​αi​ψ(xi​)+u with uuu orthogonal to the span, which is available in Mathlib for the finite-dimensional, hence complete, subspace spanned by the ψ(xi)\psi(x_i)ψ(xi​), together with the Pythagorean identity and the monotonicity of RRR. Example 16.1 is the multinomial expansion of (1+⟨x,x′⟩)k(1 + \langle x, x'\rangle)^k(1+⟨x,x′⟩)k as a sum over index vectors, packaged as an inner product in the Euclidean space indexed by {0,…,n}k\{0, \dots, n\}^k{0,…,n}k. Example 16.2 needs the summability of xn(x′)n/n!x^n(x')^n/n!xn(x′)n/n! and the exponential series, and, for the general Gaussian kernel, either an explicit construction or Lemma 16.2 together with the positive semidefiniteness of the Gaussian Gram matrix. Lemma 16.2 in the nontrivial direction is the construction of the reproducing kernel Hilbert space: the pre-Hilbert space of finite combinations of the functions K(⋅,x)K(\cdot, x)K(⋅,x), the inner product defined through KKK, its well-definedness and positive definiteness from the Gram matrices, and the completion, which Mathlib provides for inner product spaces. Lemma 16.3 is an induction on ttt with the identity ⟨w(t),ψ(xi)⟩=∑jαj(t)K(xj,xi)\langle w^{(t)}, \psi(x_i)\rangle = \sum_j\alpha^{(t)}_jK(x_j, x_i)⟨w(t),ψ(xi​)⟩=∑j​αj(t)​K(xj​,xi​). Exercise 16.3 combines the representer theorem with the identity between the two objectives on the span and the first-order condition for a convex quadratic; Exercise 16.4 needs a feature map such as ψ(x)=(1[1≤j≤x])j\psi(x) = (\mathbb{1}[1 \le j \le x])_jψ(x)=(1[1≤j≤x])j​, or the positive semidefiniteness of the min matrix.

Formalization scope

Hilbert spaces are real, complete inner product spaces; the existential in IsKernel ranges over Hilbert spaces in the universe of the domain, which the reproducing kernel construction respects. The objective (16.2) has real-valued fff, so the hard-SVM instance with f∈{0,∞}f \in \{0, \infty\}f∈{0,∞} is not covered by the representer item as stated. The SGD procedures are deterministic given the index sequence; the random choice of indices is not modelled, exactly as in Lemma 16.3's proof. The string kernel of §16.2.1 and Exercise 16.1, the kernelized Perceptron (Exercise 16.2), Exercise 16.5 and part (2) of Exercise 16.6 are not stated.

Trivializing readings are excluded: the representer theorem asserts optimality against every www, Lemma 16.2 is a biconditional with symmetry assumed as the book does, and the kernels of the examples are exhibited with explicit feature spaces where the book gives them. Welcome contributions: the orthogonal decomposition against a finite span, the multinomial identity of Example 16.1, and the reproducing kernel Hilbert space construction behind Lemma 16.2.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 16. doi:10.1017/CBO9781107298019
  • B. Schölkopf, R. Herbrich, A. J. Smola, A generalized representer theorem, Proceedings of COLT, 2001. doi:10.1007/3-540-44581-1_27
  • N. Aronszajn, Theory of reproducing kernels, Transactions of the American Mathematical Society 68(3), 1950. doi:10.1090/S0002-9947-1950-0051437-7
  • B. Schölkopf, A. J. Smola, Learning with Kernels, MIT Press, 2002.
  • M. A. Aizerman, E. M. Braverman, L. I. Rozonoer, Theoretical foundations of the potential function method in pattern recognition learning, Automation and Remote Control 25, 1964.
8 thms2 active usersReviewed
🏆Completed
OptimizationStatistics·Captain: naimengye

Understanding Machine Learning XI: Support Vector Machines and MarginTextbook

Motivation

The sample complexity of learning halfspaces in Rd\mathbb{R}^dRd grows with ddd, which is bad news when features are many or infinite. Chapter 15 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) introduces the support vector machine, the learning rule that replaces dimension by geometry. Among the halfspaces separating a sample, Hard-SVM picks the one of largest margin, the distance from the hyperplane to the nearest example (Claim 15.1, Lemma 15.2); if the data are separable with margin γ\gammaγ and lie in a ball of radius ρ\rhoρ, the resulting classifier has error O(ρ/(γm))O(\rho/(\gamma\sqrt m))O(ρ/(γm​)) whatever the dimension (Theorem 15.4), and the Perceptron of Chapter 9 makes at most (ρ/γ)2(\rho/\gamma)^2(ρ/γ)2 updates (Remark 15.1). Soft-SVM drops separability by allowing slack variables, and Claim 15.5 identifies it with regularized hinge-loss minimization, so that the stability theory of Chapter 13 applies: the hinge loss is ∥x∥\|x\|∥x∥-Lipschitz (Claim 15.6), and Corollary 15.7 gives an expected-risk bound depending only on the norms of the data and of the comparison halfspace. The chapter closes with the optimality conditions that explain the name: the Hard-SVM solution is a combination of the examples on the margin (Theorem 15.8, via the Fritz John conditions, Lemma 15.9).

Setting

Vectors live in Rd\mathbb{R}^dRd as in Mission VI; labels are real numbers, with y∈{±1}y \in \{\pm 1\}y∈{±1} as a hypothesis wherever the book needs it. A sample is linearly separable if some halfspace (w,b)(w, b)(w,b) has yi(⟨w,xi⟩+b)>0y_i(\langle w, x_i\rangle + b) > 0yi​(⟨w,xi​⟩+b)>0 for all iii, and the margin of (w,b)(w, b)(w,b) on the sample is min⁡iyi(⟨w,xi⟩+b)\min_i y_i(\langle w, x_i\rangle + b)mini​yi​(⟨w,xi​⟩+b). Hard-SVM solutions are minimizers of ∥w∥\|w\|∥w∥ subject to yi(⟨w,xi⟩+b)≥1y_i(\langle w, x_i\rangle + b) \ge 1yi​(⟨w,xi​⟩+b)≥1, formalized as a relation; the minimizer is unique whenever the constraints are feasible, and the homogenous version sets b=0b = 0b=0. A distribution over Rd×{±1}\mathbb{R}^d \times \{\pm 1\}Rd×{±1} is separable with a (γ,ρ)(\gamma, \rho)(γ,ρ)-margin if some unit w⋆w^\starw⋆ (and b⋆b^\starb⋆) has y(⟨w⋆,x⟩+b⋆)≥γy(\langle w^\star, x\rangle + b^\star) \ge \gammay(⟨w⋆,x⟩+b⋆)≥γ and ∥x∥≤ρ\|x\| \le \rho∥x∥≤ρ almost surely. Soft-SVM is the problem λ∥w∥2+1m∑ξi\lambda\|w\|^2 + \frac1m\sum\xi_iλ∥w∥2+m1​∑ξi​ under yi(⟨w,xi⟩+b)≥1−ξiy_i(\langle w, x_i\rangle + b) \ge 1 - \xi_iyi​(⟨w,xi​⟩+b)≥1−ξi​, ξi≥0\xi_i \ge 0ξi​≥0; its homogenous form is the regularized loss minimization rule of Mission IX for the hinge loss max⁡{0,1−y⟨w,x⟩}\max\{0, 1 - y\langle w, x\rangle\}max{0,1−y⟨w,x⟩}, and the 0–1 loss is 1[y⟨w,x⟩≤0]\mathbb{1}[y\langle w, x\rangle \le 0]1[y⟨w,x⟩≤0]. Expectations over samples are integrals against DmD^mDm, with the measurability conventions of Mission IX.

Formalization targets

Goal: Corollary 15.7, last part

For DDD on {∥x∥≤ρ}×{±1}\{\|x\| \le \rho\} \times \{\pm 1\}{∥x∥≤ρ}×{±1} almost surely, B>0B > 0B>0, and the Soft-SVM learner with λ=2ρ2/(B2m)\lambda = \sqrt{2\rho^2/(B^2 m)}λ=2ρ2/(B2m)​: ES[LD0−1(A(S))]≤ES[LDhinge(A(S))]\mathbb{E}_S[L^{0-1}_D(A(S))] \le \mathbb{E}_S[L^{hinge}_D(A(S))]ES​[LD0−1​(A(S))]≤ES​[LDhinge​(A(S))], and for every www with ∥w∥≤B\|w\| \le B∥w∥≤B, ES[LDhinge(A(S))]≤LDhinge(w)+8ρ2B2/m\mathbb{E}_S[L^{hinge}_D(A(S))] \le L^{hinge}_D(w) + \sqrt{8\rho^2 B^2/m}ES​[LDhinge​(A(S))]≤LDhinge​(w)+8ρ2B2/m​.

Milestones

Claim 15.1. The distance from xxx to {v:⟨w,v⟩+b=0}\{v : \langle w, v\rangle + b = 0\}{v:⟨w,v⟩+b=0} with ∥w∥=1\|w\| = 1∥w∥=1 is ∣⟨w,x⟩+b∣|\langle w, x\rangle + b|∣⟨w,x⟩+b∣.

Lemma 15.2. For a sample with both labels present, the normalized Hard-SVM output has unit norm and margin at least that of every unit-norm halfspace.

Theorem 15.4. Under homogenous (γ,ρ)(\gamma, \rho)(γ,ρ)-separability, with probability at least 1−δ1 - \delta1−δ the 0–1 risk of the Hard-SVM output is at most 4(ρ/γ)2/m+2log⁡(2/δ)/m\sqrt{4(\rho/\gamma)^2/m} + \sqrt{2\log(2/\delta)/m}4(ρ/γ)2/m​+2log(2/δ)/m​.

Claim 15.5. Every feasible slack vector has average at least the hinge loss, and the hinge losses are feasible slacks.

Claim 15.6. For y∈{±1}y \in \{\pm 1\}y∈{±1}, w↦max⁡{0,1−y⟨w,x⟩}w \mapsto \max\{0, 1 - y\langle w, x\rangle\}w↦max{0,1−y⟨w,x⟩} is ∥x∥\|x\|∥x∥-Lipschitz.

Corollary 15.7, first parts. For every uuu, ES[LDhinge(A(S))]\mathbb{E}_S[L^{hinge}_D(A(S))]ES​[LDhinge​(A(S))] and ES[LD0−1(A(S))]\mathbb{E}_S[L^{0-1}_D(A(S))]ES​[LD0−1​(A(S))] are at most LDhinge(u)+λ∥u∥2+2ρ2/(λm)L^{hinge}_D(u) + \lambda\|u\|^2 + 2\rho^2/(\lambda m)LDhinge​(u)+λ∥u∥2+2ρ2/(λm).

Theorem 15.8. The homogenous Hard-SVM solution is ∑i∈Iαixi\sum_{i \in I}\alpha_i x_i∑i∈I​αi​xi​ with I={i:∣⟨w0,xi⟩∣=1}I = \{i : |\langle w_0, x_i\rangle| = 1\}I={i:∣⟨w0​,xi​⟩∣=1}.

Lemma 15.9. Fritz John conditions, in the correct form with a multiplier on ∇f\nabla f∇f.

Further items: Exercise 15.1 (the two Hard-SVM formulations agree) and Exercise 15.2 (the Perceptron makes at most (ρ/γ)2(\rho/\gamma)^2(ρ/γ)2 updates).

Significance

SVM is the bridge between the statistical theory of Part I and the kernel methods of Chapter 16: because the bounds of Theorem 15.4 and Corollary 15.7 involve only ρ\rhoρ, γ\gammaγ and BBB, the same algorithm can be run after an embedding into a huge or infinite-dimensional feature space, and Theorem 15.8, that the solution lies in the span of the examples, is what makes the embedding computable. Corollary 15.7 is also the first place where the abstract machinery of Chapter 13 is applied to a specific learning rule.

Nothing here is machine-checked. One correction is built in: the Fritz John lemma is stated with the multiplier α0≥0\alpha_0 \ge 0α0​≥0 on ∇f(w⋆)\nabla f(w^\star)∇f(w⋆) and nonnegative multipliers not all zero, since the printed form, with ∇f(w⋆)\nabla f(w^\star)∇f(w⋆) unweighted and α\alphaα unrestricted, fails already for f(w)=wf(w) = wf(w)=w and g1(w)=w2g_1(w) = w^2g1​(w)=w2 on the line. Theorem 15.8 is unaffected: its constraints are affine, so the multiplier on ∇f\nabla f∇f can be taken to be 111.

Difficulty

Claim 15.6 and Claim 15.5 are short inequalities and the intended entry points, and Exercise 15.2 is Theorem 9.1 of Mission VI with B≤1/γB \le 1/\gammaB≤1/γ and R≤ρR \le \rhoR≤ρ. Claim 15.1 is the book's computation with the foot of the perpendicular v=x−(⟨w,x⟩+b)wv = x - (\langle w, x\rangle + b)wv=x−(⟨w,x⟩+b)w and a Pythagorean inequality for every other point of the hyperplane, packaged as an infimum distance. Lemma 15.2 is the rescaling argument of the book, together with the observation that both labels force w0≠0w_0 \ne 0w0​=0; Exercise 15.1 needs the positivity of the optimal margin on a separable sample. Corollary 15.7 is Corollaries 13.8 and 13.9 of Mission IX for the hinge loss, whose Lipschitz constant is ∥x∥\|x\|∥x∥ only on the support of DDD, so the stability argument must be run with the almost-sure bound; the 0–1 clause is the pointwise inequality ℓ0−1≤ℓhinge\ell_{0-1} \le \ell_{hinge}ℓ0−1​≤ℓhinge​. Theorem 15.4 is the content of §26.3: Rademacher complexity of the class of norm-bounded halfspaces, the contraction lemma for the ramp loss, the observation that the Hard-SVM output has zero ramp loss on the sample and norm at most 1/γ1/\gamma1/γ, and a concentration step, all of which will be items of the Rademacher mission. Theorem 15.8 is the KKT theorem for a strictly convex quadratic with affine constraints (Slater's condition holds), and Lemma 15.9 is the general Fritz John theorem for differentiable data, whose proof goes through a separation or penalty argument; neither is in Mathlib.

Formalization scope

Hard-SVM and Soft-SVM are relations and learners, not programs; the margin is a real infimum over the sample; the ramp loss is defined but its bounds belong to Chapter 26. Theorem 15.4 is stated for any learner that returns the Hard-SVM solution whenever the sample is feasible, which is almost surely the case under the margin assumption, and bounds the failure event in outer measure. Corollary 15.7 carries the measurability conventions of Mission IX. The Fritz John lemma is stated correctly rather than as printed. The duality of §15.4, the SGD implementation of §15.5 (whose guarantee needs the trajectory bound of §14.5.3 rather than Theorem 14.11 as stated in Mission X), Exercises 15.3 and 15.4, and Remark 15.2 are not stated.

Trivializing readings are excluded: both labels must be present for the normalized Hard-SVM output, the margin assumption and the support condition are almost sure with respect to DDD, and the risks are genuine integrals. Welcome contributions: the uniqueness of the Hard-SVM minimizer, the KKT conditions for affine constraints, and the pointwise comparison of the 0–1, ramp and hinge losses.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 15. doi:10.1017/CBO9781107298019
  • C. Cortes, V. Vapnik, Support-vector networks, Machine Learning 20(3), 1995. doi:10.1007/BF00994018
  • B. E. Boser, I. M. Guyon, V. N. Vapnik, A training algorithm for optimal margin classifiers, Proceedings of COLT, 1992. doi:10.1145/130385.130401
  • F. John, Extremum problems with inequalities as subsidiary conditions, in Studies and Essays Presented to R. Courant, 1948.
  • N. Cristianini, J. Shawe-Taylor, An Introduction to Support Vector Machines, Cambridge University Press, 2000. doi:10.1017/CBO9780511801389
15 thms2 active usersReviewed
🏆Completed
Probability·Captain: Lucas

The Principles of Deep Learning Theory II: Deep Linear Networks at InitializationTextbook

Motivation

Chapter 3 of The Principles of Deep Learning Theory by D. A. Roberts and S. Yaida (arXiv:2106.10165) is the book's first complete example of its effective-theory method. For deep linear networks at initialization, the two- and four-point correlators of the network outputs can be computed exactly at any width and depth. The resulting formulas exhibit, in the simplest setting, the phenomena that organize the rest of the book: criticality of the weight variance CW=1C_W=1CW​=1, non-Gaussianity that grows with depth, and the depth-to-width ratio ℓ/n\ell/nℓ/n as the parameter controlling deviations from the infinite-width limit. This mission formalizes §§3.1–3.3. It is the second mission in a series formalizing the book (namespace DeepLearningTheory).

Setting

A deep linear network with widths n0,n1,n2,…n_0, n_1, n_2, \dotsn0​,n1​,n2​,… (all positive) and zero biases maps an input x∈Rn0x\in\mathbb{R}^{n_0}x∈Rn0​ to preactivations

zi(0)=xi,zi(ℓ+1)=∑j=1nℓWij(ℓ+1) zj(ℓ)(i=1,…,nℓ+1),z^{(0)}_i = x_i,\qquad z^{(\ell+1)}_i = \sum_{j=1}^{n_\ell} W^{(\ell+1)}_{ij}\, z^{(\ell)}_j \quad (i=1,\dots,n_{\ell+1}),zi(0)​=xi​,zi(ℓ+1)​=j=1∑nℓ​​Wij(ℓ+1)​zj(ℓ)​(i=1,…,nℓ+1​),

(eqs. 3.1–3.2 with b(ℓ)=0b^{(\ell)}=0b(ℓ)=0). At initialization all weights Wij(ℓ)W^{(\ell)}_{ij}Wij(ℓ)​ are independent centered Gaussians with E[Wi1j1(ℓ)Wi2j2(ℓ)]=δi1i2δj1j2 CW/nℓ−1\mathbb{E}[W^{(\ell)}_{i_1j_1}W^{(\ell)}_{i_2j_2}] = \delta_{i_1i_2}\delta_{j_1j_2}\, C_W/n_{\ell-1}E[Wi1​j1​(ℓ)​Wi2​j2​(ℓ)​]=δi1​i2​​δj1​j2​​CW​/nℓ−1​ (eq. 3.4), with a layer-independent CW≥0C_W\ge0CW​≥0. For inputs xα1,xα2x_{\alpha_1}, x_{\alpha_2}xα1​​,xα2​​ let Gα1α2(0)=1n0∑jxj;α1xj;α2G^{(0)}_{\alpha_1\alpha_2} = \frac1{n_0}\sum_j x_{j;\alpha_1}x_{j;\alpha_2}Gα1​α2​(0)​=n0​1​∑j​xj;α1​​xj;α2​​ (eq. 3.9).

Formalization targets

Goal: the exact four-point correlator (eqs. 3.21, 3.25)

For every layer ℓ≥1\ell\ge1ℓ≥1, a single input xxx, and neurons i1,…,i4i_1,\dots,i_4i1​,…,i4​,

E[zi1(ℓ)zi2(ℓ)zi3(ℓ)zi4(ℓ)]=(δi1i2δi3i4+δi1i3δi2i4+δi1i4δi2i3)  CW2ℓ[∏ℓ′=1ℓ−1(1+2nℓ′)](G(0))2.\mathbb{E}\big[z^{(\ell)}_{i_1}z^{(\ell)}_{i_2}z^{(\ell)}_{i_3}z^{(\ell)}_{i_4}\big] = (\delta_{i_1i_2}\delta_{i_3i_4}+\delta_{i_1i_3}\delta_{i_2i_4}+\delta_{i_1i_4}\delta_{i_2i_3})\; C_W^{2\ell}\Big[\prod_{\ell'=1}^{\ell-1}\Big(1+\frac{2}{n_{\ell'}}\Big)\Big]\big(G^{(0)}\big)^2 .E[zi1​(ℓ)​zi2​(ℓ)​zi3​(ℓ)​zi4​(ℓ)​]=(δi1​i2​​δi3​i4​​+δi1​i3​​δi2​i4​​+δi1​i4​​δi2​i3​​)CW2ℓ​[ℓ′=1∏ℓ−1​(1+nℓ′​2​)](G(0))2.

Milestones

  1. Eq. (3.6) — the mean preactivation vanishes.
  2. Eq. (3.10) — first-layer two-point correlator E[zi1;α1(1)zi2;α2(1)]=δi1i2CWGα1α2(0)\mathbb{E}[z^{(1)}_{i_1;\alpha_1}z^{(1)}_{i_2;\alpha_2}] = \delta_{i_1i_2}C_W G^{(0)}_{\alpha_1\alpha_2}E[zi1​;α1​(1)​zi2​;α2​(1)​]=δi1​i2​​CW​Gα1​α2​(0)​.
  3. Eqs. (3.12), (3.15) — two-point correlator in layer ℓ\ellℓ: δi1i2CWℓGα1α2(0)\delta_{i_1i_2}C_W^{\ell}G^{(0)}_{\alpha_1\alpha_2}δi1​i2​​CWℓ​Gα1​α2​(0)​.
  4. Eq. (3.18) — first-layer four-point correlator.
  5. Eq. (3.20) — the layer-to-layer recursion for the four-point correlator.
  6. Eqs. (3.21)–(3.24) — the recursion G4(ℓ+1)=CW2(1+2/nℓ)G4(ℓ)G_4^{(\ell+1)} = C_W^2(1+2/n_\ell)G_4^{(\ell)}G4(ℓ+1)​=CW2​(1+2/nℓ​)G4(ℓ)​ for the coefficient of the Wick tensor structure.
  7. Eq. (3.30) — the connected four-point correlator between two distinct neurons, G4(ℓ)−(G2(ℓ))2G_4^{(\ell)} - (G_2^{(\ell)})^2G4(ℓ)​−(G2(ℓ)​)2.

Significance

The closed forms show that a deep linear network is exactly Gaussian only in the strict infinite-width limit: at criticality CW=1C_W=1CW​=1 the connected four-point correlator (3.29)–(3.30) is [∏(1+2/nℓ′)−1](G(0))2≈2(ℓ−1)n(G(0))2\big[\prod(1+2/n_{\ell'})-1\big](G^{(0)})^2 \approx \frac{2(\ell-1)}{n}(G^{(0)})^2[∏(1+2/nℓ′​)−1](G(0))2≈n2(ℓ−1)​(G(0))2 for equal widths nnn, the first appearance of the depth-to-width ratio as the book's emergent scale. The same recursive method is reused for nonlinear networks in Chapters 4–5. The results are exact computations in the book; this mission formalizes them.

Difficulty

Each correlator is an expectation of a polynomial in exponentially many Gaussian weights. The book's recursion uses that the layer-(ℓ+1)(\ell+1)(ℓ+1) weights are independent of the layer-ℓ\ellℓ preactivations, followed by Wick contraction of the two or four new weights. In Lean this requires independence of a weight family from a measurable function of the earlier layers, integrability of products of Gaussian polynomials, and careful handling of the Kronecker-delta bookkeeping in the sums (3.23).

Formalization scope

  • Widths are n : ℕ → ℕ with n 0 the input dimension; neural indices are 0,…,nℓ−10,\dots,n_\ell-10,…,nℓ​−1. Weights are a random field W : Ω → ℕ → ℕ → ℕ → ℝ on a probability space, only entries Wij(ℓ)W^{(\ell)}_{ij}Wij(ℓ)​ with ℓ≥1\ell\ge1ℓ≥1, i<nℓi<n_\elli<nℓ​, j<nℓ−1j<n_{\ell-1}j<nℓ−1​ are used.
  • IsLinearNetInit P n CW W states mutual independence of all these weights and that each has law gaussianReal 0 (CW / n (ℓ-1)).
  • linearPreact n (W ω) x ℓ i is zi(ℓ)(x)z^{(\ell)}_i(x)zi(ℓ)​(x); inputKernel (n 0) x₁ x₂ is Gα1α2(0)G^{(0)}_{\alpha_1\alpha_2}Gα1​α2​(0)​; kron and wickDelta4 are the Kronecker delta and the three-term tensor structure.
  • Widths are assumed positive where the source's formulas require it (division by nℓn_\ellnℓ​, nonempty hidden layers). Every hypothesis is satisfiable by a product of independent Gaussians.

Selected references

  • D. A. Roberts, S. Yaida (with B. Hanin), The Principles of Deep Learning Theory, Cambridge University Press, 2022, Chapter 3. arXiv:2106.10165
  • B. Hanin, M. Nica, Products of many large random matrices and gradients in deep neural networks, Commun. Math. Phys. 376 (2020). arXiv:1812.05994
9 thms2 active usersReviewed
🏆Completed
Probability·Captain: Lucas

The Principles of Deep Learning Theory III: Preactivation Statistics in the First Two LayersTextbook

Motivation

Chapter 4 of The Principles of Deep Learning Theory by D. A. Roberts and S. Yaida (arXiv:2106.10165) begins the analysis of general multilayer perceptrons (MLPs) with a nonlinear activation function σ\sigmaσ at initialization. The first layer is exactly Gaussian; the second layer is the first place where non-Gaussianity appears, as a connected four-point correlator suppressed by 1/n11/n_11/n1​ and governed by the four-point vertex V(2)V^{(2)}V(2). This mission formalizes §§4.1–4.2, which are exact at any width. It is the third mission in a series formalizing the book (namespace DeepLearningTheory) and reuses the definitions of Mission II (Deep Linear Networks at Initialization).

Setting

An MLP with widths n0,n1,n2,…n_0,n_1,n_2,\dotsn0​,n1​,n2​,… and activation σ:R→R\sigma:\mathbb{R}\to\mathbb{R}σ:R→R maps inputs xα∈Rn0x_\alpha\in\mathbb{R}^{n_0}xα​∈Rn0​ to preactivations

zi;α(1)=bi(1)+∑j=1n0Wij(1)xj;α,zi;α(ℓ+1)=bi(ℓ+1)+∑j=1nℓWij(ℓ+1) σ(zj;α(ℓ))z^{(1)}_{i;\alpha}=b^{(1)}_i+\sum_{j=1}^{n_0}W^{(1)}_{ij}x_{j;\alpha},\qquad z^{(\ell+1)}_{i;\alpha}=b^{(\ell+1)}_i+\sum_{j=1}^{n_\ell}W^{(\ell+1)}_{ij}\,\sigma\big(z^{(\ell)}_{j;\alpha}\big)zi;α(1)​=bi(1)​+j=1∑n0​​Wij(1)​xj;α​,zi;α(ℓ+1)​=bi(ℓ+1)​+j=1∑nℓ​​Wij(ℓ+1)​σ(zj;α(ℓ)​)

(eqs. 4.2, 4.30). At initialization all biases and weights are independent centered Gaussians with E[bi(ℓ)bj(ℓ)]=δijCb(ℓ)\mathbb{E}[b^{(\ell)}_ib^{(\ell)}_j]=\delta_{ij}C_b^{(\ell)}E[bi(ℓ)​bj(ℓ)​]=δij​Cb(ℓ)​ and E[Wi1j1(ℓ)Wi2j2(ℓ)]=δi1i2δj1j2CW(ℓ)/nℓ−1\mathbb{E}[W^{(\ell)}_{i_1j_1}W^{(\ell)}_{i_2j_2}]=\delta_{i_1i_2}\delta_{j_1j_2}C_W^{(\ell)}/n_{\ell-1}E[Wi1​j1​(ℓ)​Wi2​j2​(ℓ)​]=δi1​i2​​δj1​j2​​CW(ℓ)​/nℓ−1​ (eqs. 4.3–4.4). The first-layer metric is Gα1α2(1)=Cb(1)+CW(1)1n0∑jxj;α1xj;α2G^{(1)}_{\alpha_1\alpha_2}=C_b^{(1)}+C_W^{(1)}\frac1{n_0}\sum_jx_{j;\alpha_1}x_{j;\alpha_2}Gα1​α2​(1)​=Cb(1)​+CW(1)​n0​1​∑j​xj;α1​​xj;α2​​ (eq. 4.8), and ⟨F(zα1,…,zαm)⟩g\langle F(z_{\alpha_1},\dots,z_{\alpha_m})\rangle_{g}⟨F(zα1​​,…,zαm​​)⟩g​ denotes the expectation over a centered Gaussian vector (zα)(z_\alpha)(zα​) with covariance ggg (eq. 4.25), with σα≡σ(zα)\sigma_\alpha\equiv\sigma(z_\alpha)σα​≡σ(zα​).

Formalization targets

Goal: second-layer connected four-point correlator (eq. 4.43)

E[zi1;α1(2)zi2;α2(2)zi3;α3(2)zi4;α4(2)]∣connected=1n1[δi1i2δi3i4V(α1α2)(α3α4)(2)+δi1i3δi2i4V(α1α3)(α2α4)(2)+δi1i4δi2i3V(α1α4)(α2α3)(2)]\mathbb{E}\big[z^{(2)}_{i_1;\alpha_1}z^{(2)}_{i_2;\alpha_2}z^{(2)}_{i_3;\alpha_3}z^{(2)}_{i_4;\alpha_4}\big]\Big|_{\text{connected}}=\frac{1}{n_1}\Big[\delta_{i_1i_2}\delta_{i_3i_4}V^{(2)}_{(\alpha_1\alpha_2)(\alpha_3\alpha_4)}+\delta_{i_1i_3}\delta_{i_2i_4}V^{(2)}_{(\alpha_1\alpha_3)(\alpha_2\alpha_4)}+\delta_{i_1i_4}\delta_{i_2i_3}V^{(2)}_{(\alpha_1\alpha_4)(\alpha_2\alpha_3)}\Big]E[zi1​;α1​(2)​zi2​;α2​(2)​zi3​;α3​(2)​zi4​;α4​(2)​]​connected​=n1​1​[δi1​i2​​δi3​i4​​V(α1​α2​)(α3​α4​)(2)​+δi1​i3​​δi2​i4​​V(α1​α3​)(α2​α4​)(2)​+δi1​i4​​δi2​i3​​V(α1​α4​)(α2​α3​)(2)​]

with the four-point vertex V(α1α2)(α3α4)(2)=(CW(2))2[⟨σα1σα2σα3σα4⟩G(1)−⟨σα1σα2⟩G(1)⟨σα3σα4⟩G(1)]V^{(2)}_{(\alpha_1\alpha_2)(\alpha_3\alpha_4)}=\big(C_W^{(2)}\big)^2\big[\langle\sigma_{\alpha_1}\sigma_{\alpha_2}\sigma_{\alpha_3}\sigma_{\alpha_4}\rangle_{G^{(1)}}-\langle\sigma_{\alpha_1}\sigma_{\alpha_2}\rangle_{G^{(1)}}\langle\sigma_{\alpha_3}\sigma_{\alpha_4}\rangle_{G^{(1)}}\big]V(α1​α2​)(α3​α4​)(2)​=(CW(2)​)2[⟨σα1​​σα2​​σα3​​σα4​​⟩G(1)​−⟨σα1​​σα2​​⟩G(1)​⟨σα3​​σα4​​⟩G(1)​] (eq. 4.40).

Milestones

  1. Eq. (4.6) — first-layer mean vanishes.
  2. Eqs. (4.7)–(4.8) — first-layer two-point correlator δi1i2Gα1α2(1)\delta_{i_1i_2}G^{(1)}_{\alpha_1\alpha_2}δi1​i2​​Gα1​α2​(1)​.
  3. Eq. (4.9) — first-layer four-point correlator is the Wick value.
  4. Eq. (4.23) — the first-layer preactivations are exactly Gaussian with covariance δi1i2Gα1α2(1)\delta_{i_1i_2}G^{(1)}_{\alpha_1\alpha_2}δi1​i2​​Gα1​α2​(1)​.
  5. Eqs. (4.27), (4.28), (4.29) — activation correlators in the first layer as Gaussian expectations.
  6. Eq. (4.40) — two-point correlator of the second-layer metric fluctuation.
  7. Eq. (4.41) — second-layer two-point correlator.

Significance

These identities are the base case of the book's recursion (Chapter 4.3 onward) for the kernel and four-point vertex in deeper layers, and they show concretely that a finite-width network is not a Gaussian process: the 1/n11/n_11/n1​ connected correlator is generically nonzero for nonlinear σ\sigmaσ. The results are exact computations in the book; this mission formalizes them.

Difficulty

The second layer is a Gaussian conditional on the first layer, with a random covariance (the stochastic metric, eq. 4.36). Turning this into unconditional correlators requires conditioning on the first-layer preactivations, independence of different first-layer neurons, and the identification of first-layer activation correlators with Gaussian expectations over the metric G(1)G^{(1)}G(1), which may be degenerate (e.g. repeated inputs). Integrability of σ\sigmaσ against Gaussians must be controlled.

Formalization scope

  • Definitions from Mission II are reused: kron, inputKernel, WeightIndex. New definitions: mlpPreact (zi(ℓ)(x)z^{(\ell)}_i(x)zi(ℓ)​(x)), IsMLPInit (independent Gaussian biases and weights with layer-dependent Cb(ℓ),CW(ℓ)C_b^{(\ell)},C_W^{(\ell)}Cb(ℓ)​,CW(ℓ)​), firstLayerMetric (G(1)G^{(1)}G(1) on finitely many inputs), gaussAvg (⟨⋅⟩g\langle\cdot\rangle_g⟨⋅⟩g​, via Mathlib's multivariateGaussian, which handles singular positive-semidefinite ggg), and HasPolyGrowth.
  • Statements about activations assume σ\sigmaσ measurable with polynomial growth, the standing convention guaranteeing that all Gaussian averages are finite; this covers ReLU, tanh, sigmoid, GELU, SWISH and the perceptron step function.
  • The sample set is Fin D (for the specific statements, D=2D=2D=2 or 444 inputs, possibly repeated). n1>0n_1>0n1​>0 is assumed where the formulas divide by n1n_1n1​.

Selected references

  • D. A. Roberts, S. Yaida (with B. Hanin), The Principles of Deep Learning Theory, Cambridge University Press, 2022, Chapter 4. arXiv:2106.10165
  • R. M. Neal, Bayesian Learning for Neural Networks, Springer, 1996. doi:10.1007/978-1-4612-0745-0
11 thms2 active usersReviewed
🏆Completed
OptimizationProbability·Captain: naimengye

Understanding Machine Learning X: Gradient Descent, Subgradients and Stochastic Gradient DescentTextbook

Motivation

Chapter 13 showed that convex-Lipschitz-bounded and convex-smooth-bounded problems are learnable by regularized loss minimization; Chapter 14 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) shows how to learn them with the simplest possible algorithm. Gradient descent moves against the gradient with a fixed step size and outputs the average of its iterates; its analysis (Lemma 14.1) is a single telescoping identity that bounds ∑t⟨w(t)−w⋆,vt⟩\sum_t \langle w^{(t)} - w^\star, v_t\rangle∑t​⟨w(t)−w⋆,vt​⟩ for any sequence of directions vtv_tvt​, and this generality is the whole point. It gives the rate Bρ/TB\rho/\sqrt TBρ/T​ for convex Lipschitz functions (Corollary 14.2), extends to nondifferentiable functions through subgradients (Definition 14.4, Lemmas 14.3 and 14.7), and, because it never used that the directions were gradients, extends to stochastic gradient descent, in which each direction is random with a subgradient as its conditional expectation (Theorem 14.8). Applied to the risk LD(w)L_D(w)LD​(w) with a fresh example at each step, SGD is a learning algorithm whose sample complexity is the iteration count: B2ρ2/ϵ2B^2\rho^2/\epsilon^2B2ρ2/ϵ2 examples for convex-Lipschitz-bounded problems (Corollary 14.12) and 12B2β/ϵ212B^2\beta/\epsilon^212B2β/ϵ2 for convex-smooth-bounded ones (Theorem 14.13, Corollary 14.14). A projected, decreasing-step variant for strongly convex objectives has rate (ρ2/(2λT))(1+log⁡T)(\rho^2/(2\lambda T))(1 + \log T)(ρ2/(2λT))(1+logT) (Theorem 14.11).

Setting

Hypotheses are vectors in Rd\mathbb{R}^dRd; convex, Lipschitz and smooth losses, convex-Lipschitz-bounded and convex-smooth-bounded problems, and strong convexity are those of Mission IX. A vector vvv is a subgradient of fff at www if f(u)≥f(w)+⟨u−w,v⟩f(u) \ge f(w) + \langle u - w, v\ranglef(u)≥f(w)+⟨u−w,v⟩ for all uuu. The iterates of an update rule w(1)=0w^{(1)} = 0w(1)=0, w(t+1)=w(t)−ηvtw^{(t+1)} = w^{(t)} - \eta v_tw(t+1)=w(t)−ηvt​ are indexed from 000, and the output after TTT steps is wˉ=1T∑t<Tw(t)\bar w = \frac1T\sum_{t < T} w^{(t)}wˉ=T1​∑t<T​w(t). The randomness of SGD is modelled as the chapter uses it in §14.5: a sample z0,…,zT−1z_0, \dots, z_{T-1}z0​,…,zT−1​ drawn i.i.d. from DDD and an oracle ggg with vt=g(w(t),zt)v_t = g(w^{(t)}, z_t)vt​=g(w(t),zt​), where ggg is a stochastic subgradient oracle for fff if Ez∼D g(w,z)∈∂f(w)\mathbb{E}_{z \sim D}\, g(w, z) \in \partial f(w)Ez∼D​g(w,z)∈∂f(w) for every www. This is the book's condition E[vt∣w(t)]∈∂f(w(t))\mathbb{E}[v_t \mid w^{(t)}] \in \partial f(w^{(t)})E[vt​∣w(t)]∈∂f(w(t)) in the case where the direction depends on the past only through w(t)w^{(t)}w(t) and on fresh randomness, which is what every application in the book does; the expectation E[f(wˉ)]\mathbb{E}[f(\bar w)]E[f(wˉ)] is then an integral over DTD^TDT. For learning, g(w,z)g(w, z)g(w,z) is a subgradient of ℓ(⋅,z)\ell(\cdot, z)ℓ(⋅,z) at www, so that Ezg(w,z)\mathbb{E}_z g(w,z)Ez​g(w,z) is a subgradient of LDL_DLD​ at www (14.13). The projection of www onto a convex set HHH is a nearest point of HHH, and the strongly convex variant projects after each step with step size 1/(λt)1/(\lambda t)1/(λt).

Formalization targets

Goal: Theorem 14.8

For a convex fff, B,ρ>0B, \rho > 0B,ρ>0, a measurable oracle ggg with Ezg(w,z)∈∂f(w)\mathbb{E}_z g(w, z) \in \partial f(w)Ez​g(w,z)∈∂f(w) and ∥g(w,z)∥≤ρ\|g(w, z)\| \le \rho∥g(w,z)∥≤ρ, any w⋆w^\starw⋆ with ∥w⋆∥≤B\|w^\star\| \le B∥w⋆∥≤B, T≥1T \ge 1T≥1 and η=B/(ρT)\eta = B/(\rho\sqrt T)η=B/(ρT​): E[f(wˉ)]−f(w⋆)≤Bρ/T\mathbb{E}[f(\bar w)] - f(w^\star) \le B\rho/\sqrt TE[f(wˉ)]−f(w⋆)≤Bρ/T​; and for every ϵ>0\epsilon > 0ϵ>0, T≥B2ρ2/ϵ2T \ge B^2\rho^2/\epsilon^2T≥B2ρ2/ϵ2 gives E[f(wˉ)]−f(w⋆)≤ϵ\mathbb{E}[f(\bar w)] - f(w^\star) \le \epsilonE[f(wˉ)]−f(w⋆)≤ϵ.

Milestones

Lemma 14.1. For any directions, ∑t<T⟨w(t)−w⋆,vt⟩≤∥w⋆∥2/(2η)+(η/2)∑t<T∥vt∥2\sum_{t<T}\langle w^{(t)} - w^\star, v_t\rangle \le \|w^\star\|^2/(2\eta) + (\eta/2)\sum_{t<T}\|v_t\|^2∑t<T​⟨w(t)−w⋆,vt​⟩≤∥w⋆∥2/(2η)+(η/2)∑t<T​∥vt​∥2; with ∥vt∥≤ρ\|v_t\| \le \rho∥vt​∥≤ρ, ∥w⋆∥≤B\|w^\star\| \le B∥w⋆∥≤B and η=B/(ρT)\eta = B/(\rho\sqrt T)η=B/(ρT​) the average is at most Bρ/TB\rho/\sqrt TBρ/T​.

Corollary 14.2. Subgradient descent on a convex ρ\rhoρ-Lipschitz fff with η=B/(ρT)\eta = B/(\rho\sqrt T)η=B/(ρT​) has f(wˉ)−f(w⋆)≤Bρ/Tf(\bar w) - f(w^\star) \le B\rho/\sqrt Tf(wˉ)−f(w⋆)≤Bρ/T​ for every ∥w⋆∥≤B\|w^\star\| \le B∥w⋆∥≤B, and T≥B2ρ2/ϵ2T \ge B^2\rho^2/\epsilon^2T≥B2ρ2/ϵ2 gives ϵ\epsilonϵ.

Lemma 14.7. A convex fff on Rd\mathbb{R}^dRd is ρ\rhoρ-Lipschitz iff all its subgradients have norm at most ρ\rhoρ.

Lemma 14.9. For the projection vvv of www onto a convex HHH and u∈Hu \in Hu∈H, ∥w−u∥2≥∥v−u∥2\|w - u\|^2 \ge \|v - u\|^2∥w−u∥2≥∥v−u∥2.

Theorem 14.11. For λ\lambdaλ-strongly convex fff, a closed convex HHH, an oracle with Ez∥g(w,z)∥2≤ρ2\mathbb{E}_z\|g(w,z)\|^2 \le \rho^2Ez​∥g(w,z)∥2≤ρ2 and any w⋆∈Hw^\star \in Hw⋆∈H, the projected variant with ηt=1/(λt)\eta_t = 1/(\lambda t)ηt​=1/(λt) has E[f(wˉ)]−f(w⋆)≤(ρ2/(2λT))(1+log⁡T)\mathbb{E}[f(\bar w)] - f(w^\star) \le (\rho^2/(2\lambda T))(1 + \log T)E[f(wˉ)]−f(w⋆)≤(ρ2/(2λT))(1+logT).

Corollary 14.12. SGD on the risk of a convex-Lipschitz-bounded problem with T≥B2ρ2/ϵ2T \ge B^2\rho^2/\epsilon^2T≥B2ρ2/ϵ2 examples has E[LD(wˉ)]≤LD(w)+ϵ\mathbb{E}[L_D(\bar w)] \le L_D(w) + \epsilonE[LD​(wˉ)]≤LD​(w)+ϵ for every w∈Hw \in Hw∈H.

Theorem 14.13. For convex, β\betaβ-smooth, nonnegative losses and ηβ<1\eta\beta < 1ηβ<1, SGD with gradient directions has E[LD(wˉ)]≤11−ηβ(LD(w⋆)+∥w⋆∥2/(2ηT))\mathbb{E}[L_D(\bar w)] \le \frac{1}{1-\eta\beta}(L_D(w^\star) + \|w^\star\|^2/(2\eta T))E[LD​(wˉ)]≤1−ηβ1​(LD​(w⋆)+∥w⋆∥2/(2ηT)).

Corollary 14.14. For a convex-smooth-bounded problem with ℓ(0,z)≤1\ell(0,z) \le 1ℓ(0,z)≤1 and any ϵ>0\epsilon > 0ϵ>0, SGD with η=1/(β(1+3/ϵ))\eta = 1/(\beta(1 + 3/\epsilon))η=1/(β(1+3/ϵ)) and T≥12B2β/ϵ2T \ge 12B^2\beta/\epsilon^2T≥12B2β/ϵ2 has E[LD(wˉ)]≤LD(w)+ϵ\mathbb{E}[L_D(\bar w)] \le L_D(w) + \epsilonE[LD​(wˉ)]≤LD​(w)+ϵ for every w∈Hw \in Hw∈H.

Further items: Lemma 14.3, Claims 14.5, 14.6 and 14.10, and the hinge-loss subgradient of Example 14.2.

Significance

SGD is the algorithm behind most of modern machine learning, and Theorem 14.8 is its basic guarantee: dimension-free, independent of the form of fff beyond convexity, and with a sample complexity matching the regularization bound of Chapter 13 up to a constant. Lemma 14.1 isolates the deterministic identity that makes both gradient descent and its stochastic version work, and Lemma 14.7 is the bridge between the Lipschitz assumption of Chapter 12 and the bounded directions the analysis needs. The learning corollaries make the point that runs through Part II of the book: for convex problems, optimization and learning are the same activity, and one pass over the data suffices.

Nothing here is machine-checked. The chapter's statements are essentially correct, and the formalization records the reading choices rather than corrections: the i.i.d.-oracle model of the randomness, the subgradient form of gradient descent, the bound at every point of the ball rather than at a minimizer, and, in Corollary 14.14, the assumptions ϵ≤1\epsilon \le 1ϵ≤1 and 0∈H0 \in H0∈H under which the derivation from Theorem 14.13 goes through.

Difficulty

Lemma 14.1 is a completed square and a telescoping sum and is the intended entry point; the Bρ/TB\rho/\sqrt TBρ/T​ clause is the substitution of η\etaη. Corollary 14.2 is Lemma 14.1 with Jensen's inequality for the average and the subgradient inequality at each iterate, plus Lemma 14.7 to bound the directions. The subgradient facts need convex analysis: Lemma 14.3 in the direction "convex implies subgradients exist" is the supporting hyperplane theorem on Rd\mathbb{R}^dRd, which Mathlib does not offer directly; Claim 14.5 uses the first-order characterization of convexity for differentiable functions; Lemma 14.7's "Lipschitz implies bounded subgradients" is the book's one-line argument along u=w+ϵv/∥v∥u = w + \epsilon v/\|v\|u=w+ϵv/∥v∥. Theorem 14.8 is Lemma 14.1 plus the conditioning argument of the book, which in the i.i.d.-oracle model is Fubini on the product DTD^TDT: the iterate w(t)w^{(t)}w(t) is a measurable function of z0,…,zt−1z_0, \dots, z_{t-1}z0​,…,zt−1​, and integrating ⟨w(t)−w⋆,g(w(t),zt)⟩\langle w^{(t)} - w^\star, g(w^{(t)}, z_t)\rangle⟨w(t)−w⋆,g(w(t),zt​)⟩ over ztz_tzt​ first gives ⟨w(t)−w⋆,Ezg(w(t),z)⟩≥f(w(t))−f(w⋆)\langle w^{(t)} - w^\star, \mathbb{E}_z g(w^{(t)}, z)\rangle \ge f(w^{(t)}) - f(w^\star)⟨w(t)−w⋆,Ez​g(w(t),z)⟩≥f(w(t))−f(w⋆). Theorem 14.11 adds the projection lemma, the strong-convexity inequality of Claim 14.10, the telescoping of λt2(at−at+1)−λ2at\frac{\lambda t}{2}(a_t - a_{t+1}) - \frac\lambda2 a_t2λt​(at​−at+1​)−2λ​at​ and the harmonic sum ∑t≤T1/t≤1+log⁡T\sum_{t \le T} 1/t \le 1 + \log T∑t≤T​1/t≤1+logT; the second-moment hypothesis makes E∥w(t)−w⋆∥2\mathbb{E}\|w^{(t)} - w^\star\|^2E∥w(t)−w⋆∥2 finite inductively. Corollary 14.12 is Theorem 14.8 for f=LDf = L_Df=LD​ with the oracle of (14.13), which requires exchanging a subgradient inequality with the integral over zzz. Theorem 14.13 replaces the Lipschitz bound by self-boundedness, ∥∇ℓ∥2≤2βℓ\|\nabla\ell\|^2 \le 2\beta\ell∥∇ℓ∥2≤2βℓ, and rearranges; Corollary 14.14 is its arithmetic under the added assumptions. In all expectation statements the measurability of the iterates in the sample, from the measurability of the oracle, is a routine but necessary lemma.

Formalization scope

Iterates are defined by structural recursion, so no argmin is chosen; the sample-driven SGD stops after TTT updates; the projection onto HHH is a chosen nearest point, unique for closed convex HHH. Bounds are stated for every w⋆w^\starw⋆ in the ball (or in HHH) rather than for a minimizer, which is what the proofs give and is stronger. The oracle bound ∥g(w,z)∥≤ρ\|g(w,z)\| \le \rho∥g(w,z)∥≤ρ is required surely (the book: with probability 111); the almost-sure version is a routine extension. The second-moment hypothesis of Theorem 14.11 is a lower Lebesgue integral, so that a non-integrable oracle cannot satisfy it vacuously. The learning corollaries assume a measurable loss, nonnegative and bounded at the origin, so that the risks are genuine integrals, and a measurable selector of subgradients. Variable step sizes (§14.4.2), other averaging schemes (§14.4.3), SGD for regularized loss minimization (§14.5.3) and the exercises are not stated.

Trivializing readings are excluded: the expectations are over the product law of the examples with measurable integrands, the subgradient conditions are pointwise inequalities, and the iteration counts are the book's. Welcome contributions: Lemma 14.1 as a reusable telescoping lemma, the measurability of the SGD iterates, and the Fubini step that turns an oracle condition into the inequality (14.10).

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 14. doi:10.1017/CBO9781107298019
  • H. Robbins, S. Monro, A stochastic approximation method, Annals of Mathematical Statistics 22(3), 1951. doi:10.1214/aoms/1177729586
  • M. Zinkevich, Online convex programming and generalized infinitesimal gradient ascent, Proceedings of ICML, 2003.
  • A. Nemirovski, A. Juditsky, G. Lan, A. Shapiro, Robust stochastic approximation approach to stochastic programming, SIAM Journal on Optimization 19(4), 2009. doi:10.1137/070704277
  • S. Shalev-Shwartz, Online learning and online convex optimization, Foundations and Trends in Machine Learning 4(2), 2012. doi:10.1561/2200000018
12 thms2 active usersReviewed
🏆Completed
OptimizationProbabilityStatistics·Captain: naimengye

Understanding Machine Learning IX: Convex Learning Problems, Regularization and StabilityTextbook

Motivation

Chapters 12 and 13 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) leave binary classification for the general framework in which a hypothesis is a vector w∈Rdw \in \mathbb{R}^dw∈Rd and the loss ℓ(w,z)\ell(w, z)ℓ(w,z) is a convex function of www. Convexity makes the ERM problem tractable (Lemma 12.11), but Examples 12.8 and 12.9 show that convexity, even with a bounded class, does not by itself make a problem learnable: one-dimensional linear regression with the squared loss defeats every learner. The chapter therefore isolates two families, the convex-Lipschitz-bounded and the convex-smooth-bounded problems (Definitions 12.12 and 12.13), and Chapter 13 proves that both are learnable, not by ERM but by Regularized Loss Minimization with Tikhonov regularization, A(S)∈argmin⁡wLS(w)+λ∥w∥2A(S) \in \operatorname{argmin}_w L_S(w) + \lambda\|w\|^2A(S)∈argminw​LS​(w)+λ∥w∥2. The proof goes through a new idea: stability. Theorem 13.2 expresses the expected overfitting E[LD(A(S))−LS(A(S))]\mathbb{E}[L_D(A(S)) - L_S(A(S))]E[LD​(A(S))−LS​(A(S))] exactly as the expected effect of replacing one training example, strong convexity of the regularized objective bounds that effect (Lemma 13.5, Corollaries 13.6 and 13.7), and balancing the regularization against the fit gives oracle inequalities (Corollaries 13.8 and 13.10) and sample-complexity guarantees (Corollaries 13.9 and 13.11), with ridge regression as the worked example (Theorem 13.1).

Setting

Hypotheses are vectors in Rd\mathbb{R}^dRd with the Euclidean norm, as in Mission VI; risk, empirical risk, the product law of a sample and agnostic PAC learnability are those of Mission I. A problem is convex when HHH is convex and every ℓ(⋅,z)\ell(\cdot, z)ℓ(⋅,z) is convex; it is convex-Lipschitz-bounded with parameters ρ,B\rho, Bρ,B when moreover ∥w∥≤B\|w\| \le B∥w∥≤B on HHH and every ℓ(⋅,z)\ell(\cdot, z)ℓ(⋅,z) is ρ\rhoρ-Lipschitz on Rd\mathbb{R}^dRd, and convex-smooth-bounded with parameters β,B\beta, Bβ,B when every ℓ(⋅,z)\ell(\cdot, z)ℓ(⋅,z) is nonnegative and differentiable with a β\betaβ-Lipschitz gradient. Lipschitzness and smoothness are required on all of Rd\mathbb{R}^dRd because the RLM rule is unconstrained and its outputs need not lie in HHH. The RLM rule is a relation: www is an output on SSS if it minimizes LS(w)+λ∥w∥2L_S(w) + \lambda\|w\|^2LS​(w)+λ∥w∥2 over Rd\mathbb{R}^dRd, and a learner implements the rule if all its outputs are minimizers. For the losses of the chapter the minimizer exists and is unique. Given S=(z1,…,zm)S = (z_1, \dots, z_m)S=(z1​,…,zm​) and a further example z′z'z′, S(i)S^{(i)}S(i) is SSS with ziz_izi​ replaced by z′z'z′; a learner is on-average-replace-one-stable with rate ϵ(m)\epsilon(m)ϵ(m) if E(S,z′)∼Dm+1, i∼U(m)[ℓ(A(S(i)),zi)−ℓ(A(S),zi)]≤ϵ(m)\mathbb{E}_{(S,z') \sim D^{m+1},\, i \sim U(m)}[\ell(A(S^{(i)}), z_i) - \ell(A(S), z_i)] \le \epsilon(m)E(S,z′)∼Dm+1,i∼U(m)​[ℓ(A(S(i)),zi​)−ℓ(A(S),zi​)]≤ϵ(m) for every distribution. Strong convexity is Mathlib's StrongConvexOn, which is Definition 13.4 verbatim.

Expectations over samples are integrals against product laws. For them to be genuine, the theorems about arbitrary learners assume a jointly measurable loss bounded by a constant and a measurable learner, and the theorems about RLM assume a jointly measurable, nonnegative loss bounded at the origin and a measurable learner; for RLM the latter is automatic, since the minimizer is unique.

Formalization targets

Goal: Corollary 13.9

For a convex-Lipschitz-bounded problem with parameters ρ,B>0\rho, B > 0ρ,B>0 and the RLM learner with λ(m)=2ρ2/(B2m)\lambda(m) = \sqrt{2\rho^2/(B^2 m)}λ(m)=2ρ2/(B2m)​: for every distribution, every m≥1m \ge 1m≥1 and every w∈Hw \in Hw∈H, ES[LD(A(S))]≤LD(w)+ρB8/m\mathbb{E}_S[L_D(A(S))] \le L_D(w) + \rho B\sqrt{8/m}ES​[LD​(A(S))]≤LD​(w)+ρB8/m​; hence for every ϵ>0\epsilon > 0ϵ>0 and m≥8ρ2B2/ϵ2m \ge 8\rho^2B^2/\epsilon^2m≥8ρ2B2/ϵ2, ES[LD(A(S))]≤LD(w)+ϵ\mathbb{E}_S[L_D(A(S))] \le L_D(w) + \epsilonES​[LD​(A(S))]≤LD​(w)+ϵ.

Milestones

Examples 12.8–12.9. Linear regression on R\mathbb{R}R with the squared loss is not agnostic PAC learnable, over H=RH = \mathbb{R}H=R or over H=[−1,1]H = [-1, 1]H=[−1,1].

Theorem 13.2. For any measurable learner and m≥1m \ge 1m≥1, ES[LD(A(S))−LS(A(S))]\mathbb{E}_S[L_D(A(S)) - L_S(A(S))]ES​[LD​(A(S))−LS​(A(S))] equals the replace-one expectation of (13.6).

Lemma 13.5. λ∥w∥2\lambda\|w\|^2λ∥w∥2 is 2λ2\lambda2λ-strongly convex; a strongly convex function plus a convex one is strongly convex; at a minimizer uuu of a λ\lambdaλ-strongly convex fff, f(w)−f(u)≥λ2∥w−u∥2f(w) - f(u) \ge \frac\lambda2\|w - u\|^2f(w)−f(u)≥2λ​∥w−u∥2.

Corollary 13.6. For a convex ρ\rhoρ-Lipschitz loss and λ>0\lambda > 0λ>0, RLM satisfies ℓ(A(S(i)),zi)−ℓ(A(S),zi)≤2ρ2/(λm)\ell(A(S^{(i)}), z_i) - \ell(A(S), z_i) \le 2\rho^2/(\lambda m)ℓ(A(S(i)),zi​)−ℓ(A(S),zi​)≤2ρ2/(λm) for every S,z′,iS, z', iS,z′,i, is stable with that rate, and has ES[LD(A(S))−LS(A(S))]≤2ρ2/(λm)\mathbb{E}_S[L_D(A(S)) - L_S(A(S))] \le 2\rho^2/(\lambda m)ES​[LD​(A(S))−LS​(A(S))]≤2ρ2/(λm).

Corollary 13.7. For a convex, nonnegative, β\betaβ-smooth loss and λ≥2β/m\lambda \ge 2\beta/mλ≥2β/m, the replace-one expectation is at most (48β/(λm)) E[LS(A(S))](48\beta/(\lambda m))\,\mathbb{E}[L_S(A(S))](48β/(λm))E[LS​(A(S))], and at most 48βC/(λm)48\beta C/(\lambda m)48βC/(λm) if ℓ(0,z)≤C\ell(0, z) \le Cℓ(0,z)≤C.

Corollary 13.8. ES[LD(A(S))]≤LD(w∗)+λ∥w∗∥2+2ρ2/(λm)\mathbb{E}_S[L_D(A(S))] \le L_D(w^*) + \lambda\|w^*\|^2 + 2\rho^2/(\lambda m)ES​[LD​(A(S))]≤LD​(w∗)+λ∥w∗∥2+2ρ2/(λm) for every w∗w^*w∗.

Corollary 13.10. ES[LD(A(S))]≤(1+48β/(λm)) ES[LS(A(S))]≤(1+48β/(λm))(LD(w∗)+λ∥w∗∥2)\mathbb{E}_S[L_D(A(S))] \le (1 + 48\beta/(\lambda m))\,\mathbb{E}_S[L_S(A(S))] \le (1 + 48\beta/(\lambda m))(L_D(w^*) + \lambda\|w^*\|^2)ES​[LD​(A(S))]≤(1+48β/(λm))ES​[LS​(A(S))]≤(1+48β/(λm))(LD​(w∗)+λ∥w∗∥2).

Corollary 13.11. A convex-smooth-bounded problem with ℓ(0,z)≤1\ell(0, z) \le 1ℓ(0,z)≤1 is learned by RLM with λ=ϵ/(3B2)\lambda = \epsilon/(3B^2)λ=ϵ/(3B2) once m≥150βB2/ϵ2m \ge 150\beta B^2/\epsilon^2m≥150βB2/ϵ2.

Theorem 13.1. Ridge regression on the unit ball with labels in [−1,1][-1, 1][−1,1], λ=ϵ/(3B2)\lambda = \epsilon/(3B^2)λ=ϵ/(3B2) and m≥150B2/ϵ2m \ge 150 B^2/\epsilon^2m≥150B2/ϵ2 has ES[LD(A(S))]≤min⁡∥w∥≤BLD(w)+ϵ\mathbb{E}_S[L_D(A(S))] \le \min_{\|w\| \le B} L_D(w) + \epsilonES​[LD​(A(S))]≤min∥w∥≤B​LD​(w)+ϵ.

Further items: Lemma 12.11, the hinge loss as a convex surrogate of the 0–1 loss, the stability-implies-no-overfitting remark of §13.2, and the ridge regression system (13.4)–(13.5).

Significance

Stability is the third route to learnability in the book after uniform convergence and nonuniform learnability, and the only one that applies to convex-Lipschitz-bounded problems in general, for which uniform convergence can fail (the book's Exercise 13.2). The chain from strong convexity through replace-one stability to oracle inequalities is the template for the analysis of every regularized learner, and Theorem 13.2 is an exact identity, not a bound. Ridge regression, support vector machines (Chapter 15) and the regularized algorithms of later chapters are all instances.

Nothing here is machine-checked. The sample sizes of Corollary 13.11 and Theorem 13.1 are the book's 150150150. Chaining Corollary 13.10 as printed would need 216216216, but the derivation of Corollary 13.7 actually gives the stability rate 20β/(λm)20\beta/(\lambda m)20β/(λm), with which 909090 suffices.

Difficulty

Lemma 12.11 and the hinge surrogate are direct. Lemma 13.5 is elementary but part (3) needs the limit α→0\alpha \to 0α→0 of the strong-convexity inequality at a minimizer. Examples 12.8–12.9 require constructing the two finitely supported distributions of the book and computing the risk of a fixed output on each; the probability that all mmm examples are of the second type is at least 0.990.990.99 under both, and the deterministic learner's output on that sample decides which distribution defeats it. Theorem 13.2 is the exchangeability argument of the book: E[ℓ(A(S),z′)]=E[ℓ(A(S(i)),zi)]\mathbb{E}[\ell(A(S), z')] = \mathbb{E}[\ell(A(S^{(i)}), z_i)]E[ℓ(A(S),z′)]=E[ℓ(A(S(i)),zi​)] because swapping ziz_izi​ and z′z'z′ preserves the product law; the formal work is the measure-preserving transposition on Zm+1Z^{m+1}Zm+1 and the integrability of the functions involved. Corollaries 13.6 and 13.7 follow the book's pointwise derivation from (13.7) to (13.11) and (13.12) to (13.14), where the smooth case uses the self-boundedness ∥∇ℓ∥2≤2βℓ\|\nabla\ell\|^2 \le 2\beta\ell∥∇ℓ∥2≤2βℓ of nonnegative smooth functions and the inequality (a+b)2≤3(a2+b2)(a + b)^2 \le 3(a^2 + b^2)(a+b)2≤3(a2+b2); passing to expectations then uses Theorem 13.2 and, for the smooth case, the symmetry E[ℓ(A(S(i)),z′)]=E[ℓ(A(S),zi)]\mathbb{E}[\ell(A(S^{(i)}), z')] = \mathbb{E}[\ell(A(S), z_i)]E[ℓ(A(S(i)),z′)]=E[ℓ(A(S),zi​)]. Corollaries 13.8 to 13.11 are the arithmetic of the book once (13.16), E[LS(A(S))]≤LD(w∗)+λ∥w∗∥2\mathbb{E}[L_S(A(S))] \le L_D(w^*) + \lambda\|w^*\|^2E[LS​(A(S))]≤LD​(w∗)+λ∥w∗∥2, is in hand, with the corrected constant for 13.11. The ridge system is the gradient condition for a strongly convex quadratic, and Theorem 13.1 is Corollary 13.11 applied to 12(⟨w,x⟩−y)2\frac12(\langle w, x\rangle - y)^221​(⟨w,x⟩−y)2, which is ∥x∥2\|x\|^2∥x∥2-smooth with ℓ(0,z)=y2/2≤1/2\ell(0, z) = y^2/2 \le 1/2ℓ(0,z)=y2/2≤1/2 on the support. In every expectation statement the measurability of S↦A(S)S \mapsto A(S)S↦A(S) for the RLM rule, which the theorems take as a hypothesis, is provable from uniqueness of the minimizer and is worth a lemma.

Formalization scope

Losses are real-valued functions of a vector and an example; Lipschitz and smoothness conditions are global on Rd\mathbb{R}^dRd. The RLM rule is a minimizer relation with the regularization parameter as an explicit argument, and Corollary 13.9's learner uses a parameter depending on mmm. Stability quantifies over m≥1m \ge 1m≥1 and averages over the replaced index. Expectation statements carry measurability hypotheses that make every integral genuine, and the theorems about arbitrary learners assume a bounded loss. The minimum over HHH is stated as "for every w∈Hw \in Hw∈H", so no minimizer is needed. Definitions 12.1–12.9 and Claims 12.4–12.9 (general convex analysis) are not restated, nor are Examples 12.10–12.11, the discussion of §12.3 beyond the surrogate property, Remark 13.1, and Exercises 12.1–12.4 and 13.1–13.2.

Trivializing readings are excluded: the nonlearnability examples are stated as negations of the framework's learnability, the stability identity is an equality with both sides genuine integrals, and the constants of the oracle inequalities are the book's. Welcome contributions: the transposition invariance of product laws behind Theorem 13.2, the bound ∥A(S)∥2≤LS(0)/λ\|A(S)\|^2 \le L_S(0)/\lambda∥A(S)∥2≤LS​(0)/λ for RLM outputs, the measurability of the RLM minimizer, and the self-boundedness inequality (12.6).

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapters 12 and 13. doi:10.1017/CBO9781107298019
  • O. Bousquet, A. Elisseeff, Stability and generalization, Journal of Machine Learning Research 2, 2002.
  • S. Shalev-Shwartz, O. Shamir, N. Srebro, K. Sridharan, Learnability, stability and uniform convergence, Journal of Machine Learning Research 11, 2010.
  • A. N. Tikhonov, On the stability of inverse problems, Doklady Akademii Nauk SSSR 39(5), 1943.
  • S. Boyd, L. Vandenberghe, Convex Optimization, Cambridge University Press, 2004. doi:10.1017/CBO9780511804441
13 thms2 active usersReviewed
🏆Completed
AnalysisProbabilityTheoretical Computer Science·Captain: MiltMont

Flow Matching Theorem 1: Marginal Continuity EquationResearch Paper

From conditional motion to a marginal probability path

Flow matching models a changing probability distribution using a time-dependent velocity field. A conditional model specifies a density and a velocity separately for each conditioning point. The mathematical question is whether those conditional descriptions determine a velocity for the mixture distribution. This mission concerns the continuity-equation formulation of Theorem 1 of Lipman, Chen, Ben-Hamu, Nickel, and Le, Flow Matching for Generative Modeling (ICLR 2023). The source is arXiv:2210.02747v2, Section 3.1 and Appendix A.

Densities, velocities, and probability flux

Fix a natural number ddd and let E=RdE=\mathbb R^dE=Rd. The conditioning distribution QQQ is a Borel probability measure on EEE. At time ttt, position xxx, and conditioning point zzz, write ρ(t,x,z)\rho(t,x,z)ρ(t,x,z) for the conditional density and v(t,x,z)∈Ev(t,x,z)\in Ev(t,x,z)∈E for the conditional velocity. The variable xxx is integrated against Lebesgue measure; zzz is integrated against QQQ. These roles remain distinct even though both variables take values in the same space.

The conditional flux is F(t,x,z)=ρ(t,x,z)v(t,x,z)F(t,x,z)=\rho(t,x,z)v(t,x,z)F(t,x,z)=ρ(t,x,z)v(t,x,z). The marginal density, marginal flux, and marginal velocity are defined by

p(t,x)=∫Eρ(t,x,z) dQ(z),J(t,x)=∫EF(t,x,z) dQ(z),u(t,x)=p(t,x)−1J(t,x).p(t,x)=\int_E\rho(t,x,z)\,dQ(z),\qquad J(t,x)=\int_E F(t,x,z)\,dQ(z),\qquad u(t,x)=p(t,x)^{-1}J(t,x).p(t,x)=∫E​ρ(t,x,z)dQ(z),J(t,x)=∫E​F(t,x,z)dQ(z),u(t,x)=p(t,x)−1J(t,x).

These definitions express equations (6) and (8) using a probability measure rather than a data-density function. This representation also allows discrete conditioning distributions. Every conditional density is strictly positive and normalized on 0≤t≤10\leq t\leq10≤t≤1, jointly measurable in (x,z)(x,z)(x,z), and integrable in zzz at each fixed (t,x)(t,x)(t,x).

The divergence of a differentiable vector field is the sum of the diagonal entries of its derivative. A density and velocity satisfy the classical continuity equation when their flux is spatially differentiable and the density has time derivative equal to minus that divergence.

Formalization targets

The goal asserts that p(t,⋅)p(t,\cdot)p(t,⋅) is a positive probability density for every t∈[0,1]t\in[0,1]t∈[0,1] and that

∂tp(t,x)+div⁡x(p(t,x)u(t,x))=0(0<t<1, x∈E).\partial_t p(t,x)+\operatorname{div}_x\bigl(p(t,x)u(t,x)\bigr)=0\qquad(0<t<1,\ x\in E).∂t​p(t,x)+divx​(p(t,x)u(t,x))=0(0<t<1, x∈E).

The hypotheses require the conditional continuity equation for QQQ-almost every conditioning point, at each interior time and spatial point. They also specify a sufficient local domination package for differentiation under the integral. This is an explicit classical interpretation of the regularity qualification in the proof of Theorem 1.

Four supporting targets isolate the mathematical assertions used by this formulation: the probability-density property of equation (6); time differentiation under the conditioning integral; spatial divergence under the conditioning integral; and the velocity/flux identity corresponding to equation (8). The source contains these equations and operations rather than separately numbered supporting lemmas, so the milestone titles identify the relevant equation or proof passage.

What completing the formalization provides

The deliverable is a checked interface for passing from a measurable family of conditional continuity equations to the continuity equation of its mixture. It records which variables are differentiated, which measure is used for averaging, where positivity is needed, and which assumptions justify each analytic operation. The time and spatial differentiation lemmas are stated for general measures and integrands, making them reusable outside this particular probability model.

The mathematical result is already proved in the cited paper. The uploaded theorem items are open formalization targets, with explicit proof placeholders. Successful local compilation checks their types and imports; it does not establish their conclusions. The definition module contains no proof placeholders.

Analytic obligations

Pointwise differentiability of every conditional function does not by itself justify differentiating an integral over the conditioning variable. The regularity predicates therefore require a neighborhood independent of that variable, an integrable bound for the derivative norm throughout that neighborhood, and almost-everywhere measurability of the integrand and derivative. Time and space receive separate predicates because their derivatives take values in different spaces.

There is also a distinction between density normalization in xxx and integrability in zzz at a fixed position. The formal assumptions record both. A probability measure on the conditioning space does not make every measurable function integrable. These conditions prevent the totalized Bochner integral from silently supplying a default value where an intended integral fails to exist.

Formalization scope

Space is represented by Fin d → ℝ, with its standard finite-product Borel structure and Lebesgue measure. Its norm is the standard product norm used by mathlib. All finite dimensions, including dimension zero, are included. Time-dependent functions are defined on all real times, while density assumptions apply on the closed unit interval and derivative conclusions apply on its interior. No endpoint time derivative is asserted.

The regularity package is one sufficient realization of the source's Leibniz-rule assumption, not a claim to the weakest possible hypotheses. Conditional continuity equations may hold almost everywhere in the conditioning variable; their exceptional sets may depend on the fixed time and position. Spatial differentiability of the marginal flux is part of the conclusion, so the equation cannot be satisfied merely through the default value of an undefined derivative.

The target is the PDE formulation. It does not assert existence of a global ODE flow, uniqueness of transported measures, or equality with a flow pushforward. Those require a separate transport development. It also asserts no endpoint approximation to a data distribution and no theorem about optimization, neural networks, or Gaussian paths. No marginal continuity equation or differentiation–integration interchange is assumed as an input.

Required infrastructure consists of Bochner integration, finite-dimensional differentiation, finite sums of derivative coordinates, and product-measure integration. Contributions may prove the supporting targets or the goal directly while preserving their statements and the distinction between classical PDE and flow-transport claims.

Selected references

  • Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow Matching for Generative Modeling. ICLR 2023. arXiv:2210.02747v2, Section 2, Section 3.1, Theorem 1, equations (6), (8), and (26), and Appendix A's proof of Theorem 1.
  • mathlib contributors. ParametricIntegral.lean, revision 0df444a360eaa60ab8c11dca51a86af692955474. Differentiation under the integral.
6 thms2 active usersReviewed
🏆Completed
CombinatoricsStatistics·Captain: naimengye

Understanding Machine Learning VII: Boosting and AdaBoostTextbook

Motivation

Boosting answers a question raised by Kearns and Valiant: can a learner that is only slightly better than random guessing be turned into one that is arbitrarily accurate? Chapter 10 of Shalev-Shwartz and Ben-David, Understanding Machine Learning: From Theory to Algorithms (doi:10.1017/CBO9781107298019) defines γ-weak learnability (Definition 10.1), the PAC requirement with the accuracy ϵ\epsilonϵ replaced by the fixed value 1/2−γ1/2 - \gamma1/2−γ, and presents AdaBoost, the algorithm of Freund and Schapire that, given weak hypotheses, reweights the training set round by round and outputs a weighted majority vote. The chapter's main result (Theorem 10.2) is that the training error of AdaBoost's output decreases as e−2γ2Te^{-2\gamma^2 T}e−2γ2T in the number of rounds. Since the output is a halfspace over the predictions of TTT base hypotheses, the chapter then bounds the VC-dimension of that class (Lemma 10.3), so that the number of rounds becomes a knob for the bias–complexity tradeoff. Example 10.1 shows a concrete weak learner, ERM over decision stumps for the class of 3-piece classifiers on the line, and the chapter remarks that, statistically, weak learnability is no easier than strong learnability: a class of infinite VC-dimension is not weakly learnable either.

Setting

The framework is that of Missions I and IV: binary classification over a domain XXX with the 0–1 loss, distributions DDD over XXX with a labeling function fff, learners as functions of the sample, the VC-dimension, and ERM. Labels and hypotheses are Boolean, with ±1\pm 1±1 values obtained through sgn⁡(true)=1\operatorname{sgn}(\text{true}) = 1sgn(true)=1, sgn⁡(false)=−1\operatorname{sgn}(\text{false}) = -1sgn(false)=−1, and sign⁡(z)\operatorname{sign}(z)sign(z) is true exactly when z>0z > 0z>0. A γ-weak learner for HHH with the function mH:(0,1)→Nm_H : (0,1) \to \mathbb{N}mH​:(0,1)→N returns, for every δ\deltaδ, every DDD and every measurable fff realizable by HHH, a hypothesis with L(D,f)(h)≤1/2−γL_{(D,f)}(h) \le 1/2 - \gammaL(D,f)​(h)≤1/2−γ with probability at least 1−δ1 - \delta1−δ once m≥mH(δ)m \ge m_H(\delta)m≥mH​(δ); the failure event is bounded in outer measure as in Definition 3.1.

AdaBoost is formalized as a deterministic function of the sample S=(x1,y1),…,(xm,ym)S = (x_1, y_1), \dots, (x_m, y_m)S=(x1​,y1​),…,(xm​,ym​) and of the sequence of weak hypotheses h0,h1,…h_0, h_1, \dotsh0​,h1​,… that the weak learner returned. The distributions are defined by recursion: D(0)D^{(0)}D(0) is uniform, ϵt=∑iDi(t)1[ht(xi)≠yi]\epsilon_t = \sum_i D^{(t)}_i \mathbb{1}[h_t(x_i) \ne y_i]ϵt​=∑i​Di(t)​1[ht​(xi​)=yi​], wt=12log⁡(1/ϵt−1)w_t = \frac12 \log(1/\epsilon_t - 1)wt​=21​log(1/ϵt​−1), and Di(t+1)∝Di(t)exp⁡(−wtyiht(xi))D^{(t+1)}_i \propto D^{(t)}_i \exp(-w_t y_i h_t(x_i))Di(t+1)​∝Di(t)​exp(−wt​yi​ht​(xi​)); the output after TTT rounds is x↦sign⁡(∑t<Twtht(x))x \mapsto \operatorname{sign}(\sum_{t < T} w_t h_t(x))x↦sign(∑t<T​wt​ht​(x)). Rounds are indexed from 000, so D(0)D^{(0)}D(0) is the book's D(1)D^{(1)}D(1). The class L(B,T)L(B, T)L(B,T) of Equation (10.4) consists of the functions x↦sign⁡(∑t=1Twtht(x))x \mapsto \operatorname{sign}(\sum_{t=1}^T w_t h_t(x))x↦sign(∑t=1T​wt​ht​(x)) with ht∈Bh_t \in Bht​∈B. Decision stumps over R\mathbb{R}R are the threshold functions x↦[θ<x]x \mapsto [\theta < x]x↦[θ<x] and their negations x↦[x≤θ]x \mapsto [x \le \theta]x↦[x≤θ]; a 3-piece classifier is bbb outside [θ1,θ2][\theta_1, \theta_2][θ1​,θ2​] and −b-b−b inside, with θ1<θ2\theta_1 < \theta_2θ1​<θ2​.

Formalization targets

Goal: Theorem 10.2

If γ>0\gamma > 0γ>0 and every round t<Tt < Tt<T has 0<ϵt≤1/2−γ0 < \epsilon_t \le 1/2 - \gamma0<ϵt​≤1/2−γ, then the empirical 0–1 risk of AdaBoost's output after TTT rounds is at most exp⁡(−2γ2T)\exp(-2\gamma^2 T)exp(−2γ2T).

Milestones

§10.1. A class of infinite VC-dimension is not γ-weak-learnable for any γ>0\gamma > 0γ>0 (domain with measurable singletons, measurable hypotheses).

Example 10.1. There is one sample-size function with which every ERM learner over the decision stumps is a 1/121/121/12-weak learner for the 3-piece classifiers.

Exercise 10.3. For a nonempty sample and ϵt∈(0,1)\epsilon_t \in (0,1)ϵt​∈(0,1), the error of hth_tht​ under D(t+1)D^{(t+1)}D(t+1) is exactly 1/21/21/2.

Lemma 10.3. If T≥3T \ge 3T≥3 and VCdim(B)=d≥3\mathrm{VCdim}(B) = d \ge 3VCdim(B)=d≥3, then VCdim(L(B,T))≤T(d+1)(3log⁡(T(d+1))+2)\mathrm{VCdim}(L(B,T)) \le T(d+1)(3\log(T(d+1)) + 2)VCdim(L(B,T))≤T(d+1)(3log(T(d+1))+2).

Further item: Exercise 10.4 (1), VCdim(B)≤VCdim(L(B,T))\mathrm{VCdim}(B) \le \mathrm{VCdim}(L(B,T))VCdim(B)≤VCdim(L(B,T)) for T≥1T \ge 1T≥1.

Significance

Theorem 10.2 is the reason AdaBoost works and the template for every analysis of boosting: a potential function, here 1m∑ie−yift(xi)\frac1m \sum_i e^{-y_i f_t(x_i)}m1​∑i​e−yi​ft​(xi​), bounds the 0–1 training error and contracts by the factor 2ϵt(1−ϵt)≤1−4γ22\sqrt{\epsilon_{t}(1-\epsilon_{t})} \le \sqrt{1 - 4\gamma^2}2ϵt​(1−ϵt​)​≤1−4γ2​ at every round. Lemma 10.3 supplies the other half of the picture, an estimation-error bound growing only like T⋅VCdim(B)T \cdot \mathrm{VCdim}(B)T⋅VCdim(B) up to logarithms, so that Theorem 6.8 turns the pair into a generalization guarantee for boosting. The remark of §10.1 places weak learning in the statistical landscape of Part I: the VC-dimension characterizes it too, and the gain of boosting is computational.

Nothing here is machine-checked. Two points where the book's text needs care are built into the statements. The weight wtw_twt​ is undefined when ϵt=0\epsilon_t = 0ϵt​=0, and the algorithm's normalization then divides 000 by 000; in Lean the logarithm of a negative number is 000, so with ϵt=0\epsilon_t = 0ϵt​=0 the formal algorithm would ignore a perfect weak hypothesis and the bound could fail. The theorems therefore assume ϵt>0\epsilon_t > 0ϵt​>0, which is the case in which the book's formulas are defined. And the book's derivation of "infinite VC-dimension implies not weakly learnable" from the lower bound of Theorem 6.8 at ϵ=1/2−γ\epsilon = 1/2 - \gammaϵ=1/2−γ uses that bound outside the range in which Chapter 28 proves it; the statement itself is true, by the kmkmkm-point form of the No-Free-Lunch argument (Exercise 5.3 of Mission III) and Lemma B.1.

Difficulty

Exercise 10.4 (1) is a one-line embedding of BBB into L(B,T)L(B, T)L(B,T) with the weights (1,0,…,0)(1, 0, \dots, 0)(1,0,…,0) and is the entry point. Exercise 10.3 is the computation of the book: after the update, the weight of the mistakes of hth_tht​ is ewtϵte^{w_t}\epsilon_tewt​ϵt​ and the weight of the correct examples is e−wt(1−ϵt)e^{-w_t}(1 - \epsilon_t)e−wt​(1−ϵt​), and with ewt=(1−ϵt)/ϵte^{w_t} = \sqrt{(1-\epsilon_t)/\epsilon_t}ewt​=(1−ϵt​)/ϵt​​ these are equal. Theorem 10.2 needs, by induction on the round, the closed form Di(t)=e−yift(xi)/∑je−yjft(xj)D^{(t)}_i = e^{-y_i f_{t}(x_i)}/\sum_j e^{-y_j f_{t}(x_j)}Di(t)​=e−yi​ft​(xi​)/∑j​e−yj​ft​(xj​) of the distribution, the pointwise bound 1[sign⁡(f(x))≠y]≤e−yf(x)\mathbb{1}[\operatorname{sign}(f(x)) \ne y] \le e^{-y f(x)}1[sign(f(x))=y]≤e−yf(x) for the sign convention used, the telescoping product (10.2), the identity Zt+1/Zt=2ϵt(1−ϵt)Z_{t+1}/Z_t = 2\sqrt{\epsilon_t(1-\epsilon_t)}Zt+1​/Zt​=2ϵt​(1−ϵt​)​, the monotonicity of a(1−a)a(1-a)a(1−a) on [0,1/2][0, 1/2][0,1/2] and 1−a≤e−a1 - a \le e^{-a}1−a≤e−a. Lemma 10.3 counts dichotomies: Sauer's lemma bounds the restrictions of BBB to a shattered set by (em/d)d(em/d)^d(em/d)d, choosing TTT of them gives (em/d)dT(em/d)^{dT}(em/d)dT, the halfspaces of RT\mathbb{R}^TRT contribute (em/T)T(em/T)^T(em/T)T by Theorem 9.2, and the inequality 2m≤m(d+1)T2^m \le m^{(d+1)T}2m≤m(d+1)T is solved with Lemma A.1; the finite-VC lower bound m≤d+1m \le d + 1m≤d+1 handles small mmm, and the numeric slack of the book's chain must be checked. Example 10.1 combines a geometric observation, that one of the three regions of a 3-piece classifier has mass at most 1/31/31/3 and a stump agrees with the other two, with the agnostic guarantee for ERM over the stumps from Theorem 6.7, applied with accuracy 1/121/121/12; the best stump may only approach error 1/31/31/3 because constant functions are not stumps, and the slack absorbs this. The §10.1 remark is the argument sketched above.

Formalization scope

AdaBoost is a function of the sample and of the returned weak hypotheses; the weak learner's randomness and its failure probability (Remark 10.2) are not modelled, and Theorem 10.2 is the deterministic statement the book proves. Rounds are indexed from 000. The output uses sign⁡(0)=\operatorname{sign}(0) = sign(0)= negative, consistently with Mission VI. The class L(B,T)L(B,T)L(B,T) is a set of functions, so Lemma 10.3 is a statement about the VC-dimension of Mission IV, with the bound taken in N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞} through the integer part of the real right-hand side and the natural logarithm. Decision stumps are closed under negation, as the book's sign⁡(x−θ)⋅b\operatorname{sign}(x - \theta)\cdot bsign(x−θ)⋅b; constant functions are not stumps. The efficient ERM for decision stumps (§10.1.1), the face-recognition features (§10.4), Exercises 10.1, 10.2, 10.4 (2)–(3) and 10.5 are not stated. The claims of §10.3 that piecewise-constant classifiers with TTT pieces lie in L(stumps,T)L(\text{stumps}, T)L(stumps,T) and that this class shatters T+1T+1T+1 points depend on treating sign⁡(x−(−∞))\operatorname{sign}(x - (-\infty))sign(x−(−∞)) as a stump and on the sign convention; with real thresholds, L(stumps,2)L(\text{stumps}, 2)L(stumps,2) does not shatter three points under either convention, so these claims are not stated.

Trivializing readings are excluded: the weak-error hypotheses are strict where the book's formulas require it, the VC bounds are in N∪{∞}\mathbb{N} \cup \{\infty\}N∪{∞}, and the weak-learner guarantee quantifies over all distributions and all realizable labelings. Welcome contributions: the closed form of D(t)D^{(t)}D(t), the contraction identity for Zt+1/ZtZ_{t+1}/Z_tZt+1​/Zt​, and the dichotomy count behind Lemma 10.3.

Selected references

  • S. Shalev-Shwartz, S. Ben-David, Understanding Machine Learning: From Theory to Algorithms, Cambridge University Press, 2014, Chapter 10. doi:10.1017/CBO9781107298019
  • Y. Freund, R. E. Schapire, A decision-theoretic generalization of on-line learning and an application to boosting, Journal of Computer and System Sciences 55(1), 1997. doi:10.1006/jcss.1997.1504
  • R. E. Schapire, The strength of weak learnability, Machine Learning 5(2), 1990. doi:10.1007/BF00116037
  • M. Kearns, L. Valiant, Cryptographic limitations on learning Boolean formulae and finite automata, Journal of the ACM 41(1), 1994. doi:10.1145/174644.174647
  • R. E. Schapire, Y. Freund, Boosting: Foundations and Algorithms, MIT Press, 2012.
8 thms2 active usersReviewed
PreviousPage 5 of 8Next

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me