Abstract
Deep learning models for language are notoriously memory-hungry, with the vast majority of their parameters tied up in simple word-lookup tables. MulCode slashes the size of these tables by up to 41x by reimagining how word meanings are composed—switching from traditional addition to a more expressive multiplicative approach combined with frequency-aware adaptive coding.
Introduction
State-of-the-art language models often face a "parameter explosion" problem when deployed on resource-constrained devices like smartphones or IoT hardware. In Recurrent Neural Network (RNN) models, the recurrent layers are relatively compact; the primary memory bottlenecks are the embedding layer (input) and the Softmax layer (output). In many datasets, these two components account for over 90% of the total model size.
Existing compression techniques, such as quantization or low-rank approximation, often treat all vocabulary words with equal weight. This ignores Zipf’s Law, where a few frequent words dominate usage while the majority are rare. Furthermore, previous compositional models relied on additive sub-components, which limits semantic expressivity. MulCode addresses these gaps through a multiplicative framework and frequency-aware optimization.
Methodology
MulCode introduces three primary strategies to compress massive embedding and softmax matrices:
- Multiplicative Multi-way Composition: Instead of storing a unique vector for every word, MulCode utilizes a small set of "base" codebooks. To represent a word, the model selects specific components from these codebooks and combines them using a Hadamard product (element-wise multiplication). This approach provides a significantly higher encoding capacity than additive methods, allowing the model to capture complex semantic nuances with fewer parameters.
- Group Adaptive Coding: Recognizing that word frequency follows a power law, MulCode assigns storage resources non-uniformly. Frequent words receive higher-dimensional codes to maintain accuracy, while rare words are represented with lower-rank codes to maximize space savings.
- Prior-weighted Reconstruction Loss: The training objective is weighted by the empirical distribution of words in the training set. This ensures the compressor prioritizes the accuracy of frequent "heavy hitter" words, which are most critical for overall model performance.
Experimental Results
The researchers evaluated MulCode across four standard benchmarks: PTB-small, PTB-large, the One Billion Word (OBW) dataset, and IWSLT-14 DE-EN for machine translation.
MulCode consistently outperformed state-of-the-art baselines like GroupReduce and DeepCode in both compression ratio and performance retention. For instance, on the OBW dataset, MulCode achieved an 18.2x compression rate for the embedding and Softmax matrices while maintaining competitive perplexity.
In machine translation tasks (IWSLT-14), the model achieved a 17x compression rate with less than a 1% drop in BLEU score. When combined with standard quantization techniques, the compression rate reached a staggering 41.38x, demonstrating that MulCode's compositional structure is highly robust and complementary to other compression methods.
Conclusion and Future Work
MulCode demonstrates that multiplicative composition is a powerful alternative to traditional additive embedding structures. By leveraging the uneven distribution of language frequency, it achieves massive compression without sacrificing semantic integrity.
However, some challenges remain. The requirement for fine-tuning after compression can be time-consuming on massive datasets like OBW. Additionally, while this work focused on RNN-based architectures, future research is needed to determine if these multiplicative benefits translate effectively to Transformer-based models and self-attention mechanisms. Finally, while the model successfully clusters semantically similar words, further work is required to fully interpret the underlying logic of the multiplicative factors.
Summary updated