Mixture of ExpertsMixture of experts

A few small experts, each a linear model or a network with one hidden layer of four units, and a router that reads the same point and gives, through a softmax, the weight of every expert in the answer, are trained together with Adam on a data set in the plane. Since a single expert is usually too weak for the whole problem, the router learns to carve the plane into regions and to send each one to the expert that fits it (the large map below is colored by the expert the router picks, and each expert, in its own panel, is faded wherever it receives no points). With top-1 routing every point is sent to one expert only, which is then the only one to learn from it, and without the balancing loss the experts that win early keep winning until a few of them hold almost all the data; the balancing loss of the Switch Transformer penalizes this imbalance, and the load evens out.

Alcuni piccoli esperti, ciascuno un modello lineare o una rete con uno strato nascosto di quattro unità, e un router che legge lo stesso punto e dà, attraverso una softmax, il peso di ogni esperto nella risposta, sono addestrati insieme con Adam su un insieme di dati nel piano. Poiché di solito un solo esperto è troppo debole per l'intero problema, il router impara a ritagliare il piano in regioni e a mandare ciascuna all'esperto che la approssima (la grande mappa qui sotto è colorata secondo l'esperto scelto dal router, e ogni esperto, nel suo riquadro, è sbiadito dove non riceve punti). Con il routing top-1 ogni punto va a un solo esperto, che è poi il solo a imparare da esso, e senza la loss di bilanciamento gli esperti che vincono all'inizio continuano a vincere finché pochi di loro tengono quasi tutti i dati; la loss di bilanciamento dello Switch Transformer penalizza questo squilibrio, e il carico si livella.

DataDati

500 points, 350 for training in minibatches of 20 and 150 for the test.500 punti, 350 per l'addestramento in minibatch da 20 e 150 per il test.

The plane colored by the expert of largest gate, paler where the router is less sure of its choice (soft routing mixes the experts near the borders), with the training points and, as a thick line, the decision boundary \(y(x) = 0\) of the mixture (for a regression, its level lines). Point at the map to read the gates there.Il piano colorato secondo l'esperto con il gate più grande, più chiaro dove il router è meno sicuro della sua scelta (il routing soft mescola gli esperti vicino ai confini), con i punti di addestramento e, come linea spessa, la frontiera di decisione \(y(x) = 0\) della miscela (per una regressione, le sue linee di livello). Punta la mappa per leggervi i gate.

Mixture outputUscita della miscela

test lossloss di test
training lossloss di addestramento
test accuracyaccuratezza di test

LossLoss

square loss, solid training and dashed test; gold the balancing loss; log scaleloss quadratica, continua l'addestramento e tratteggiata il test; in oro la loss di bilanciamento; scala logaritmica

Expert loadCarico degli esperti

the share \(f_i\) of the training points sent to each expert, now (the dashed line is \(1/K\)) and over the epochsla quota \(f_i\) dei punti di addestramento mandati a ciascun esperto, ora (la linea tratteggiata è \(1/K\)) e lungo le epoche

The expertsGli esperti

The output \(E_i(x)\) of every expert over the whole plane (violet positive, gold negative), faded as its gate \(g_i(x)\) goes to zero, with the border of the region the router gives it.L'uscita \(E_i(x)\) di ogni esperto sull'intero piano (viola positivo, oro negativo), sbiadita quando il suo gate \(g_i(x)\) tende a zero, con il bordo della regione che il router gli assegna.