Abstract
Mixture of Softmaxes (MoS) has been shown to be effective at addressing the expressiveness limitation of Softmax-based models. Despite the known advantage, MoS is practically sealed by its large consumption of memory and computational time due to the need of computing multiple Softmaxes. In this work, we set out to unleash the power of MoS in practical applications by investigating improved word coding schemes, which could effectively reduce the vocabulary size and hence relieve the memory and computation burden. We show both BPE and our proposed Hybrid-LightRNN lead to improved encoding mechanisms that can halve the time and memory consumption of MoS without performance losses. With MoS, we achieve an improvement of 1.5 BLEU scores on IWSLT 2014 German-to-English corpus and an improvement of 0.76 CIDEr score on image captioning. Moreover, on the larger WMT 2014 machine translation dataset, our MoS-boosted Transformer yields 29.6 BLEU score for English-to-German and 42.1 BLEU score for English-to-French, outperforming the single-Softmax Transformer by 0.8 and 0.4 BLEU scores respectively and achieving the state-of-the-art result on WMT 2014 English-to-German task.
Introduction: The Softmax Bottleneck
In language generation, models typically use a Softmax function to predict the next word. However, researchers have identified a "Softmax Bottleneck": a single Softmax layer lacks the mathematical rank to represent the complex, high-dimensional distributions of human language.
Mixture of Softmaxes (MoS) was proposed to solve this by averaging multiple Softmax components, effectively increasing the model's expressiveness. However, MoS is computationally expensive. With a large vocabulary $V$ and $K$ mixtures, the model must perform $K$ massive matrix multiplications for every prediction, making it too slow and memory-intensive for most real-world applications.
Methods: Efficient Encoding for MoS
We propose reducing the computational burden by shrinking the effective vocabulary size through two encoding strategies:
- Byte Pair Encoding (BPE): A standard subword tokenization method that breaks rare words into smaller, frequent chunks. This naturally reduces the vocabulary size.
- Hybrid-LightRNN: Our novel contribution builds on LightRNN, which represents words as a sequence of codes. We introduce a "Hybrid" twist: giving the most frequent words their own unique, length-1 code sequences to prevent representation collisions. We use an Optimal Transport algorithm to learn the best mapping of words to these codes, ensuring semantically similar words are grouped together.
By reducing the vocabulary size to a smaller code dictionary, the $O(K \times V)$ cost of $K$ mixtures becomes manageable.
Key Results
Our MoS-boosted Transformer achieved a new state-of-the-art result on the WMT 2014 English-to-German benchmark, outperforming previous models and the single-Softmax baseline.
Beyond raw performance, the efficiency gains are substantial. Our approach effectively halved the memory consumption and computation time compared to standard MoS implementations without losing translation quality. As shown in the efficiency analysis below, the proposed encoding schemes allow MoS to scale to large tasks with significantly reduced resource requirements.
Discussion and Insights
- Efficiency-Expressivity Tradeoff: MoS provides the expressivity needed to overcome the Softmax bottleneck, while BPE/Hybrid-LightRNN provides the efficiency required for practical use.
- Frequent Words are Special: In Hybrid-LightRNN, realizing that frequent words shouldn't share embeddings was a key breakthrough, significantly boosting BLEU scores by preventing representation "collisions."
- Diminishing Returns: While increasing the number of mixtures ($K$) helps, the benefits taper off. For most tasks, 9 to 15 mixtures provided the best balance of performance and speed.
Conclusion
This work demonstrates that the powerful Mixture of Softmaxes technique can be made practical for large-scale tasks. By combining MoS with efficient encoding schemes like BPE and Hybrid-LightRNN, we achieve state-of-the-art results in machine translation while maintaining manageable computational costs. Future work will explore combining the learned mapping of Hybrid-LightRNN with the subword flexibility of BPE to get the best of both worlds.
Summary updated