Abstract
Word embeddings are essential for natural language processing but impose significant memory constraints on edge devices. This paper introduces DiscBlock, an improved approach to compressing embedding matrices via block-wise low-rank approximation. DiscBlock moves beyond simple frequency-based heuristics by employing TF-IDF weighting, a novel differentiable masking technique for task-specific importance learning, and k-means clustering for non-uniform parameter partitioning. Our evaluations across language modeling, translation, and question-answering tasks show that DiscBlock consistently outperforms prior methods, offering a more robust and efficient compression framework.
Introduction
Modern NLP models rely heavily on large embedding matrices, which often contain millions of parameters. This high memory footprint hinders the deployment of state-of-the-art models on resource-constrained devices. Previous attempts at compression, such as GroupReduce, utilized block-wise low-rank approximations but were limited by two primary assumptions: that word frequency is a direct proxy for importance, and that uniform partitioning of words into equal-sized blocks is optimal.
This research argues that these assumptions are flawed. Frequent words (e.g., "the", "is") often carry minimal task-specific information, while uniform blocks fail to capture the power-law distribution inherent in semantic importance. DiscBlock addresses these issues by introducing more sophisticated weighting and structuring mechanisms.
Methodology: The DiscBlock Framework
DiscBlock enhances the block-wise compression pipeline through three major innovations: weighting, differentiable selection, and non-uniform clustering.
Better Weighting and Differentiable Masking
To move beyond frequency, the authors first propose using TF-IDF to penalize uninformative stop words. More importantly, they introduce DiscBlock-D, which treats word importance as a trainable parameter. By applying a masking function to embedding vectors, the model learns which words are critical for a specific downstream task.
As shown in Figure 2, the "Aligned Masking" approach ensures that the mask is applied consistently across the embedding dimensions, facilitating structured compression.
Compensation Functions and Selection Mechanisms
To maintain model performance during rank reduction, "compensation functions"—small, trainable linear layers—are introduced. These layers help the model adapt to lower-dimensional representations without losing critical information.
Figure 5 illustrates the progression of these mechanisms. While (a) represents a baseline with no compensation, (b) introduces discrete selection. The most advanced version, (c) Continuous Selection, utilizes a differentiable function $\phi$ to allow the importance weights to be learned via backpropagation, effectively "starving" less important words of parameters through a sparsity loss.
Non-uniform Clustering
Instead of arbitrary uniform partitioning, DiscBlock uses k-means clustering on the learned importance weights. This allows the framework to group words with similar importance levels into blocks of varying sizes, ensuring that the parameter budget is allocated where it provides the most utility.
Experimental Results
The authors evaluated DiscBlock across a wide range of benchmarks, including WikiText103 for language modeling, SQuAD 1.0 for question answering, and IWSLT14 for machine translation.
Performance and Stability
DiscBlock-D demonstrated significant improvements over the previous state-of-the-art, GroupReduce. For instance, on WikiText103 at 20x compression, DiscBlock-D achieved a perplexity of 75.3, a substantial improvement over GroupReduce's 84.3. The method also showed remarkable stability at extreme compression ratios (e.g., 50x), where other methods often suffer catastrophic performance drops.
Zero-Shot and Hybrid Approaches
A key finding is DiscBlock's effectiveness in "zero-shot" scenarios, where the model performs well even before retraining. Furthermore, the authors demonstrated that DiscBlock is complementary to other techniques. By combining it with quantization (SmallFry) to create "BlockFry," they achieved results that significantly surpassed standard quantization methods.
Conclusion
DiscBlock revisits block-wise embedding compression with a focus on semantic importance rather than simple frequency. By making word weighting differentiable and the block structure non-uniform, the framework achieves a new state-of-the-art in embedding efficiency. Future work may involve integrating these structural constraints directly into the initial training phase of large-scale models to further optimize resource utilization from the outset.
Summary updated