                             Learning Mixtures of Experts with EM: A Mirror Descent Perspective



EM for Deep and Sparse MoE: We now describe an EM-like algorithm for training deep and sparse MoE models. The key

idea is to treat the expert selection sequence z = (z1 , . . . , zl ) as a latent variable and optimize the expected complete-data

log-likelihood. We let θ = (w1 , . . . , wl , β1,1 , . . . , βl,k ) denote all model parameters.

In the classical non-sparse MoE setting where we do not choose a subset of experts to go through at each layer, the latent

variables can only be resolved at the last layer. The EM surrogate is then given as follows:



                              Q(θ|θ t ) = −EX,Y EZl |x,y;θt [log p(y|x, zl ; θ)P (zl |x; θ)] .

                                                                                           

                                                                                                                      (72)



where the given probability functions is given at the last layer as



                                               p(y|x, z1 , ..., zl ; θ) = p (y|hl−1 )

                                                 P (z1 , ..., zl |x; θ) = p(zl |hl−1 ; θ).



In the sparse MoE setting where p experts are chosen at each layer, we re-define the latent variables Zi to be defined over

the set of all possible ordered combinations of p experts

                                                  P       that could have been chosen out of the k available experts. The

latent space embeddings is now given to be ĥi := j∈zi gi (hi−1 ; wi )j fi,j (hi−1 ; βi,j ). The EM surrogate is given by



                      Q(θ|θ t ) = −EX,Y EZ1 ,..,Zl |x,y;θt [log p(y|x, z1 , ..., zl ; θ)P (z1 , ..., zl |x; θ)] .

                                                                                                              

                                                                                                                             (73)



where the given probability functions are decomposed per layer as

                                                                    

                                p(y|x, z1 , ..., zl ; θ) = p y|ĥl−1

                                    P (z1 , ..., zl |x; θ) = P (z1 |x; θ) · · · p(zl |z1 , ..., zl−1 ; θ).



In practice, constructing the above EM surrogate this would require to make a combinatorial number of forward passes

through the model to evaluate the surrogate loss function. To remediate this, we will use the strategy to only evaluate the

loss on the greedily chosen sequence through the model as is the case for GD-type solutions for Sparse MoE.









                                                                    37

