Multiplicative weight update method

From HandWiki
Short description: Algorithmic technique

The multiplicative weights update method is an algorithmic technique most commonly used for decision making and prediction, and also widely deployed in game theory and algorithm design. The simplest use case is the problem of prediction from expert advice, in which a decision maker needs to iteratively decide on an expert whose advice to follow. The method assigns initial weights to the experts (usually identical initial weights), and updates these weights multiplicatively and iteratively according to the feedback of how well an expert performed: reducing it in case of poor performance, and increasing it otherwise.[1] It was discovered repeatedly in very diverse fields such as machine learning (AdaBoost, Winnow, Hedge), optimization (solving linear programs), theoretical computer science (devising fast algorithm for LPs and SDPs), and game theory.

Name

"Multiplicative weights" implies the iterative rule used in algorithms derived from the multiplicative weight update method.[2] It is given with different names in the different fields where it was discovered or rediscovered.

History and background

The earliest known version of this technique was in an algorithm named "fictitious play" which was proposed in game theory in the early 1950s. Grigoriadis and Khachiyan[3] applied a randomized variant of "fictitious play" to solve two-player zero-sum games efficiently using the multiplicative weights algorithm. In this case, player allocates higher weight to the actions that had a better outcome and choose his strategy relying on these weights. In machine learning, Littlestone applied the earliest form of the multiplicative weights update rule in his famous winnow algorithm, which is similar to Minsky and Papert's earlier perceptron learning algorithm. Later, he generalized the winnow algorithm to weighted majority algorithm. Freund and Schapire followed his steps and generalized the winnow algorithm in the form of hedge algorithm.

The multiplicative weights algorithm is also widely applied in computational geometry such as Kenneth Clarkson's algorithm for linear programming (LP) with a bounded number of variables in linear time.[4][5] Later, Bronnimann and Goodrich employed analogous methods to find set covers for hypergraphs with small VC dimension.[6]

In operation research and on-line statistical decision making problem field, the weighted majority algorithm and its more complicated versions have been found independently.

In computer science field, some researchers have previously observed the close relationships between multiplicative update algorithms used in different contexts. Young discovered the similarities between fast LP algorithms and Raghavan's method of pessimistic estimators for derandomization of randomized rounding algorithms; Klivans and Servedio linked boosting algorithms in learning theory to proofs of Yao's XOR Lemma; Garg and Khandekar defined a common framework for convex optimization problems that contains Garg-Konemann and Plotkin-Shmoys-Tardos as subcases.[1]

The Hedge algorithm is a special case of mirror descent.

General setup

A binary decision needs to be made based on n experts’ opinions to attain an associated payoff. In the first round, all experts’ opinions have the same weight. The decision maker will make the first decision based on the majority of the experts' prediction. Then, in each successive round, the decision maker will repeatedly update the weight of each expert's opinion depending on the correctness of his prior predictions. Real life examples includes predicting if it is rainy tomorrow or if the stock market will go up or go down.

Algorithm analysis

Halving algorithm[2]

Given a sequential game played between an adversary and an aggregator who is advised by N experts, the goal is for the aggregator to make as few mistakes as possible. Assume there is an expert among the N experts who always gives the correct prediction. In the halving algorithm, only the consistent experts are retained. Experts who make mistakes will be dismissed. For every decision, the aggregator decides by taking a majority vote among the remaining experts. Therefore, every time the aggregator makes a mistake, at least half of the remaining experts are dismissed. The aggregator makes at most log2(N) mistakes.[2]

Weighted majority algorithm[1][7]

