Follow the regularized leader #
In online convex optimization a learner plays a point x t of a set K and then suffers the loss
ℓ t (x t). Follow the regularized leader (FTRL) [Orabona2019, Algorithm 7.1]
[Hazan2022, Algorithm 13] plays a minimizer over K of a regularizer plus the losses seen so far:
- Constant regularizer (
IsFTRL K ψ ℓ x):x t ∈ argmin_{y ∈ K} ftrlObjective ψ ℓ t y,ftrlObjective ψ ℓ t y = ψ y + ∑ s < t, ℓ s y. - Time-varying regularizers (
IsTimeVaryingFTRL K ψ ℓ x, forψ : ℕ → E → ℝ):x t ∈ argmin_{y ∈ K} timeVaryingFtrlObjective ψ ℓ t y,timeVaryingFtrlObjective ψ ℓ t y = ψ t y + ∑ s < t, ℓ s y.
Rounds are indexed from 0, so x t, ℓ t and ψ t are the source's x_{t+1}, ℓ_{t+1} and
ψ_{t+1}. Minimizers need not be unique, so IsFTRL and IsTimeVaryingFTRL describe families of
runs. They exist when K is compact and nonempty and the regularizers and losses are continuous on
K (exists_isFTRL, exists_isTimeVaryingFTRL), and the run is unique under positive strong
convexity (IsFTRL.unique, IsTimeVaryingFTRL.unique). Both predicates constrain the realized
sequence pointwise, and x t depends only on ℓ 0, …, ℓ (t - 1), so every bound below also holds
when an adaptive adversary chooses ℓ t after seeing x 0, …, x t. lazyOGD constructs such a
run explicitly for adaptively chosen gradients.
The analysis follows [Orabona2019, §7]. The regret equalities timeVaryingFtrl_regret_eq and
ftrl_regret_eq [Orabona2019, Lemma 7.1] hold for every sequence. With the minimality of x T
they give the "be the leader" / stability bounds IsFTRL.regret_le_add_sum_sub
[Hazan2022, Lemma 5.3] and IsTimeVaryingFTRL.regret_le_add_sum_sub (plus its specialization
IsTimeVaryingFTRL.regret_le_add_sum_sub_of_mono for non-decreasing regularizers
ψ t y ≤ ψ (t + 1) y on K).
For local-norm stability [Orabona2019, Lemma 7.8], given per-round functions N : ℕ → E → ℝ
(seminorms, norms, ℓ¹, or local Mahalanobis norms) such that F t (timeVaryingFtrlObjective)
satisfies quadratic growth F t (x t) + μ t / 2 * N t (x t - y) ^ 2 ≤ F t y (μ t > 0) and
ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y) on K, IsTimeVaryingFTRL.regret_le_of_localNorm and
IsTimeVaryingFTRL.regret_le_of_localNorm_succ bound the regret by
ψ T u - ψ 0 (x 0) + ∑ t, L t ^ 2 / (2 μ t). When ψ t is μ t-strongly convex with respect to
N t (StrongConvexOnWrt) and the losses are convex, F t inherits that quadratic growth
automatically (IsTimeVaryingFTRL.regret_le_of_strongConvexOnWrt). For ψ t y = R y / η t with a
σ-strongly convex R (with respect to N, not required to be nonnegative) and nonincreasing
η t > 0, shifting by -R (x 0) / η t preserves minimizers and makes the regularizers
nondecreasing on K, yielding [Orabona2019, Corollary 7.9] (IsTimeVaryingFTRL.regret_le_div) and
the anytime O(√T) regret bounds with η t = c / √(t + 1)
(IsTimeVaryingFTRL.regret_le_sqrt_anytime, IsTimeVaryingFTRL.regret_le_sqrt_anytime_optimal).
For a constant regularizer ψ, the same argument gives IsFTRL.regret_le_wrt,
IsFTRL.regret_le_div_wrt, IsFTRL.regret_le_sqrt_wrt for an arbitrary N : E → ℝ, together with
their ambient-norm forms IsFTRL.regret_le, IsFTRL.regret_le_div, IsFTRL.regret_le_sqrt, and
FTRL with linearized losses [Orabona2019, §7.3] (IsFTRL.regret_le_of_subgradient,
IsFTRL.regret_le_of_hasFDerivWithinAt).
In a real inner product space, for a nonempty complete convex K and η > 0, with the Euclidean
regularizer ‖y - x₀‖ ^ 2 / (2 η) and linear losses y ↦ ⟪g t, y⟫, the FTRL iterate is the
metric projection of x₀ - η ∑ s < t, g s onto K (isFTRL_euclidean_iff). This is lazy
projected online gradient descent, or dual averaging [Hazan2022, §5.4.1]. lazyOGD runs it with
gradients grad t (x t) chosen at the played points (lazyOGD_regret_le,
lazyOGD_regret_le_fixed).
Main definitions #
Cslib.MachineLearning.OnlineLearning.OCO.ftrlObjective: the regularized cumulative lossψ y + ∑ s < t, ℓ s y.Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL: everyx tminimizesftrlObjective ψ ℓ toverK.Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrlObjective: the time-varying FTRL objectiveψ t y + ∑ s < t, ℓ s y.Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL: everyx tminimizestimeVaryingFtrlObjective ψ ℓ toverK.Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD: lazy projected online gradient descent.
Main results #
Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrl_regret_eq,Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrl_regret_eq_succ,Cslib.MachineLearning.OnlineLearning.OCO.ftrl_regret_eq: the FTRL regret equalities [Orabona2019, Lemma 7.1].Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.add_sum_le: the "be the leader" inequality [Hazan2022, Lemma 5.4];IsFTRL.regret_le_add_sum_subis [Hazan2022, Lemma 5.3];IsTimeVaryingFTRL.regret_le_add_sum_suband.regret_le_add_sum_sub_of_monoare the time-varying stability bounds.Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_of_localNorm,.regret_le_of_localNorm_succ,.regret_le_of_strongConvexOnWrt,.regret_le_div,.regret_le_sqrt_anytime,.regret_le_sqrt_anytime_optimal: time-varying local-norm stability [Orabona2019, Lemma 7.8] and anytimeO(√T)regret [Orabona2019, Corollary 7.9].Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_wrt,.regret_le_div_wrt,.regret_le_sqrt_wrt,IsFTRL.regret_le,.regret_le_div,.regret_le_sqrt: regret bounds for a constant strongly convex regularizer.Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_of_subgradient: FTRL with linearized losses [Orabona2019, §7.3].Cslib.MachineLearning.OnlineLearning.OCO.exists_isFTRL,exists_isTimeVaryingFTRL,IsFTRL.unique,IsTimeVaryingFTRL.unique: existence and uniqueness.Cslib.MachineLearning.OnlineLearning.OCO.isFTRL_euclidean_iff: Euclidean FTRL with linear losses is lazy projection [Hazan2022, §5.4.1].Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_regret_le,Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_regret_le_fixed: regret of lazy projected online gradient descent.
References #
The FTRL regret equality [Orabona2019, Lemma 7.1], for a constant regularizer. It holds
for every sequence x and comparator u; FTRL makes the last two terms F T (x T) - F T u
nonpositive for u ∈ K, where F = ftrlObjective ψ ℓ.
Be the leader [Hazan2022, Lemma 5.4]: playing each round's minimizer one round early
does at least as well as every fixed u ∈ K, regularizer included.
Regret is at most stability [Hazan2022, Lemma 5.3]: the regret of FTRL against u ∈ K is
at most ψ u - ψ (x 0) plus the stability terms ℓ t (x t) - ℓ t (x (t + 1)).
Existence of FTRL runs: on a compact nonempty K, with a regularizer and losses continuous
on K, every round's objective has a minimizer on K.
x is a run of follow the regularized leader on K with time-varying regularizers ψ and
losses ℓ [Orabona2019, Algorithm 7.1]: every x t lies in K and minimizes
ψ t + ∑ s < t, ℓ s there.
Constant-regularizer FTRL is the special case of IsTimeVaryingFTRL with fun _ => ψ.
Shifting each round's regularizer by a constant independent of y preserves
IsTimeVaryingFTRL.
The time-varying FTRL regret equality [Orabona2019, Lemma 7.1]: holds for every sequence
x and comparator u. When x is an FTRL run and u ∈ K, the final difference
F T (x T) - F T u is nonpositive.
Time-varying FTRL regret equality over T + 1 rounds without ψ (T + 1) (compare
[Orabona2019, Lemma 7.1]): isolates the final round's stability term
F T (x T) + ℓ T (x T) - (F T u + ℓ T u), so only ψ 0, …, ψ T and x 0, …, x T appear.
Time-varying FTRL stability inequality [Orabona2019, Lemma 7.1]: bounds regret by
ψ T u - ψ 0 (x 0) plus the per-round stability terms ℓ t (x t) - ℓ t (x (t + 1)) minus the
regularizer increments ψ (t + 1) (x (t + 1)) - ψ t (x (t + 1)).
For nondecreasing regularizers (ψ t y ≤ ψ (t + 1) y on K), the regularizer increments drop
out of the time-varying FTRL stability bound.
Existence of time-varying FTRL runs: on a compact nonempty K, with regularizers and losses
continuous on K, every round's objective has a minimizer on K.
The time-varying FTRL objective inherits StrongConvexOnWrt from ψ t when the losses are
convex.
With μ t-strongly convex regularizers (μ t > 0) with respect to positive-definite local
norms N t and convex losses, the time-varying FTRL run is unique.
Local-norm stability step for time-varying FTRL [Orabona2019, Lemma 7.8]: if ψ t ≤ ψ (t+1)
on K, F t satisfies local-norm quadratic growth at x t with modulus μ > 0, and
ℓ t (x t) - ℓ t y ≤ L * N (x t - y) on K, then the round-t stability term in the regret
equality is at most L ^ 2 / (2 * μ).
Time-varying FTRL regret under local-norm quadratic growth [Orabona2019, Lemmas 7.1, 7.8]:
if ψ t y ≤ ψ (t + 1) y on K, each F t satisfies local-norm quadratic growth at x t with
modulus μ t > 0 and local norm N t, and ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y) for t < T,
then against every u ∈ K,
∑ t < T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t < T, L t ^ 2 / (2 * μ t).
Time-varying FTRL regret over T + 1 rounds without ψ (T + 1): uses the T-th
regularizer ψ T u rather than ψ (T + 1) u, by applying local-norm stability directly to
F T (x T) + ℓ T (x T) - (F T u + ℓ T u).
Time-varying FTRL regret with local-norm strongly convex regularizers [Orabona2019, Lemmas 7.1 and 7.8].
Time-varying FTRL regret over T + 1 rounds with local-norm strongly convex regularizers,
using ψ T u rather than ψ (T + 1) u.
Time-varying learning rate [Orabona2019, Corollary 7.9]: FTRL with regularizers
ψ t y = R y / η t, for a σ-strongly convex R (with respect to N, not required to be
nonnegative) and positive nonincreasing learning rates η, has regret over T + 1 rounds at most
(R u - R (x 0)) / η T + ∑ t ≤ T, η t * L t ^ 2 / (2 * σ) against every u ∈ K.
Anytime O(√T) regret for time-varying FTRL [Orabona2019, Corollary 7.9]: with
η t = c / √(t + 1) (c > 0), a σ-strongly convex R (w.r.t. N) with oscillation at most
D ^ 2 on K, convex losses and ℓ t (x t) - ℓ t y ≤ L * N (x t - y), the regret over any
horizon T : ℕ against every u ∈ K is at most (D ^ 2 / c + c * L ^ 2 / σ) * √T.
Optimally tuned anytime O(√T) regret for time-varying FTRL: choosing
η t = (D * √σ / L) / √(t + 1) gives regret at most 2 * D * L * √(T / σ) for every horizon
T : ℕ against every u ∈ K.
Constant-regularizer FTRL regret with respect to an arbitrary N : E → ℝ
([Orabona2019, Lemmas 7.1 and 7.8]): covers ℓ¹, ℓ² or any non-ambient norm.
Constant learning rate with respect to N : E → ℝ: FTRL with regularizer R / η for a
σ-strongly convex R (w.r.t. N) and σ, η > 0 has regret at most
(R u - R (x 0)) / η + η / (2 * σ) * ∑ t < T, L t ^ 2 against every u ∈ K.
Tuned learning rate with respect to N : E → ℝ: if R is σ-strongly convex (w.r.t. N)
with R y - R z ≤ D ^ 2 on K, the losses are convex and ℓ t (x t) - ℓ t y ≤ L * N (x t - y)
for t < T, then FTRL with regularizer R / (D / L * √(2 * σ / T)) has regret at most
D * L * √(2 * T / σ) over T ≥ 1 rounds against every u ∈ K.
The FTRL objective inherits the strong convexity of the regularizer.
With a μ-strongly convex regularizer (μ > 0) and convex losses, the FTRL run is unique.
Stability of FTRL (compare [Orabona2019, Lemma 7.8]): with a μ-strongly convex
regularizer and convex losses, if ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖ for y ∈ K, then the
stability term of round t in the regret equality is at most L ^ 2 / (2 μ).
Regret of FTRL with a strongly convex regularizer ([Orabona2019, Lemmas 7.1 and 7.8];
compare [Hazan2022, Theorem 5.2]). If ψ is μ-strongly convex on K with μ > 0, the losses
are convex on K and ℓ t (x t) - ℓ t y ≤ L t * ‖x t - y‖ for y ∈ K (for instance, ℓ t is
L t-Lipschitz on K), then the regret against every u ∈ K is at most
ψ u - ψ (x 0) + ∑ t < T, L t ^ 2 / (2 μ).
Constant learning rate ([Orabona2019, Corollary 7.9] with η_t = η): FTRL with the
regularizer R / η, for a σ-strongly convex R with σ, η > 0, has regret at most
(R u - R (x 0)) / η + η / (2 σ) ∑ t < T, L t ^ 2 against every u ∈ K. Since x 0 minimizes
R on K, R u - R (x 0) = R u - min_K R.
Tuned learning rate. If R is σ-strongly convex on K with R y - R z ≤ D ^ 2 for
y z ∈ K, the losses are convex and ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖ on K, then FTRL with
regularizer R / η for η = D / L * √(2 σ / T) has regret at most D L √(2 T / σ) over
T ≥ 1 rounds against every u ∈ K.
FTRL with linearized losses [Orabona2019, §7.3]: run FTRL on the linear losses given by
subgradients g t of convex losses f t at the played points, i.e.
f t (x t) + g t (y - x t) ≤ f t y for y ∈ K. With a μ-strongly convex regularizer, the
regret on the losses f t against every u ∈ K is at most
ψ u - ψ (x 0) + ∑ t < T, ‖g t‖ ^ 2 / (2 μ), with the operator norm (dual norm) ‖g t‖. The
g t may depend on x t, so this covers gradients revealed at the played points.
FTRL with linearized losses for convex losses f t differentiable within K at the played
points, with derivatives f' t (IsFTRL.regret_le_of_subgradient with g t = f' t).
Euclidean FTRL is lazy projection [Hazan2022, §5.4.1]: with the regularizer
‖y - x₀‖ ^ 2 / (2 η) and linear losses y ↦ ⟪g t, y⟫, a sequence is an FTRL run on a nonempty
complete convex K iff each x t is the metric projection of x₀ - η ∑ s < t, g s onto K.
The unprojected state of lazy projected online gradient descent: y 0 = x₀ and
y (t + 1) = y t - η • grad t (Π_K (y t)).
Lazy projected online gradient descent [Hazan2022, §5.4.1]: play the metric projection
onto K of the unprojected state, which accumulates the gradients revealed at the played points.
The unprojected state is x₀ minus η times the sum of the gradients revealed so far.
Lazy projected online gradient descent is FTRL with the Euclidean regularizer
‖y - x₀‖ ^ 2 / (2 η) on the linear losses y ↦ ⟪grad t (x t), y⟫ given by the gradients at the
played points.
Regret of lazy projected online gradient descent. If the gradients satisfy the subgradient
inequality f t x + ⟪grad t x, y - x⟫ ≤ f t y on K, then for every η > 0 the regret against
every u ∈ K is at most ‖u - x₀‖ ^ 2 / (2 η) + η / 2 * ∑ t < T, ‖grad t (x t)‖ ^ 2. This is the
Euclidean case of IsFTRL.regret_le (strong convexity 1 / η, L t = ‖grad t (x t)‖).
Tuned lazy projected online gradient descent: if the gradients satisfy the subgradient
inequality f t x + ⟪grad t x, y - x⟫ ≤ f t y and have norm at most G on K, ‖u - x₀‖ ≤ D
and D, G > 0, the constant step size η = D / (G √T) gives regret at most G D √T over
T ≥ 1 rounds (compare the 2 G D √T of [Hazan2022, §5.4.1], and ogd_regret_le_fixed for
the agile variant).