Internal regret, nonpositive-orthant projection, and Blackwell–Hart–Mas-Colell regret-matching #
This module formalizes internal regret, its quantitative relationship with external and swap
regret ([BM07b] §§4.2, 4.4 and Exercise 4.1), the Euclidean metric projection onto
the nonpositive orthant with Blackwell's quadratic potential bound ([Bla56];
[HMC00] §3, Figure 2, pp. 1135–1138 and Appendix Step M1, p. 1146), and the resulting
horizon-free, parameter-free O(√T) external and internal/swap regret-matching algorithms
([HMC00] Theorem A, eqs. (3.1)–(3.5), pp. 1133–1138, and Theorem B, eqs.
(4.2a)–(4.2b), p. 1139):
- External, internal, and swap regret functionals: for an action sequence
p : ℕ → ι → ℝand loss sequenceℓ : ℕ → ι → ℝoverTrounds,pairInternalRegret p ℓ T j kmeasures the cost saved by replacing actionjwithk(switchAction j k),swapRegretOf p ℓ T δmeasures the cost saved by an arbitrary modification ruleδ : ι → ι, andexternalRegretOf p ℓ T kcompares against the constant actionk. Swap regret decomposes as∑ j, pairInternalRegret p ℓ T j (δ j), bounding both internal regret (δ = switchAction j k) and external regret (δ = fun _ => k), while internal regret at mostRbounds swap regret by|ι| * R([BM07b] Exercise 4.1). - Euclidean projection onto
ℝ_{\le 0}^Land Blackwell's potential: reusingCslib.metricProjectionfromCslibFrontier.Foundations.Analysis.InnerProductSpace.MetricProjection, the nearest point ofnonposOrthant L = {z : EuclideanSpace ℝ L | ∀ l, z l ≤ 0}toyisl ↦ min 0 (y l)(metricProjection_nonposOrthant, Figure 2 of [HMC00], p. 1137), with squared residual norm∑ l, max 0 (y l) ^ 2. Whenever an instantaneous vector sequencer : ℕ → L → ℝsatisfies the Blackwell halfspace condition∑ l, max 0 (∑ s < t, r s l) * r t l ≤ 0for allt < T, the squared Euclidean distance of∑ t < T, r ttononposOrthant Lis at most∑ t < T, ∑ l, r t l ^ 2(blackwell_orthant_potential_le). - Blackwell external regret-matching (
regretMatchingProb): playingp_t(a) ∝ [R_t(a)]_+(and uniformly when no positive regrets exist; [HMC00] eq.(4.2b), p. 1139) satisfies the Blackwell condition with equality in every round without any learning-rate or horizon parameter, yieldingexternalRegretOf (regretMatchingProb ℓ) ℓ T k ≤ B √(|ι| T)whenever pairwise loss differences are bounded byB(regretMatching_externalRegret_le). - Hart–Mas-Colell stationary internal regret-matching (
internalRegretMatchingProb): playing a stationary distribution (Matrix.stationaryVec) of the positive-diagonal inertial transition matrix built from positive pairwise regrets ([HMC00] eqs.(2.2)and(3.1), Theorem A, pp. 1130–1138) satisfies balance equation(3.1)and the Blackwell condition onι × ιwith equality, guaranteeing anytime internal regret at mostB √((|ι| - 1) T)(internalRegretMatching_pairInternalRegret_le) and swap regret at mostB √(|ι| (|ι| - 1) T)(internalRegretMatching_swapRegret_le).
Main definitions #
Cslib.MachineLearning.OnlineLearning.Experts.switchAction: the single-pair modification rule mappingjtokand fixing all other actions ([BM07b] §4.4).Cslib.MachineLearning.OnlineLearning.Experts.pairInternalRegret,Cslib.MachineLearning.OnlineLearning.Experts.swapRegretOf,Cslib.MachineLearning.OnlineLearning.Experts.externalRegretOf: cumulative internal, swap, and external regret overTrounds.Cslib.MachineLearning.OnlineLearning.Experts.nonposOrthant: the closed convex cone{z : EuclideanSpace ℝ L | ∀ l, z l ≤ 0}.Cslib.MachineLearning.OnlineLearning.Experts.regretMatchingStep,Cslib.MachineLearning.OnlineLearning.Experts.regretMatchingProb: Blackwell's parameter-free external regret-matching learner (p_t(a) ∝ [R_t(a)]_+).Cslib.MachineLearning.OnlineLearning.Experts.internalRegretTransition,Cslib.MachineLearning.OnlineLearning.Experts.internalRegretMatchingProb: Hart and Mas-Colell's inertial regret-transition matrix and its stationary internal regret-matching learner.
Main results #
Cslib.MachineLearning.OnlineLearning.Experts.swapRegretOf_eq_sum_pairInternalRegret,Cslib.MachineLearning.OnlineLearning.Experts.swapRegretOf_switchAction,Cslib.MachineLearning.OnlineLearning.Experts.swapRegretOf_const,Cslib.MachineLearning.OnlineLearning.Experts.swapRegretOf_le_card_mul_of_pairInternalRegret_le: exact relationships among external, internal, and swap regret ([BM07b] §4.2 and Exercise 4.1).Cslib.MachineLearning.OnlineLearning.Experts.metricProjection_nonposOrthant,Cslib.MachineLearning.OnlineLearning.Experts.blackwell_orthant_potential_le: Euclidean projection ontoℝ_{\le 0}^Land Blackwell's quadratic potential bound ([HMC00] §3, Figure 2, and Step M1).Cslib.MachineLearning.OnlineLearning.Experts.regretMatching_externalRegret_le,Cslib.MachineLearning.OnlineLearning.Experts.regretMatching_externalRegret_le_of_mem_Icc,Cslib.MachineLearning.OnlineLearning.Experts.regretMatching_externalRegret_le_of_abs_le: anytimeO(√T)external-regret bounds forregretMatchingProb([HMC00] Theorem B).Cslib.MachineLearning.OnlineLearning.Experts.sum_mul_internalRegretTransition_balance,Cslib.MachineLearning.OnlineLearning.Experts.internalRegretMatching_pairInternalRegret_le,Cslib.MachineLearning.OnlineLearning.Experts.internalRegretMatching_swapRegret_le: Hart–Mas-Colell balance equation(3.1)and anytimeO(√T)internal- and swap-regret bounds ([HMC00] Theorem A).
References #
Internal, swap, and external regret functionals #
The single-pair modification rule switch_i(·, j, k) of [BM07b] (§4.4): replaces
action j by k and leaves every other action unchanged.
Swap regret against switchAction j k equals the pairwise internal regret pairInternalRegret
for (j, k) ([BM07b] §§4.2, 4.4).
When p t sums to 1 in each round t < T, swap regret against the constant map fun _ => k
equals external regret against k ([BM07b] §4.2).
Exercise 4.1 of [BM07b]: if every pairwise internal regret is at most R,
then swap regret against every modification rule δ : ι → ι is at most |ι| * R.
Euclidean projection onto ℝ_{\le 0}^L and Blackwell's quadratic potential #
The closed convex nonpositive orthant {z ∈ ℝ^L | ∀ l, z l ≤ 0} in EuclideanSpace ℝ L
([HMC00] §3, p. 1136, ℝ_-^L).
Figure 2 of [HMC00] (§3, p. 1137): the Euclidean metricProjection of y onto
nonposOrthant L is the coordinatewise negative part l ↦ min 0 (y l).
Coordinatewise, subtracting the projection onto nonposOrthant L yields the positive part
l ↦ max 0 (y l) ([HMC00] §3, p. 1137, λ(D_t) = D_t - [D_t]_- = [D_t]_+).
The squared distance of y to nonposOrthant L equals ∑ l, max 0 (y l) ^ 2.
Blackwell's quadratic potential bound for the nonpositive orthant ([Bla56];
[HMC00] §3, pp. 1135–1138, and Appendix Step M1, p. 1146): if a sequence of vectors
r : ℕ → L → ℝ satisfies the halfspace condition
∑ l, max 0 (∑ s ∈ range t, r s l) * r t l ≤ 0 at every round t < T, then
∑ l, max 0 (∑ t ∈ range T, r t l) ^ 2 ≤ ∑ t ∈ range T, ∑ l, r t l ^ 2.
The one-step telescope uses the nearest-point property metricProjection_eq_iff_forall_norm_le of
metricProjection (nonposOrthant L) and the Hilbert-space expansion norm_add_sq_real.
Coordinatewise consequence of blackwell_orthant_potential_le: every coordinate cumulative sum
is bounded by √(∑ t < T, ∑ l, r t l ^ 2).
Blackwell's external regret-matching (p_t(a) ∝ [R_t(a)]_+) #
One step of Blackwell's external regret-matching ([HMC00] eq. (4.2b),
p. 1139): normalizes a nonnegative regret vector rPos when its sum is positive, and plays the
uniform distribution 1 / |ι| otherwise.
Key proportionality identity of regretMatchingStep: for any nonnegative rPos,
rPos a = (∑ b, rPos b) * regretMatchingStep rPos a holds unconditionally (without splitting on
whether ∑ b, rPos b = 0).
Blackwell's external regret-matching learner ([Bla56]; [HMC00] §4(c),
eqs. (4.2a)–(4.2b), p. 1139): in round t, plays proportional to the positive cumulative
external regrets max 0 (externalRegretOf p ℓ t a), defaulting to the uniform distribution when no
action has positive regret.
Unfolding equation for regretMatchingProb: round t applies regretMatchingStep to the
positive cumulative external regrets from rounds < t.
In round 0, regretMatchingProb plays the uniform distribution 1 / |ι|.
regretMatchingProb is causal (an online algorithm): round t depends only on losses before
round t.
regretMatchingProb satisfies the Blackwell halfspace condition with equality in every
round t, for arbitrary real-valued losses.
Quadratic potential bound for regretMatchingProb: the sum of squared positive external regrets
after T rounds is at most ∑ t < T, ∑ a, (⟨p_t, ℓ_t⟩ - ℓ_t(a)) ^ 2.
Anytime O(√T) external regret of Blackwell's regret-matching ([Bla56];
[HMC00] §4(c), Theorem B, p. 1139, quantitative finite-horizon form): if pairwise loss
differences in rounds < T are bounded by B ≥ 0, then against every expert k : ι,
externalRegretOf (regretMatchingProb ℓ) ℓ T k ≤ B * √(|ι| * T).
Specialization of regretMatching_externalRegret_le to [0, 1]-valued losses
([BM07b] §4.2 convention): external regret at most √(|ι| * T) for all T.
Specialization of regretMatching_externalRegret_le to [-M, M]-valued losses: external regret
at most 2 * M * √(|ι| * T) for all T.
Hart–Mas-Colell stationary internal regret-matching (Theorem A) #
Inertial regret-transition matrix of [HMC00] (§2, eq. (2.2), p. 1130, and
Appendix p. 1144) with positive normalization μ = 1 + ∑ j', ∑ k', rPos j' k': off-diagonal entry
(j, k) is rPos j k / μ, and diagonal entry (j, j) carries the remaining positive inertia mass
1 - (∑ k' ≠ j, rPos j k') / μ.
Balance equation (3.1) of [HMC00] (§3, p. 1133, and (3.5) on p. 1137):
any stationary vector q of internalRegretTransition rPos (where rPos ≥ 0 and rPos j j = 0)
satisfies ∑ k, q k * rPos k j = q j * ∑ k, rPos j k for every action j.
Equations (3.3)–(3.4) of [HMC00] (§3, pp. 1136–1137): whenever q satisfies
the balance equation (3.1) for rPos, the inner product of rPos with the instantaneous
pairwise regret vector (j, k) ↦ q j * (v j - v k) vanishes identically for every loss/payoff
vector v : ι → ℝ.
Hart–Mas-Colell stationary internal regret-matching learner ([HMC00] §3,
eq. (3.1), Theorem A, p. 1133): in round t, chooses Matrix.stationaryVec of the inertial
regret-transition matrix formed from the positive cumulative internal regrets of rounds < t.
Unfolding equation for internalRegretMatchingProb.
internalRegretMatchingProb is causal (an online algorithm): round t depends only on losses
before round t.
internalRegretMatchingProb satisfies Hart and Mas-Colell's balance equation (3.1) in every
round t.
Quadratic potential bound for internalRegretMatchingProb: when pairwise loss differences in
rounds < T are bounded by B,
∑ p : ι × ι, max 0 (pairInternalRegret (internalRegretMatchingProb ℓ) ℓ T p.1 p.2) ^ 2 ≤ B ^ 2 * ((|ι| - 1 : ℕ) * T).
Quantitative Theorem A of [HMC00] (§3, pp. 1133, 1138): if pairwise loss
differences in rounds < T are bounded by B ≥ 0, then internalRegretMatchingProb achieves
pairwise internal regret at most B * √((|ι| - 1) * T) for every pair of actions (j, k) and
every horizon T.
Anytime O(√T) swap regret of Hart–Mas-Colell stationary regret-matching: by Cauchy–Schwarz
over the |ι| pairs (j, δ j), if pairwise loss differences in rounds < T are bounded by
B ≥ 0, then against every modification rule δ : ι → ι,
swapRegretOf (internalRegretMatchingProb ℓ) ℓ T δ ≤ B * √(|ι| * (|ι| - 1) * T).