Unlike halving algorithm which dismisses experts who have made mistakes, weighted majority algorithm discounts their advice. Given the same "expert advice" setup, suppose we have n decisions, and we need to select one decision for each loop. In each loop, every decision incurs a cost. All costs will be revealed after making the choice. The cost is 0 if the expert is correct, and 1 otherwise. this algorithm's goal is to limit its cumulative losses to roughly the same as the best of experts. The very first algorithm that makes choice based on majority vote every iteration does not work since the majority of the experts can be wrong consistently every time. The weighted majority algorithm corrects above trivial algorithm by keeping a weight of experts instead of fixing the cost at either 1 or 0.[1] This would make fewer mistakes compared to halving algorithm.

   Initialization: 
      Fix an [math]\displaystyle{ \eta \le 1/2 }[/math]. For each expert, associate the weight [math]\displaystyle{ {w_i}^1 }[/math]≔1.
   For [math]\displaystyle{ t }[/math] = [math]\displaystyle{ \mathit{1} }[/math], [math]\displaystyle{ \mathit{2} }[/math],...,[math]\displaystyle{ T }[/math]
      1. Make the prediction given by the weighted majority of the experts' predictions based on their weights[math]\displaystyle{ \mathbb{w_1}^t,..., \mathbb{w_n}^t }[/math]. That is, choose 0 or 1 depending on which prediction has a higher total weight of experts advising it (breaking ties arbitrarily). 
      2. For every expert i that predicted wrongly, decrease his weight for the next round by multiplying it by a factor of (1-η):
           [math]\displaystyle{ w_{i}^{t+1} }[/math]=[math]\displaystyle{ (1-\eta) w_{i}^{t} }[/math] (update rule)

If [math]\displaystyle{ \eta =0 }[/math], the weight of the expert's advice will remain the same. When [math]\displaystyle{ \eta }[/math] increases, the weight of the expert's advice will decrease. Note that some researchers fix [math]\displaystyle{ \eta =1/2 }[/math] in weighted majority algorithm.

After [math]\displaystyle{ T }[/math] steps, let [math]\displaystyle{ m_i^T }[/math] be the number of mistakes of expert i and [math]\displaystyle{ M^T }[/math] be the number of mistakes our algorithm has made. Then we have the following bound for every [math]\displaystyle{ i }[/math]:

    [math]\displaystyle{ M^T \leq 2(1+\eta) m_i^T+ \frac{2 \ln(n)}{\eta} }[/math].

In particular, this holds for i which is the best expert. Since the best expert will have the least [math]\displaystyle{ m_i^T }[/math], it will give the best bound on the number of mistakes made by the algorithm as a whole.

Randomized weighted majority algorithm

This algorithm can be understood as follows:[2][8]

Given the same setup with N experts. Consider the special situation where the proportions of experts predicting positive and negative, counting the weights, are both close to 50%. Then, there might be a tie. Following the weight update rule in weighted majority algorithm, the predictions made by the algorithm would be randomized. The algorithm calculates the probabilities of experts predicting positive or negatives, and then makes a random decision based on the computed fraction:[further explanation needed]

predict

[math]\displaystyle{ f(x) = \begin{cases}1 & \text{with probability} \frac{q_1}{W}\\0 & \text{otherwise}\end{cases} }[/math]

where

 [math]\displaystyle{ W= \sum_{i} { w_i} = q_0 + q_1 }[/math].

