MIT 6.1220 — Lecture 17

Multiplicative Weights

Setup. A learner has nn experts. At time step tt, expert ii makes a prediction pit{0,1}p_i^t \in \{0, 1\}. The learner makes predictions based on the nn experts' predictions. The learner's goal is to perform well relative to the experts.

Solution. (Weighted Majority) Initialize weights wi0=1w_i^0 = 1 for each expert ii. At each step,

Suppose after TT time steps that the best expert makes mm^* mistakes and the learner makes mm mistakes. Then:

m2(1+ε)m+2εln(n).m \leq 2 \cdot (1 + \varepsilon) \cdot m^* + \frac{2}{\varepsilon} \cdot \ln (n).

Remark. If ε\varepsilon is low, then you take too long to understand your experts, and 2εln(n)\frac{2}{\varepsilon} \cdot \ln(n) dominates.
If ε\varepsilon is high, then you distrust your experts too easily, and 2(1+ε)m2 \cdot (1 + \varepsilon) \cdot m^* dominates.
This bound is tight; we'll prove this in the problem set.

Proof: Let Wt:=i=1nwitW^t := \sum_{i = 1}^n w_i^t. Then at time step tt,

The above implies that:

(1ε2)mnWTwiT=(1ε)m.\left(1 - \dfrac{\varepsilon}{2}\right)^m \cdot n \geq W^T \geq w_{i^*}^T = (1 - \varepsilon)^{m^*}.

Taking logs yields the result. The final algebraic step is nonobvious; it holds for ε<0.893935\varepsilon < 0.893935.   \blacksquare

Remark. As the number of timesteps TT \to \infty, you do at most twice as bad as the best expert.

Also, realistically, one would choose ε(0,12)\varepsilon \in (0, \frac{1}{2}). The bound fails for ε=0.9\varepsilon = 0.9 for silly post-taking-logs reasons.

Definition (Online Learning). Let AA be the set of possible actions. At each time step tt,

Example. The weighted majority example has the following:

A={0,1}      pt=“weighted majority” (deterministic, not probabilistic)      ct:A{0,1}A = \{0, 1\} ~~~ \parallel ~~~ p_t = \text{``weighted majority'' (deterministic, not probabilistic)} ~~~ \parallel ~~~ c_t : A \to \{0, 1\}

Definition. We have:

What is a reasonable benchmark?

Unfortunately, the weighted majority algorithm does not achieve vanishing regret. Indeed, 21>02 - 1 > 0.

Solution. (Multiplicative Weights) Update experts' weights as in the weighted majority algorithm.

Instead of making the highest-weighted decision, pick an expert to mimic at each step probabilistically by weight. Then if MM is the total cost incurred by the learner, we have:

E[M](1+ε)m+1εln(n).\mathbb{E}[M] \leq (1 + \varepsilon) \cdot m^* + \dfrac{1}{\varepsilon} \cdot \ln(n).

Proof: We use the following notation:

It follows that E[Mt]=i=1nMitwitWt\mathbb{E}[M^t] = \sum_{i = 1}^n M_i^t \cdot \frac{w_i^t}{W^t}. Therefore,

Wt+1=i=1nwit+1=i=1n(1εMit)wit=(1εE[Mt])Wtexp(εE[Mt])Wt.W^{t + 1} = \sum_{i = 1}^n w_i^{t + 1} = \sum_{i = 1}^n (1 - \varepsilon M_i^t) \cdot w_i^t = (1 - \varepsilon \mathbb{E}[M^t]) \cdot W^t \leq \exp\left(-\varepsilon \mathbb{E}[M^t]\right) \cdot W^t.

If we keep multiplying these exp(εE[Mt])\exp \left ( - \varepsilon \mathbb{E}[M^t]\right) factors across all tt, we find:

(1ε)mWTexp(εE[M])n.(1 - \varepsilon)^{m^*} \leq W^T \leq \exp\left(-\varepsilon \mathbb{E}[M]\right) \cdot n.

And now take logs to get the desired inequality.   \blacksquare

Remark. Again, the post-taking-logs step only holds for ε<0.68\varepsilon < 0.68. Again, just assume ε(0,12)\varepsilon \in (0, \frac{1}{2}).

And of course, this implies multiplicative weights has vanishing regret—so long as we shrink ε\varepsilon as TT grows, say ε:=ln(n)/T\varepsilon := \sqrt{\ln(n) / T}.