Documentation

CslibFrontier.MachineLearning.OnlineLearning.FPL

Follow the Perturbed Leader #

In an online linear optimization problem ([KV05]; discussed in prose in [BlumMansour2007AGT, §4.7.1, p. 98]), a learner chooses in each round t an element a from a finite decision set α represented by action vectors v : α → ι → ℝ in ℝ^ι, observes a stage cost vector ℓ t : ι → ℝ, and incurs linear cost v a ⬝ᵥ ℓ t = ∑ i, v a i * ℓ t i.

Follow the Perturbed Leader (FPL, due to Hannan (1957) and analyzed for general online linear decision problems by Kalai and Vempala [KV05]) draws a random perturbation uniformly from the cube [0, 1 / ε]^ι (equivalently (1 / ε) • u for u uniform on the unit cube Set.Icc (0 : ι → ℝ) 1) and plays in round t the decision minimizing v a ⬝ᵥ (∑ s ∈ range t, ℓ s + (1 / ε) • u) (fplLeader, inducing the round-t distribution fplProb v ε ℓ t : α → ℝ).

Source note: [BlumMansour2007AGT, §4.7.1, p. 98] summarizes the online linear optimization model of Kalai and Vempala in prose without stating a numbered theorem, and [KV05] was not directly inspected. The uniform-cube formulation and regret bounds below are self-contained mathematical statements over real vectors and Lebesgue volume, without claiming offline-oracle running time, and are not registered as a cited theorem.

Proof architecture and connection to FTRL #

  1. Fixed-perturbation FPL via OCO.IsFTRL (isFTRL_fplLeader): For any fixed u : ι → ℝ and ε > 0, positive scaling by ε preserves the lexicographic leader (fplLeader_smul_pos), so t ↦ fplLeader v (ε • ∑ s ∈ range t, ℓ s + u) is an instance of Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL on Set.univ with linear regularizer ψ a = (1 / ε) * (v a ⬝ᵥ u). Applying OCO.IsFTRL.regret_le_add_sum_sub bounds the realized regret on each trajectory cell by D / ε plus the per-round stability differences v (x_t u) ⬝ᵥ ℓ t - v (x_{t + 1} u) ⬝ᵥ ℓ t.
  2. Cube translation-overlap stability (fpl_stability_step): Between round t and round t + 1, the scaled cumulative cost shifts by δ = ε • ℓ t. By translation invariance of Lebesgue volume on ℝ^ι, fplProb v ε ℓ (t + 1) a equals the volume of the leader region inside the shifted cube Set.Icc δ (1 + δ). Cancelling the overlap with Set.Icc 0 1 leaves only Set.Icc (0 : ι → ℝ) 1 \ Set.Icc δ (1 + δ), which is covered by |ι| coordinate slabs of total volume at most ∑ i, |δ i| = ε * ∑ i, |ℓ t i|.
  3. Expected regret bounds (fpl_regret_le, fpl_regret_le_sqrt, fpl_experts_regret_le_sqrt): Combining the D / ε perturbation term with T rounds of ε * R * A stability gives expected regret D / ε + ε * (R * A * T), and tuning ε = √(D / (R * A * T)) yields 2 * √(D * R * A * T). On the standard basis vectors Pi.single a 1 (fplExpertsProb), [0, 1] losses have D = 1, R = 1, and A = |ι|, specializing to 2 * √(|ι| * T).

Main definitions #

Main results #

References #