The number of mistakes made by the randomized weighted majority algorithm is bounded as:

 [math]\displaystyle{ E\left [ \# \text{mistakes of the learner} \right ] \leq \alpha_\beta \left ( \# \text{ mistakes of the best expert} \right ) + c_\beta \ln(N)  }[/math]

where [math]\displaystyle{ \alpha_\beta= \frac{\ln(\frac{1}{\beta})}{1-\beta} }[/math] and [math]\displaystyle{ c_\beta=\frac{1}{1-\beta} }[/math].

Note that only the learning algorithm is randomized. The underlying assumption is that the examples and experts' predictions are not random. The only randomness is the randomness where the learner makes his own prediction. In this randomized algorithm, [math]\displaystyle{ \alpha_\beta \rightarrow 1 }[/math] if [math]\displaystyle{ \beta \rightarrow 1 }[/math]. Compared to weighted algorithm, this randomness halved the number of mistakes the algorithm is going to make.[9] However, it is important to note that in some research, people define [math]\displaystyle{ \eta =1/2 }[/math] in weighted majority algorithm and allow [math]\displaystyle{ 0\leq \eta \leq 1 }[/math] in randomized weighted majority algorithm.[2]

Applications

The multiplicative weights method is usually used to solve a constrained optimization problem. Let each expert be the constraint in the problem, and the events represent the points in the area of interest. The punishment of the expert corresponds to how well its corresponding constraint is satisfied on the point represented by an event.[1]

Solving zero-sum games approximately (Oracle algorithm):[1][9]

Suppose we were given the distribution [math]\displaystyle{ P }[/math] on experts. Let [math]\displaystyle{ A }[/math] = payoff matrix of a finite two-player zero-sum game, with [math]\displaystyle{ n }[/math] rows.

When the row player [math]\displaystyle{ p_r }[/math] uses plan [math]\displaystyle{ i }[/math] and the column player [math]\displaystyle{ p_c }[/math] uses plan [math]\displaystyle{ j }[/math], the payoff of player [math]\displaystyle{ p_c }[/math] is [math]\displaystyle{ A \left ( i, j \right) }[/math][math]\displaystyle{ A_{ij} }[/math], assuming [math]\displaystyle{ A \left( i, j\right ) \in \left [ 0, 1 \right ] }[/math].

If player [math]\displaystyle{ p_r }[/math] chooses action [math]\displaystyle{ i }[/math] from a distribution [math]\displaystyle{ P }[/math] over the rows, then the expected result for player [math]\displaystyle{ p_c }[/math] selecting action [math]\displaystyle{ j }[/math] is [math]\displaystyle{ A \left (P, j \right )=E_{i \in P} \left [A \left(i,j \right) \right] }[/math].

To maximize [math]\displaystyle{ A \left (P, j \right) }[/math], player [math]\displaystyle{ p_c }[/math] should choose plan [math]\displaystyle{ j }[/math]. Similarly, the expected payoff for player [math]\displaystyle{ p_l }[/math] is [math]\displaystyle{ A \left (i,P\right )=E_{j\in P} \left [A \left(i,j \right) \right ] }[/math]. Choosing plan [math]\displaystyle{ i }[/math] would minimize this payoff. By John Von Neumann's Min-Max Theorem, we obtain:

                                          [math]\displaystyle{ \min_P \max_j A\left( P, j \right) = \max_Q \min_i A\left( i, Q \right)  }[/math]

where P and i changes over the distributions over rows, Q and j changes over the columns.

Then, let [math]\displaystyle{ \lambda^* }[/math] denote the common value of above quantities, also named as the "value of the game". Let [math]\displaystyle{ \delta\gt 0 }[/math] be an error parameter. To solve the zero-sum game bounded by additive error of [math]\displaystyle{ \delta }[/math],

                                                 [math]\displaystyle{ \lambda^* - \delta \leq \min_i  A \left (i,q \right )  }[/math]
                                                 [math]\displaystyle{ \max_j A \left(p, j \right) \leq \lambda^* +\delta  }[/math]

So there is an algorithm solving zero-sum game up to an additive factor of δ using O(log2(n)/[math]\displaystyle{ \delta^2 }[/math]) calls to ORACLE, with an additional processing time of O(n) per call[9]

Bailey and Piliouras showed that although the time average behavior of multiplicative weights update converges to Nash equilibria in zero-sum games the day-to-day (last iterate) behavior diverges away from it.[10]

Machine learning

In machine learning, Littlestone and Warmuth generalized the winnow algorithm to the weighted majority algorithm.[11] Later, Freund and Schapire generalized it in the form of hedge algorithm.[12] AdaBoost Algorithm formulated by Yoav Freund and Robert Schapire also employed the Multiplicative Weight Update Method.[1]

Winnow algorithm

Based on current knowledge in algorithms, the multiplicative weight update method was first used in Littlestone's winnow algorithm.[1] It is used in machine learning to solve a linear program.

Given [math]\displaystyle{ m }[/math] labeled examples [math]\displaystyle{ \left (a_1, l_1 \right ),\text{…} ,\left (a_m, l_m \right ) }[/math] where [math]\displaystyle{ a_j \in \mathbb{R}^n }[/math] are feature vectors, and [math]\displaystyle{ l_j \in \left \{-1,1 \right \} \quad }[/math] are their labels.

The aim is to find non-negative weights such that for all examples, the sign of the weighted combination of the features matches its labels. That is, require that [math]\displaystyle{ l_j a_j x \geq 0 }[/math] for all [math]\displaystyle{ j }[/math]. Without loss of generality, assume the total weight is 1 so that they form a distribution. Thus, for notational convenience, redefine [math]\displaystyle{ a_j }[/math] to be [math]\displaystyle{ l_j a_j }[/math], the problem reduces to finding a solution to the following LP:

                     [math]\displaystyle{ \forall j=1,2,\text{…}, m : a_j x \geq 0 }[/math],
                     [math]\displaystyle{ 1*x=1 }[/math],
                     [math]\displaystyle{ \forall i : x_i \geq 0 }[/math].

This is general form of LP.

Hedge algorithm [2]

The hedge algorithm is similar to the weighted majority algorithm. However, their exponential update rules are different.[2] It is generally used to solve the problem of binary allocation in which we need to allocate different portion of resources into N different options. The loss with every option is available at the end of every iteration. The goal is to reduce the total loss suffered for a particular allocation. The allocation for the following iteration is then revised, based on the total loss suffered in the current iteration using multiplicative update.[13]

Analysis

Assume the learning rate [math]\displaystyle{ \eta \gt 0 }[/math] and for [math]\displaystyle{ t \in [T] }[/math], [math]\displaystyle{ p^t }[/math] is picked by Hedge. Then for all experts [math]\displaystyle{ i }[/math],

                                [math]\displaystyle{ \sum_{t \leq T} p^t m^t \leq \sum_{t \leq T} m_i^t +\frac{\ln(N)}{\eta}+\eta T }[/math]

Initialization: Fix an [math]\displaystyle{ \eta \gt 0 }[/math]. For each expert, associate the weight [math]\displaystyle{ w_i^1 }[/math] ≔1 For t=1,2,...,T:

      1. Pick the distribution [math]\displaystyle{ p_i^t= \frac{w_i^t}{\Phi t} }[/math] where [math]\displaystyle{ \Phi t=\sum_i w_i^t }[/math].
      2. Observe the cost of the decision [math]\displaystyle{ m^t }[/math]. 
      3. Set 
                              [math]\displaystyle{ w_i^{t + 1} = w_i^t \exp(-\eta m_i^t }[/math]).

AdaBoost algorithm

This algorithm[12] maintains a set of weights [math]\displaystyle{ w^t }[/math] over the training examples. On every iteration [math]\displaystyle{ t }[/math], a distribution [math]\displaystyle{ p^t }[/math] is computed by normalizing these weights. This distribution is fed to the weak learner WeakLearn which generates a hypothesis [math]\displaystyle{ h_t }[/math] that (hopefully) has small error with respect to the distribution. Using the new hypothesis [math]\displaystyle{ h_t }[/math], AdaBoost generates the next weight vector [math]\displaystyle{ w^{t+1} }[/math]. The process repeats. After T such iterations, the final hypothesis [math]\displaystyle{ h_f }[/math] is the output. The hypothesis [math]\displaystyle{ h_f }[/math] combines the outputs of the T weak hypotheses using a weighted majority vote.[12]

Input: 
      Sequence of [math]\displaystyle{ N }[/math] labeled examples ([math]\displaystyle{ x_1 }[/math],[math]\displaystyle{ y_1 }[/math]),...,([math]\displaystyle{ x_N }[/math], [math]\displaystyle{ y_N }[/math])
      Distribution [math]\displaystyle{ D }[/math] over the [math]\displaystyle{ N }[/math] examples
      Weak learning algorithm "'WeakLearn"'
      Integer [math]\displaystyle{ T }[/math] specifying number of iterations
Initialize the weight vector: [math]\displaystyle{ w_{i}^{1} = D(i) }[/math] for [math]\displaystyle{ i=1, 2,..., N }[/math].
Do for [math]\displaystyle{ t=1, 2,..., T }[/math]
      1. Set [math]\displaystyle{ p^t=\frac{w^t}{\sum_{i=1}^{N} w_{i}^{t}} }[/math].
      2. Call WeakLearn, providing it with the distribution [math]\displaystyle{ p^t }[/math]; get back a hypothesis [math]\displaystyle{ h_t: X\rightarrow }[/math] [0,1].
      3. Calculate the error of [math]\displaystyle{ h_t:\epsilon_t = \sum_{i=1}^{N} p_{i}^{t}|h_t(x_i)-y_i| }[/math].
      4. Set [math]\displaystyle{ \beta_t = \frac{\epsilon_t}{1-\epsilon_t} }[/math].                                     
      5. Set the new weight vector to be [math]\displaystyle{ w_{i}^{t+1}=w_{i}^{t}\beta_{t}^{1-|h_t(x_i)-y_i|} }[/math].

Output the hypothesis:
      [math]\displaystyle{ 
        f(x) = h_f(x) = \begin{cases}1 & \text{if} \sum_{t=1}^{T} (\log(1/\beta_t)) h_{t}(x) \geq \frac{1}{2}\sum_{t=1}^{T} \log(1/\beta_t) \\0 & \text{otherwise}\end{cases}
         }[/math]

Solving linear programs approximately[14]

Problem

Given a [math]\displaystyle{ m \times n }[/math] matrix [math]\displaystyle{ A }[/math] and [math]\displaystyle{ b \in \mathbb{R}^n }[/math], is there a [math]\displaystyle{ x }[/math] such that [math]\displaystyle{ A x \geq b }[/math]?

                      [math]\displaystyle{ \exists ? x: A x \geq b  }[/math]              (1)

Assumption

Using the oracle algorithm in solving zero-sum problem, with an error parameter [math]\displaystyle{ \epsilon \gt 0 }[/math], the output would either be a point [math]\displaystyle{ x }[/math] such that [math]\displaystyle{ A x \geq b-\epsilon }[/math] or a proof that [math]\displaystyle{ x }[/math] does not exist, i.e., there is no solution to this linear system of inequalities.

Solution

Given vector [math]\displaystyle{ p \in \Delta_n }[/math], solves the following relaxed problem

                     [math]\displaystyle{ \exists ? x: p^{\textsf T}\!\!A x\geq p^\textsf{T}\!b }[/math]             (2)

If there exists a x satisfying (1), then x satisfies (2) for all [math]\displaystyle{ p\in \Delta_n }[/math]. The contrapositive of this statement is also true. Suppose if oracle returns a feasible solution for a [math]\displaystyle{ p }[/math], the solution [math]\displaystyle{ x }[/math] it returns has bounded width [math]\displaystyle{ \max_i |{(A x)}_i - b_i | \leq 1 }[/math]. So if there is a solution to (1), then there is an algorithm that its output x satisfies the system (2) up to an additive error of [math]\displaystyle{ 2\epsilon }[/math]. The algorithm makes at most [math]\displaystyle{ \frac{\ln(m)}{\epsilon^2} }[/math] calls to a width-bounded oracle for the problem (2). The contrapositive stands true as well. The multiplicative updates is applied in the algorithm in this case.

Other applications

Evolutionary game theory
Multiplicative weights update is the discrete-time variant of the replicator equation (replicator dynamics), which is a commonly used model in evolutionary game theory. It converges to Nash equilibrium when applied to a congestion game.[15]
Operations research and online statistical decision-making
In operations research and on-line statistical decision making problem field, the weighted majority algorithm and its more complicated versions have been found independently.[1]
Computational geometry
The multiplicative weights algorithm is also widely applied in computational geometry,[1] such as Clarkson's algorithm for linear programming (LP) with a bounded number of variables in linear time.[4][5] Later, Bronnimann and Goodrich employed analogous methods to find Set Covers for hypergraphs with small VC dimension.[6]
Gradient descent method[1]
Matrix multiplicative weights update[1]
Plotkin, Shmoys, Tardos framework for packing/covering LPs[1]
Approximating multi-commodity flow problems[1]
O (logn)- approximation for many NP-hard problems[1]
Learning theory and boosting[1]
Hard-core sets and the XOR lemma[1]
Hannan's algorithm and multiplicative weights[1]
Online convex optimization[1]

References

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 "The Multiplicative Weights Update Method: A Meta-Algorithm and Applications". Theory of Computing 8: 121–164. 2012. doi:10.4086/toc.2012.v008a006. 
  2. 2.0 2.1 2.2 2.3 2.4 2.5 2.6 "The Multiplicative Weights Algorithm*". https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/notes/lecture16.pdf. 
  3. Grigoriadis, Michael D. (1995). "A sublinear-time randomized approximation algorithm for matrix games". Operations Research Letters 18 (2): 53–58. doi:10.1016/0167-6377(95)00032-0. 
  4. 4.0 4.1 Kenneth L. Clarkson. A Las Vegas algorithm for linear programming when the dimension is small., In Proc. 29th FOCS, pp. 452–456. IEEE Comp. Soc. Press, 1988.[doi:10.1109/SFCS.1988.21961] 123, 152.
  5. 5.0 5.1 Kenneth L. Clarkson. A Las Vegas algorithm for linear and integer programming when the dimension is small., Journal of the ACM, 42:488–499, 1995. [doi:10.1145/201019.201036] 123, 152.
  6. 6.0 6.1 Bronnimann, H.; Goodrich, M. T. (1995). "Almost optimal set covers in finite VC-dimension". Discrete & Computational Geometry 14 (4): 463–479. doi:10.1007/BF02570718.  Preliminary version in 10th Ann. Symp. Comp. Geom. (SCG'94).
  7. "Lecture 8: Decision-making under total uncertainty: the multiplicative weight algorithm". 2013. https://www.cs.princeton.edu/courses/archive/fall13/cos521/lecnotes/lec8.pdf. 
  8. "COS 511: Foundations of Machine Learning". 20 March 2006. http://www.cs.princeton.edu/courses/archive/spr06/cos511/scribe_notes/0330.pdf. 
  9. 9.0 9.1 9.2 "An Algorithmist's Toolkit". 8 December 2009. https://ocw.mit.edu/courses/mathematics/18-409-topics-in-theoretical-computer-science-an-algorithmists-toolkit-fall-2009/lecture-notes/MIT18_409F09_scribe24.pdfformat=PDF. 
  10. Bailey, James P., and Georgios Piliouras. "Multiplicative weights update in zero-sum games." Proceedings of the 2018 ACM Conference on Economics and Computation. ACM, 2018.
  11. Foster, Dean P.; Vohra, Rakesh (1999). "Regret in the on-line decision problem". Games and Economic Behavior 29 (1–2): 7–35. doi:10.1006/game.1999.0740. http://www.dklevine.com/archive/refs4569.pdf. 
  12. 12.0 12.1 12.2 Yoav, Freund. Robert, E. Schapire (1996). TA Decision-Theoretic Generalization of On-Line Learning and an Application to Boosting*, p. 55. journal of computer and system sciences.
  13. "Online Learning from Experts: Weighed Majority and Hedge". http://www.shivani-agarwal.net/Teaching/E0370/Aug-2011/Lectures/20-scribe1.pdf. 
  14. "Fundamentals of Convex Optimization". http://tcs.epfl.ch/files/content/sites/tcs/files/Lec2-Fall14-Ver2.pdf. 
  15. Kleinberg, Robert, Georgios Piliouras, and Eva Tardos. "Multiplicative updates outperform generic no-regret learning in congestion games." Proceedings of the forty-first annual ACM symposium on Theory of computing. ACM, 2009.

External links