Skip to main content
QUICK REVIEW

[Paper Review] AntMan: Sparse Low-Rank Compression to Accelerate RNN inference

Samyam Rajbhandari, Harsh Shrivastava|arXiv (Cornell University)|Oct 2, 2019
Domain Adaptation and Few-Shot LearningComputer Science32 references3 citations
TL;DR

AntMan proposes a hybrid compression technique for RNNs that combines structured sparsity via localized group projections (LGP) with low-rank matrix decomposition to drastically reduce computation and model size. It achieves up to 100x computation reduction with less than 1-point accuracy drop and delivers super-linear speedups on commodity CPUs by improving memory access efficiency through cache-friendly, structured sparsity.

ABSTRACT

Wide adoption of complex RNN based models is hindered by their inference performance, cost and memory requirements. To address this issue, we develop AntMan, combining structured sparsity with low-rank decomposition synergistically, to reduce model computation, size and execution time of RNNs while attaining desired accuracy. AntMan extends knowledge distillation based training to learn the compressed models efficiently. Our evaluation shows that AntMan offers up to 100x computation reduction with less than 1pt accuracy drop for language and machine reading comprehension models. Our evaluation also shows that for a given accuracy target, AntMan produces 5x smaller models than the state-of-art. Lastly, we show that AntMan offers super-linear speed gains compared to theoretical speedup, demonstrating its practical value on commodity hardware.

Motivation & Objective

  • To address the high computational and memory costs of RNN inference in resource-constrained environments like mobile devices and servers.
  • To overcome the limitations of unstructured sparsity and coarse-grained structured sparsity in RNN compression by introducing a more efficient, hardware-friendly sparsity pattern.
  • To synergistically combine structured sparsity and low-rank decomposition to reduce model size and computation while preserving accuracy.
  • To enable practical, real-world speedups on commodity CPUs by optimizing memory access and leveraging cache efficiency.
  • To develop an efficient training pipeline using knowledge distillation that enables high-accuracy compressed models with minimal hyperparameter tuning.

Proposed method

  • AntMan replaces standard matrix-vector multiplications in RNNs with localized group projections (LGP), which divide input and output vectors into groups and compute outputs as linear combinations within corresponding groups.
  • It introduces a permutation or dense matrix to combine outputs across groups, enabling cross-group information flow and preserving model accuracy despite compression.
  • Low-rank decomposition (e.g., SVD) is applied to the projection matrices P and Q in the factorized multiplication PQx, with LGP enforced on P and Q to further reduce computation.
  • The method reduces computational cost and model size by O(r²) compared to standard low-rank methods, which scale as O(r), due to the synergy between structured sparsity and low-rank approximation.
  • A knowledge distillation framework is used for training, combining label loss with student-teacher MSE and KL divergence losses to transfer knowledge efficiently.
  • A novel coefficient selection technique is introduced to optimize the distillation loss weights with minimal hyperparameter trials, improving training efficiency.

Experimental results

Research questions

  • RQ1Can structured sparsity combined with low-rank decomposition achieve significant computation and memory reduction in RNNs without degrading accuracy?
  • RQ2Does the proposed LGP-based structured sparsity enable better practical speedups on commodity CPUs compared to theoretical computation reduction?
  • RQ3Can AntMan produce smaller models than state-of-the-art methods for a given accuracy target in language modeling and machine reading comprehension tasks?
  • RQ4How does the combination of LGP and low-rank decomposition compare to unstructured sparsity or standard low-rank methods in terms of efficiency and accuracy?
  • RQ5To what extent can AntMan’s compression technique be generalized to other matrix-multiplication-based deep learning layers beyond RNNs?

Key findings

  • AntMan achieves up to 100x reduction in computation for language modeling and machine reading comprehension tasks with less than 1-point drop in F1 score or perplexity.
  • For the PTB language model, AntMan achieves 50x computation reduction with no accuracy drop and 100x reduction with only a 1-point increase in perplexity.
  • With a given accuracy target, AntMan produces models that are 5x smaller than state-of-the-art models, reducing RNN weights by 3x to 25x.
  • On CPU hardware, AntMan delivers actual speedups of up to 30x for large RNNs (e.g., hidden dimension 1600), significantly exceeding theoretical speedup due to improved cache utilization.
  • For medium and large problem sizes, even modest 2x to 10x theoretical computation reduction results in 2x to 30x actual speedup, demonstrating strong practical performance gains.
  • The method’s performance is especially pronounced when model weights exceed L3 cache size, as AntMan’s reduced memory footprint enables efficient on-chip computation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.