Improving Word Embedding Factorization for Compression using Distilled Nonlinear Neural Decomposition

Vasileios Lioutas, Ahmad Rashid, Krtin Kumar, Md. Akmal Haidar, Mehdi Rezagholizadeh

Abstract: Modern NLP models like BERT and GPT achieve state-of-the-art results but suffer from massive memory footprints, with word embedding matrices often accounting for 30% to over 50% of total parameters. We present Distilled Embedding, a method to compress these matrices using nonlinear neural decomposition and knowledge distillation. By decomposing embeddings into smaller "funnel" layers with ReLU nonlinearities and fine-tuning with a specialized distillation loss, we achieve superior accuracy and inference speed compared to complex state-of-the-art compression techniques.

Introduction

The primary bottleneck for deploying large-scale Transformer models on edge devices, such as smartphones or IoT hardware, is memory. In standard Transformer architectures, the embedding matrix stores a dense vector for every word in a large vocabulary (typically 32k–50k). When parameter tying is used (sharing weights between input and output layers), these embeddings represent roughly 37% of the model; without tying, this figure can exceed 54%.

Existing compression methods, including Singular Value Decomposition (SVD), Product Quantization, and Tensor Train Decomposition, often introduce significant complexity, require extensive hyperparameter tuning, or necessitate full matrix reconstruction during inference, which negates memory benefits and slows down the model.

Methodology: Distilled Embedding

The proposed method treats matrix factorization as a neural network optimization problem rather than a purely linear algebraic one. The approach consists of two main components: funneling decomposition and a two-stage training process.

Funneling Decomposition

Instead of a single large matrix $E$, the authors employ two smaller matrices, $U$ and $V$, with a bottleneck dimension $r$. A ReLU nonlinearity is inserted between them: $\tilde{E} = f(U)V^T$. This "Neural Decomposition" allows the model to capture complex, non-linear relationships that standard linear SVD cannot.

Two-Stage Training and Distillation

  1. Initialization: The matrices $U$ and $V$ are first trained offline to reconstruct a pre-trained embedding matrix by minimizing the $L_2$ reconstruction error ($L_{recon}$).
  2. Distillation Fine-tuning: The decomposed layers are integrated into the full Transformer model. The system is then fine-tuned using a dual-objective loss function: the standard task loss (Cross-Entropy, $L_{ce}$) and an embedding distillation loss that ensures the compressed embeddings remain semantically close to the original teacher embeddings.
Overview of the funneling decomposition and the fine-tuning process with embedding distillation.

This framework supports parameter sharing between input and output layers, further optimizing the parameter count without the overhead of complex reconstruction math during inference.

Experimental Results

The researchers evaluated Distilled Embedding across Machine Translation (WMT’14 En-Fr, WMT’16 En-De, IWSLT Pt-En) and Language Modeling (WikiText-103) tasks.

Performance and Efficiency

On the WMT En-De task, Distilled Embedding achieved a 26.97 BLEU score at approximately 8x compression, outperforming more complex methods like GroupReduce (26.75) and SVD (26.32). In language modeling, the method consistently achieved lower (better) perplexity than SVD at both 3.23x and 6.47x compression rates.

Performance comparison of Distilled Embedding against various compression baselines on machine translation tasks.

Key Insights

  • Nonlinearity as Regularization: The inclusion of ReLU helps the model focus on critical dimensions while filtering out noise.
  • The Importance of Initialization: Starting with random weights leads to significantly poorer performance; mimicking the pre-trained teacher embedding is essential for preserving learned semantic relationships.
  • Inference Speed: Because it avoids complex reconstruction math, Distilled Embedding is significantly faster than Structured Embedding or Tensor Train during inference, performing nearly as fast as uncompressed models.

Conclusion

Distilled Embedding provides a simple yet highly effective way to compress the largest components of modern NLP models. By leveraging nonlinearities and knowledge distillation, the method achieves extreme compression (up to 15.86x on IWSLT with minimal performance loss) while remaining easy to implement and tune. Future work may extend this "distilled funneling" logic to other heavy components of the Transformer architecture, such as the large feed-forward network (FFN) layers.

Summary updated

BibTeX
@inproceedings{lioutas2020improving,
  author = {Vasileios Lioutas and Ahmad Rashid and Krtin Kumar and Md. Akmal Haidar and Mehdi Rezagholizadeh},
  title = {{Improving Word Embedding Factorization for Compression using Distilled Nonlinear Neural Decomposition}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2020},
  url = {https://openreview.net/forum?id=q--S__NbRir},
}
Figure