                            Learning Mixtures of Experts with EM: A Mirror Descent Perspective



3. EM for Mixtures of Experts                                       3.1. EM for Symmetric Mixture of 2-Experts

Next, we present the EM algorithm for MoE. EM takes a               So far, we discussed EM for the most general form of MoE.

structured approach to minimizing the objective L(θ) in (7).        Next, we derive EM for the special case of Symmetric Mix-

Each iteration of EM is decomposed into two steps as fol-           ture of Experts (SymMoE), the focus of our analysis in

lows. The first step is called “expectation”: For current           Section 5. SymMoE is a simplified version of MoE where

parameter estimate θ t , we compute the expectation of the          (i) the number of experts is restricted to 2, represented as

complete-data log-likelihood with respect to the latent vari-       z ∈ {−1, 1}, and (ii) the experts are symmetric around

ables, using the current parameter estimates θ t and denote         the linear separator, i.e., β̃ ∗ := β1∗ = −β−1∗

                                                                                                                     . This sym-

it by Q(θ|θ t ), i.e.,                                              metric structure simplifies the probability density functions

                                                                    introduced earlier, making the subsequent analysis easier to

    Q(θ|θ t ) = −EX,Y EZ|x,y;θt [log p(x, y, z; θ)] . (8)

                                                   

                                                                    follow. We explore these simplifications in detail below.

Then, in the second step called “maximization”, we simply           As we are restricted to two experts, the expression for P (z =

minimize the objective Q(θ|θ t ) (or maximize −Q(θ|θ t ))           1|x; w∗ ) = 1 − P (z = −1|x; w∗ ) is

with respect to θ ∈ Ω and obtain our new parameter as

                                                                                                                  ⊤   ∗

                                                                                                             ex w1

                  θ t+1 := argmin Q(θ|θ t ).              (9)                  P (z = 1|x; w∗ ) =        x⊤ w1∗    ⊤ ∗ .

                            θ∈Ω                                                                      e         + ex w2

Since log p(y, z|x; θ) = log p(y|z, x; β) + log p(z|x; w),          For ease of notation, we define w̃∗ := w1∗ − w2∗ and repa-

it follows that the EM objective (8) is linearly separable          rameterize the probability mass function of z given x as

in the parameters β and w. Thus, we can rewrite Q(θ|ϕ)                                                       ⊤ ∗

                                                                                                   exp{ z+1

                                                                                                         2 x w̃ }

as the sum of two functions that depend only on β and w,                         P (z|x; w̃∗ ) =                  .          (11)

respectively. Subsequently, the EM update (9) is obtained

                                                                                                            ⊤

                                                                                                     1 + ex w̃∗

as the concatenation θ t+1 = (wt+1 , β t+1 )⊤ , where               Thus, under this simplification, the EM update of the gating

                                                                    parameter w is now given as

   wt+1 = argmin −EX,Y EZ|x,y;θt [log p(z|x; w)] ,

                                                     

              w∈Rd                                                                                       "            ⊤

                                                                                                                          !#

     t+1

                                                                      t+1                                   1 + ex w

 β         = argmin −EX,Y EZ|x,y;θt [log p(y|z, x; β)] .              w     = argmin EX,Y EZ|x,y;θt log         z+1 ⊤         .

              β∈Rd                                                             w∈Rd                            e 2 x w



EM has two well understood characteristics: (a) its update          While the above minimization problem is strongly convex,

always minimize an objective that is an upper bound on the          it does not have a closed form solution. In our experiments,

likelihood, and (b) fixed points of the EM update are also          we use gradient descent to obtain wt+1 .

stationary points of the likelihood. We now show this below.        For the special case of a symmetric mixture of linear experts

The original objective, L(θ), can be decomposed into the            (SymMoLinE), the expression for p(y|x, z; β ∗ ) given in (5)

difference between the EM objective and another function            can be simplified as

that is bounded below by 0. Specifically, for any θ, ϕ ∈ Ω,                                       (                  )

                                                                                         ∗          (y − zx⊤ β̃ ∗ )2

      L(θ) = −EX,Y [log(p(y|x; θ))]                                          p(y|x, z; β ) ∝ exp                       .     (12)

                                                                                                           2

             = −EX,Y EZ|x,y,ϕ [log(p(y|x, z; θ))]

                               

                                     p(y, z|x; θ)

                                                                  Under this simplification, the EM update of the expert pa-

             = −EX,Y EZ|x,y,ϕ log                    .              rameter β is now obtained more compactly as

                                     p(z|y, x; θ)

                                                                         β t+1 = EX,Y 2p(z = 1|x, y; θ t ) − 1 xy .

                                                                                                                 

Denoting H(θ|ϕ) := −EX,Y EZ|x,y,ϕ [log p(z|x, y; θ)], it

follows that                                                        Similarly, for symmetric mixtures of logistic experts (Sym-

                 L(θ) = Q(θ|ϕ) − H(θ|ϕ).                 (10)       MoLogE) with y ∈ {−1, 1}, the expression of p(y|x, z; β ∗ )

                                                                    given in (6) can also be simplified as

where H(θ|ϕ) is bounded below by 0. Thus, Q(θ|ϕ) acts

                                                                                                exp{ yz+1

                                                                                                             ⊤ ∗

as an upper bound on the negative log-likelihood.                                          ∗             2     x β }

                                                                              P (y|x, z; β ) =             x ⊤ β∗    .      (13)

Next, applying Jensen’s inequality shows that H(θ|ϕ) is                                               1+e

minimized at θ = ϕ where H(θ|θ) = 0. Consequently, it               Under this simplification, the EM update of the expert pa-

follows that the negative log-likelihood gradient matches           rameter β is now given as

that of the surrogate EM objective at ϕ = θ, i.e., ∇L(θ) =                                 "          "             ⊤

                                                                                                                       !##

∇Q(θ|θ). This suggests that any stationary point of L(θ) is           t+1                                    1 + ex β

                                                                    β     = argmin EX,Y EZ|x,y,θt log         yz+1 ⊤        .

also a stationary point of the EM algorithm and vice versa.                  β∈Rd                           e 2 x β



                                                                4