noncomputable def Cslib.MachineLearning.OnlineLearning.FPL.fplLeader {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (c : ι → ℝ) :
α

Deterministic leader choosing the smallest a : α (under LinearOrder α) minimizing the linear cost v a ⬝ᵥ c.

theorem Cslib.MachineLearning.OnlineLearning.FPL.fplLeader_le {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (c : ι → ℝ) (b : α) :
v (fplLeader v c) ⬝ᵥ c ≤ v b ⬝ᵥ c
theorem Cslib.MachineLearning.OnlineLearning.FPL.fplLeader_eq_iff {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (c : ι → ℝ) (a : α) :
fplLeader v c = a ↔ (∀ (b : α), v a ⬝ᵥ c ≤ v b ⬝ᵥ c) ∧ ∀ b < a, v a ⬝ᵥ c < v b ⬝ᵥ c

Exact characterization of fplLeader: a is chosen iff it minimizes v · ⬝ᵥ c and has strictly smaller cost than every b < a.

theorem Cslib.MachineLearning.OnlineLearning.FPL.fplLeader_smul_pos {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) {r : ℝ} (hr : 0 < r) (c : ι → ℝ) :
fplLeader v (r • c) = fplLeader v c

Positive scaling of the cost vector preserves fplLeader.

theorem Cslib.MachineLearning.OnlineLearning.FPL.isFTRL_fplLeader {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) {ε : ℝ} (hε : 0 < ε) (ℓ : ℕ → ι → ℝ) (u : ι → ℝ) :
OCO.IsFTRL Set.univ (fun (a : α) => 1 / ε * v a ⬝ᵥ u) (fun (t : ℕ) (a : α) => v a ⬝ᵥ ℓ t) fun (t : ℕ) => fplLeader v (ε • ∑ s ∈ Finset.range t, ℓ s + u)

Fixed-perturbation FPL is an instance of OCO.IsFTRL: for ε > 0 and perturbation u : ι → ℝ, t ↦ fplLeader v (ε • ∑ s ∈ range t, ℓ s + u) minimizes the FTRL objective with linear regularizer a ↦ (1 / ε) * (v a ⬝ᵥ u).

Measurability, unit-cube action distribution, and translation overlap #

noncomputable def Cslib.MachineLearning.OnlineLearning.FPL.fplProb {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (ε : ℝ) (ℓ : ℕ → ι → ℝ) (t : ℕ) (a : α) :

Probability that FPL with parameter ε plays decision a : α in round t under a uniform perturbation u on the unit cube Set.Icc (0 : ι → ℝ) 1.

theorem Cslib.MachineLearning.OnlineLearning.FPL.fplProb_nonneg {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (ε : ℝ) (ℓ : ℕ → ι → ℝ) (t : ℕ) (a : α) :
0 ≤ fplProb v ε ℓ t a
theorem Cslib.MachineLearning.OnlineLearning.FPL.fplProb_congr {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (ε : ℝ) {ℓ ℓ' : ℕ → ι → ℝ} {t : ℕ} (h : ∀ s < t, ℓ s = ℓ' s) :
fplProb v ε ℓ t = fplProb v ε ℓ' t
theorem Cslib.MachineLearning.OnlineLearning.FPL.sum_fplProb {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) (ε : ℝ) (ℓ : ℕ → ι → ℝ) (t : ℕ) :
∑ a : α, fplProb v ε ℓ t a = 1
theorem Cslib.MachineLearning.OnlineLearning.FPL.fpl_stability_step {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) {ε R : ℝ} (hε : 0 ≤ ε) (hR : 0 ≤ R) (ℓ : ℕ → ι → ℝ) (t : ℕ) (hspan : ∀ (a b : α), v a ⬝ᵥ ℓ t - v b ⬝ᵥ ℓ t ≤ R) :
∑ a : α, (fplProb v ε ℓ t a - fplProb v ε ℓ (t + 1) a) * v a ⬝ᵥ ℓ t ≤ ε * R * ∑ i : ι, |ℓ t i|

Per-round stability of fplProb: if v a ⬝ᵥ ℓ t - v b ⬝ᵥ ℓ t ≤ R for all a, b : α, then for ε ≥ 0, ∑ a, (fplProb v ε ℓ t a - fplProb v ε ℓ (t + 1) a) * (v a ⬝ᵥ ℓ t) ≤ ε * R * ∑ i, |ℓ t i|.

Expected regret bounds #

theorem Cslib.MachineLearning.OnlineLearning.FPL.fpl_regret_le {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) {ε D R A : ℝ} (hε : 0 < ε) (hR : 0 ≤ R) {ℓ : ℕ → ι → ℝ} {T : ℕ} (hD : ∀ (a b : α), ∀ u ∈ Set.Icc 0 1, v a ⬝ᵥ u - v b ⬝ᵥ u ≤ D) (hspan : ∀ t < T, ∀ (a b : α), v a ⬝ᵥ ℓ t - v b ⬝ᵥ ℓ t ≤ R) (hl1 : ∀ t < T, ∑ i : ι, |ℓ t i| ≤ A) (a_star : α) :
∑ t ∈ Finset.range T, ∑ a : α, fplProb v ε ℓ t a * v a ⬝ᵥ ℓ t ≤ ∑ t ∈ Finset.range T, v a_star ⬝ᵥ ℓ t + D / ε + ε * (R * A * ↑T)

Follow-the-Perturbed-Leader expected regret bound: suppose on the unit cube u ∈ Set.Icc (0 : ι → ℝ) 1 every pair a, b satisfies v a ⬝ᵥ u - v b ⬝ᵥ u ≤ D (for example when ∑ i, |v a i - v b i| ≤ D), and in every round t < T the cost vector ℓ t has decision span v a ⬝ᵥ ℓ t - v b ⬝ᵥ ℓ t ≤ R and L¹ norm ∑ i, |ℓ t i| ≤ A. Then for every ε > 0 and comparator a_star : α, expected cost is at most ∑ t ∈ range T, v a_star ⬝ᵥ ℓ t + D / ε + ε * (R * A * T).

theorem Cslib.MachineLearning.OnlineLearning.FPL.fpl_regret_le_sqrt {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [Nonempty α] [LinearOrder α] (v : α → ι → ℝ) {D R A : ℝ} (hD_pos : 0 < D) (hR_pos : 0 < R) (hA_pos : 0 < A) {ℓ : ℕ → ι → ℝ} {T : ℕ} (hT : 0 < T) (hD : ∀ (a b : α), ∀ u ∈ Set.Icc 0 1, v a ⬝ᵥ u - v b ⬝ᵥ u ≤ D) (hspan : ∀ t < T, ∀ (a b : α), v a ⬝ᵥ ℓ t - v b ⬝ᵥ ℓ t ≤ R) (hl1 : ∀ t < T, ∑ i : ι, |ℓ t i| ≤ A) (a_star : α) :
have ε := √(D / (R * A * ↑T)); ∑ t ∈ Finset.range T, ∑ a : α, fplProb v ε ℓ t a * v a ⬝ᵥ ℓ t ≤ ∑ t ∈ Finset.range T, v a_star ⬝ᵥ ℓ t + 2 * √(D * (R * A * ↑T))

Tuned FPL expected regret 2 * √(D * (R * A * T)): setting ε = √(D / (R * A * T)) balances the perturbation and stability terms to 2 * √(D * (R * A * T)).

Specialization to N-expert prediction #

noncomputable def Cslib.MachineLearning.OnlineLearning.FPL.fplExpertsProb {ι : Type u_2} [Fintype ι] [Nonempty ι] [LinearOrder ι] (ε : ℝ) (ℓ : ℕ → ι → ℝ) (t : ℕ) (a : ι) :

Follow-the-Perturbed-Leader specialized to the N-expert setting, representing each expert a : ι by its standard basis vector Pi.single a 1.

theorem Cslib.MachineLearning.OnlineLearning.FPL.fplExpertsProb_def {ι : Type u_2} [Fintype ι] [Nonempty ι] [LinearOrder ι] (ε : ℝ) (ℓ : ℕ → ι → ℝ) (t : ℕ) :
fplExpertsProb ε ℓ t = fplProb (fun (a : ι) => Pi.single a 1) ε ℓ t

fplExpertsProb ε is a causal online experts algorithm (Experts.IsOnlineAlgorithm).

theorem Cslib.MachineLearning.OnlineLearning.FPL.fpl_experts_regret_le_sqrt {ι : Type u_2} [Fintype ι] [Nonempty ι] [LinearOrder ι] {ℓ : ℕ → ι → ℝ} {T : ℕ} (hT : 0 < T) (hℓ : ∀ t < T, ∀ (i : ι), ℓ t i ∈ Set.Icc 0 1) (k : ι) :
have ε := √(1 / (↑(Fintype.card ι) * ↑T)); ∑ t ∈ Finset.range T, ∑ a : ι, fplExpertsProb ε ℓ t a * ℓ t a ≤ ∑ t ∈ Finset.range T, ℓ t k + 2 * √(↑(Fintype.card ι) * ↑T)

FPL expected regret 2 * √(|ι| * T) for N experts on [0, 1] losses: on the standard basis vectors Pi.single a 1, the one-sided cube span is D = 1, the stage span is R = 1, and the L¹ loss bound is A = |ι|, giving 2 * √(|ι| * T) with ε = √(1 / (|ι| * T)).