NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Online Embedding Compression for Text Classification using Low Rank Matrix Factorization

Anish Acharya, Rahul Goel, Angeliki Metallinou, Inderjit Dhillon

TL;DR

Researchers at Amazon and UT Austin have developed a method to shrink massive NLP models by up to 90% with less than a 2% drop in accuracy. By applying low-rank matrix factorization (SVD) to the embedding layer during training and introducing a new "Cyclically Annealed Learning Rate" (CALR) schedule, they’ve created a flexible way to deploy high-performance text classifiers on memory-constrained devices like smartphones.

What Problem Does This Paper Address?

In the world of Natural Language Processing (NLP), deep learning models are notoriously "heavy." While we often focus on the complexity of LSTMs or Transformers, the real memory hog is usually the word embedding layer.

For a typical model with a vocabulary of 1 million tokens and 300-dimensional vectors, the embedding matrix alone takes up about 2GB of memory. This "embedding bottleneck" makes it nearly impossible to run state-of-the-art models on mobile devices or to serve millions of requests efficiently on the cloud. Existing solutions like quantization (reducing bit-precision) are often "lossy" and lack flexibility—you can usually only compress by factors of 2 or 4 (e.g., moving from 32-bit to 16-bit or 8-bit).

Methods

The authors propose a two-pronged approach:

  1. Online Low-Rank Matrix Factorization (LMF): Instead of training a small model from scratch, they start with a full-sized model. During training, they apply Singular Value Decomposition (SVD) to the embedding matrix $W$, splitting it into two smaller matrices ($W_a$ and $W_b$). Crucially, they then continue training ("fine-tuning") the model in this compressed state. This allows the model to "learn" how to recover the accuracy lost during the compression step.
  2. Cyclically Annealed Learning Rate (CALR): To help the model recover accuracy after compression, they introduced a new learning rate schedule. CALR builds on Cyclic Learning Rates (which bounce the learning rate between a floor and a ceiling) by exponentially decaying the "ceiling" over time. This mimics simulated annealing, allowing the model to explore the loss landscape broadly at first and then settle into a sharp local minimum.

Datasets

The method was evaluated on two distinct tasks:

  • Stanford Sentiment Treebank (SST2): A standard public benchmark for binary sentiment classification (movie reviews).
  • Books Intent Classification Dataset: A proprietary dataset consisting of 60,000 user utterances (e.g., "search for a book") directed at a digital assistant, categorized into 20 different intents.

Key Insights and Ideas

  • Arbitrary Compression Ratios: Unlike quantization, which is limited by bit-depth, LMF allows engineers to choose any compression fraction ($p$). If your hardware only has 10MB of space left, you can calculate the exact rank ($k$) needed to fit.
  • The Power of Fine-Tuning: The "Online" part of the title is key. Compressing a matrix offline (Baseline 2) leads to significant accuracy drops. However, by keeping the model in the training loop after SVD, the weights in the new, smaller layers can adapt to compensate for the missing information.
  • Depth Matters: The authors found that LSTMs (deeper, recurrent) benefit more from this method than shallow networks like Deep Averaging Networks (DAN). Deep networks are particularly sensitive to the "noise" introduced by standard quantization, making LMF a superior choice for complex architectures.
  • FLOP Efficiency: The paper provides a mathematical proof that their structured compression is not just smaller in memory, but also requires fewer floating-point operations (FLOPs) for inference compared to 8-bit quantization, provided the compression ratio is aggressive enough.

Key Results

  • 90% Compression: On the SST2 benchmark using an LSTM, the method achieved 90% compression with an accuracy of 85.11% (compared to 86.03% for the uncompressed model). This represents only a ~1% relative degradation.
  • Outperforming Baselines: At similar compression levels, the proposed method consistently beat both fixed-point quantization and offline SVD compression. For example, at 90% compression, the "online" method was roughly 2.5% more accurate than the "offline" version.
  • CALR Superiority: The new learning rate schedule outperformed standard Adam and Adagrad optimizers, pushing the uncompressed LSTM accuracy on SST2 to 86.03%, a new high compared to previous literature.

Limitations and Future Work

  • Task Variety: The study focused strictly on text classification. The authors acknowledge that future work is needed to see if these results hold for more complex NLP tasks like sequence tagging (NER) or sequence-to-sequence modeling (Translation).
  • Hardware Specifics: While the FLOP analysis is promising, actual "wall-clock" speedups can vary based on how specific hardware handles matrix-matrix multiplication vs. low-precision arithmetic.
  • Hyperparameter Sensitivity: The CALR schedule introduces new hyperparameters (decay rates, step sizes) that may require careful tuning for different datasets.

Summary updated

BibTeX
@inproceedings{acharya2019online,
  author = {Anish Acharya and Rahul Goel and Angeliki Metallinou and Inderjit Dhillon},
  title = {{Online Embedding Compression for Text Classification using Low Rank Matrix Factorization}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33016196},
}
Figure