Bandit Algorithms
Tor Lattimore and Csaba Szepesvári
- Location
- Ch. 11–12
- Pages
- online pp. 148–172
Teaching chapter · canonical scope Compiled
The scoped canonical generated EXP3 route compiles from exponential-weight potentials and importance-weighted conditional moments through horizon-tuned expected and best-arm high-probability endpoints, plus a distinct fixed-process all-positive-prefix realized-regret event and a sparse-loss extension.
Who should read this. Read Foundations first; later sections use the Probability layer heavily.
Textbook crosswalk
The Book Map is a curated formalization curriculum anchored in Bandit Algorithms, not a chapter-for-chapter reproduction of one book. Page numbers below use its free online edition; companion papers cover algorithm-specific results.
Tor Lattimore and Csaba Szepesvári
Normalize positive arm weights, with the prescribed exploration or support rule.
Draw the current action from that probability vector.
Use the observed loss divided by its sampling probability for the selected arm; use zero for the others.
Downweight arms according to their estimated cumulative losses.
Expected, fixed-horizon tail, all-time, and sparse-loss results use distinct concentration interfaces.
Importance weighting makes the bandit observation unbiased, while exponential weights controls the resulting estimated-loss regret.
BanditRLlib relationship. The local generated predictable process uses its own tuning constants and also compiles separate fixed-horizon, all-time, realized-regret, and sparse-loss extensions.
The mathematical content is restated in this site's notation; wording is ours. See online p. 156 in the linked source for the original statement and full assumptions.
The mathematical readings are explanatory summaries. The exact generated Lean statement and its source link remain authoritative for hypotheses, types, constants, and indexing.
Plain-English statement. For nonnegative estimated losses, exponential weights has pathwise regret at most a log-cardinality term divided by the learning rate plus the learning rate times the mixed squared loss.
theorem hedge_regret_le_log_card_div_add_eta_mul_mixedSquaredLoss_of_nonneg {Action : Type u} (arms : Finset Action) (harms : arms.Nonempty) (eta : Real) (heta : 0 < eta) (loss : Nat -> Action -> Real) (T : Nat) (hloss : forall t, t < T -> forall a, a ∈ arms -> 0 <= loss t a) (comparator : Action) (hcomparator : comparator ∈ arms) : (Finset.range T).sum (fun t => mixedLoss arms eta loss t) - cumulativeLoss loss T comparator <= Real.log arms.card / eta + eta * (Finset.range T).sum (fun t => mixedSquaredLoss arms eta loss t)
Plain-English statement. With the repository's tuned learning and exploration rates, the generated predictable EXP3 process has expected regret bounded by an explicit square-root expression.
BanditRLProof.Exp3.hedge_regret_le_log_card_div_add_eta_mul_mixedSquaredLoss_of_nonnegtheorem sampledPredictable_expectedRegret_le_four_mul_sqrt {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (hcard_two : 2 <= arms.card) (loss : PredictableLossVector Env Action) (horizon : Nat) (hhorizon_pos : 0 < horizon) (hscale : 4 * (arms.card : Real) * Real.log arms.card <= (horizon : Real)) (comparator : Action) (hcomparator : comparator ∈ arms) : let K := (arms.card : Real) let T := (horizon : Real) let gamma := tunedExplorationRate K T let eta := tunedLearningRate K T let mu := prior ⊗ₘ tunedPredictableTrajectoryKernel arms harms hcard_two loss horizon hhorizon_pos hscale integral mu (fun sample => (Finset.range horizon).sum (fun t => sampledTrajectoryExploredPredictableLossAt arms eta gamma loss t sample) - (Finset.range horizon).sum (fun t => predictableLossAt loss t sample comparator)) <= 4 * Real.sqrt (K * T * Real.log K)
Plain-English statement. At any supplied positive horizon, the generated EXP3 process with the theorem's Bernstein-square tuning has a realized-regret tail against the best supported arm obtained by a finite comparator union.
BanditRLProof.Exp3.sampledPredictable_allHorizonBernsteinSquareRealizedRegret_tailtheorem sampledPredictable_allHorizonBernsteinSquareBestArmRealizedRegret_tail {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (hcard_two : 2 <= arms.card) (loss : PredictableLossVector Env Action) (horizon : Nat) (hhorizon : 0 < horizon) (delta : Real) (hdelta : 0 < delta) (hdelta_le_one : delta <= 1) : let deltaArm := delta / (arms.card : Real) let gamma := bernsteinSquareClippedExplorationRate (arms.card : Real) (horizon : Real) deltaArm let eta := bernsteinSquareHighProbabilityLearningRate arms gamma horizon deltaArm let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma (bernsteinSquareClippedExplorationRate_pos (arms.card : Real) (horizon : Real) deltaArm (by exact_mod_cast hcard_two) (by exact_mod_cast hhorizon)).le (by exact (bernsteinSquareClippedExplorationRate_le_half (arms.card : Real) (horizon : Real) deltaArm).trans (by norm_num)) loss.environment mu {sample | bernsteinSquareBestArmAllHorizonRegretThreshold arms horizon delta <= (Finset.range horizon).sum (fun t => sampledTrajectoryRealizedLossAt t sample) - sampledPredictableBestArmCumulativeLoss arms harms loss horizon sample} <= ENNReal.ofReal delta
Plain-English statement. For one generated EXP3 trajectory, the event that the selected-loss deviation crosses its scheduled predictable-variance radius at any positive prefix while that prefix stays within its variance budget has probability at most delta.
BanditRLProof.Concentration.measure_iUnion_scheduled_deviation_ge_inter_variance_le_delta_of_fixedTilt_quadratic_tail, BanditRLProof.Concentration.tsum_ofReal_geometricConfidenceShare, BanditRLProof.Exp3.sampledPredictableRealizedDeviation_sum_tail_predictableVariance_fixedTilttheorem measure_sampledPredictableRealizedDeviationAllTimeFailureSet_le {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (eta gamma : Real) (hgamma_pos : 0 < gamma) (hgamma_le_one : gamma <= 1) (loss : PredictableLossVector Env Action) (varianceBudget : Nat -> Real) (hvarianceBudget : forall n, 0 < varianceBudget n) (delta : Real) (hdelta : 0 < delta) : let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma hgamma_pos.le hgamma_le_one loss.environment mu (sampledPredictableRealizedDeviationAllTimeFailureSet arms eta gamma loss varianceBudget delta) <= ENNReal.ofReal delta
Plain-English statement. On one generated EXP3 trajectory, realized selected loss minus predictable selected loss stays below its scheduled radius at every positive prefix, except on a failure event of outer mass at most delta.
BanditRLProof.Exp3.selectedLossCenteredSecondMoment_le_one, BanditRLProof.Exp3.sampledPredictableRealizedVariance_sum_le_horizon, BanditRLProof.Exp3.measure_sampledPredictableRealizedDeviationAllTimeFailureSet_letheorem measure_sampledRealizedDeviationGeometricAllTimeFailureSet_le {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (eta gamma : Real) (hgamma_pos : 0 < gamma) (hgamma_le_one : gamma ≤ 1) (loss : PredictableLossVector Env Action) (delta : Real) (hdelta : 0 < delta) : let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma hgamma_pos.le hgamma_le_one loss.environment mu (sampledRealizedDeviationGeometricAllTimeFailureSet arms eta gamma loss delta) ≤ ENNReal.ofReal delta
Plain-English statement. For one fixed generated EXP3 process and one supported comparator, predictable regret satisfies its scheduled finite-prefix bound simultaneously at every positive prefix outside one geometrically budgeted failure event.
BanditRLProof.Exp3.sampledPredictable_highProbabilityRegret_tail_total_delta, BanditRLProof.Concentration.tsum_ofReal_geometricConfidenceSharetheorem measure_sampledPredictableRegretGeometricAllTimeFailureSet_le {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (eta gamma : Real) (heta : 0 < eta) (hgamma_pos : 0 < gamma) (hgamma_lt_one : gamma < 1) (loss : PredictableLossVector Env Action) (comparator : Action) (hcomparator : comparator ∈ arms) (delta : Real) (hdelta : 0 < delta) : let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma hgamma_pos.le hgamma_lt_one.le loss.environment mu (sampledPredictableRegretGeometricAllTimeFailureSet arms eta gamma loss comparator delta) <= ENNReal.ofReal delta
Plain-English statement. For one generated EXP3 process and one supported comparator, realized selected-loss regret is below the sum of its predictable-regret and sampling-deviation budgets at every positive prefix, except on an event of outer mass at most delta.
BanditRLProof.Exp3.sampledTrajectoryRealizedRegret_eq_predictableRegret_add_realizedDeviation, BanditRLProof.Exp3.measure_sampledPredictableRegretGeometricAllTimeFailureSet_le, BanditRLProof.Exp3.measure_sampledRealizedDeviationGeometricAllTimeFailureSet_letheorem measure_sampledRealizedRegretGeometricAllTimeFailureSet_le {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (eta gamma : Real) (heta : 0 < eta) (hgamma_pos : 0 < gamma) (hgamma_lt_one : gamma < 1) (loss : PredictableLossVector Env Action) (comparator : Action) (hcomparator : comparator ∈ arms) (delta : Real) (hdelta : 0 < delta) : let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma hgamma_pos.le hgamma_lt_one.le loss.environment mu (sampledRealizedRegretGeometricAllTimeFailureSet arms eta gamma loss comparator delta) <= ENNReal.ofReal delta
Plain-English statement. Under predictable sparse losses, the probability that best-arm realized regret crosses the tuned all-horizon threshold is at most delta plus the supplied sparsity-failure probability.
theorem sampledPredictable_allHorizonDoubleVarianceProbabilisticSparseLossBestArmRealizedRegret_tail_of_sparsityFailure_le {Env : Type u} {Action : Type v} [MeasurableSpace Env] [StandardBorelSpace Env] [Nonempty Env] [MeasurableSpace Action] [MeasurableSingletonClass Action] [StandardBorelSpace Action] [Nonempty Action] [DecidableEq Action] (prior : Measure Env) [IsProbabilityMeasure prior] (arms : Finset Action) (harms : arms.Nonempty) (hcard_two : 2 <= arms.card) (loss : PredictableLossVector Env Action) (horizon sparsity : Nat) (hhorizon : 0 < horizon) (hsparsity : 0 < sparsity) (delta epsilon : Real) (hdelta : 0 < delta) (hdelta_le_one : delta <= 1) : let deltaArm := delta / (arms.card : Real) let gamma := doubleVarianceProbabilisticSparseLossClippedExplorationRate (arms.card : Real) (sparsity : Real) (horizon : Real) deltaArm let eta := pathwiseVarianceProbabilisticSparseLossHighProbabilityLearningRate arms gamma horizon sparsity deltaArm let mu := prior ⊗ₘ sampledImportanceWeightedTrajectoryKernel arms harms eta gamma (doubleVarianceProbabilisticSparseLossClippedExplorationRate_pos (arms.card : Real) (sparsity : Real) (horizon : Real) deltaArm (by exact_mod_cast hcard_two) (by exact_mod_cast hsparsity) (by exact_mod_cast hhorizon)).le (by exact (doubleVarianceProbabilisticSparseLossClippedExplorationRate_le_half (arms.card : Real) (sparsity : Real) (horizon : Real) deltaArm).trans (by norm_num)) loss.environment mu (sampledPredictableSparsityFailure arms loss horizon sparsity) <= ENNReal.ofReal epsilon → mu {sample | doubleVarianceProbabilisticSparseLossBestArmAllHorizonRegretThreshold arms horizon sparsity delta <= (Finset.range horizon).sum (fun t => sampledTrajectoryRealizedLossAt t sample) - sampledPredictableBestArmCumulativeLoss arms harms loss horizon sample} <= ENNReal.ofReal delta + ENNReal.ofReal epsilon
Complete in the canonical adversarial finite-arm scope when the exponential-potential and deterministic Hedge route, positive-support importance weighting, conditional first/second moments, measurable recursive generated trajectory, predictable-loss transport, and exploration bias compile; the same public canary must type (i) the horizon-dependent tuned expected bound, (ii) the horizon-dependent fixed-window best-supported-arm realized tail, (iii) one fixed prior/arms/loss/eta/gamma/comparator process with predictable and realized-deviation parents, exact decomposition, and an all-positive-prefix realized-regret outer-probability terminal, and (iv) the separately labelled sparse/variance-sensitive endpoint with its failure budget explicit.
| Milestone | Status | Lean declaration | Remaining gap |
|---|---|---|---|
| Tuned expected EXP3 regret | Compiled | BanditRLProof.Exp3.sampledPredictable_expectedRegret_le_four_mul_sqrt | — |
| Per-horizon best-arm realized high-probability EXP3 | Compiled | BanditRLProof.Exp3.sampledPredictable_allHorizonBernsteinSquareBestArmRealizedRegret_tail | This is not one horizon-free policy with a simultaneous confidence event over all horizons. |
| All-positive-prefix EXP3 predictable-variance tail | Compiled | BanditRLProof.Exp3.measure_sampledPredictableRealizedDeviationAllTimeFailureSet_le | — |
| All-positive-prefix EXP3 realized-deviation tail | Compiled | BanditRLProof.Exp3.measure_sampledRealizedDeviationGeometricAllTimeFailureSet_le | — |
| All-positive-prefix EXP3 predictable-regret tail | Compiled | BanditRLProof.Exp3.measure_sampledPredictableRegretGeometricAllTimeFailureSet_le | — |
| All-positive-prefix EXP3 realized-regret tail | Compiled | BanditRLProof.Exp3.sampledTrajectoryRealizedRegret_eq_predictableRegret_add_realizedDeviationBanditRLProof.Exp3.measure_sampledRealizedRegretGeometricAllTimeFailureSet_le | The process parameters eta and gamma and the comparator are fixed across prefixes. The theorem is not a horizon-varying tuned sublinear all-time guarantee, a best-arm minimum, or an ideal EXP3.P theorem. |
| Sparse-loss all-horizon high-probability EXP3 | Compiled | BanditRLProof.Exp3.sampledPredictable_allHorizonDoubleVarianceProbabilisticSparseLossBestArmRealizedRegret_tail_of_sparsityFailure_le | — |