Skip to main content
QUICK REVIEW

[Paper Review] LoSparse: Structured Compression of Large Language Models based on Low-Rank and Sparse Approximation

Yixiao Li, Yifan Yu|arXiv (Cornell University)|Jun 20, 2023
Tensor decomposition and applicationsMathematics7 citations
TL;DR

LoSparse compresses transformer weights by decomposing each weight matrix into a low-rank part plus a sparse part, achieving better performance than prior pruning or low-rank methods across NLU, QA, and NLG tasks.

ABSTRACT

Transformer models have achieved remarkable results in various natural language tasks, but they are often prohibitively large, requiring massive memories and computational resources. To reduce the size and complexity of these models, we propose LoSparse (Low-Rank and Sparse approximation), a novel model compression technique that approximates a weight matrix by the sum of a low-rank matrix and a sparse matrix. Our method combines the advantages of both low-rank approximations and pruning, while avoiding their limitations. Low-rank approximation compresses the coherent and expressive parts in neurons, while pruning removes the incoherent and non-expressive parts in neurons. Pruning enhances the diversity of low-rank approximations, and low-rank approximation prevents pruning from losing too many expressive neurons. We evaluate our method on natural language understanding, question answering, and natural language generation tasks. We show that it significantly outperforms existing compression methods.

Motivation & Objective

  • Motivate the need for efficient compression of large transformer models.
  • Propose a joint low-rank plus sparse approximation to capture coherent and incoherent neuron parts.
  • Develop an algorithm to train and prune the sparse component while preserving pre-trained knowledge.
  • Demonstrate effectiveness across natural language understanding, question answering, and natural language generation tasks.

Proposed method

  • Approximate each weight W as W = UV + S, where U,V form a low-rank matrix and S is a structured sparse matrix.
  • Initialize U and V from the top-r components of the SVD of W(0) and set S(0) = W(0) − UV; replace forward pass with Y = (XU)V + XS.
  • Iteratively update U,V,S via gradient steps; prune S by neuron importance scores Γ(S*i) to keep only top p_t% of neurons, with a cubic decay schedule for p_t.
  • Compute neuron importance Γ(W*i) as the average smoothed importance over I(wij) = | w_ij ∂L/∂w_ij | across the neuron, adapted for structured pruning.
  • Use a cubic schedule to gradually reduce the remaining fraction p_t from 1 to a target p_T over training steps.
  • Optionally combine LoSparse with knowledge distillation and other compression methods to further improve performance.

Experimental results

Research questions

  • RQ1Can the combination of low-rank and sparse approximations outperform purely low-rank or pruning approaches in transformer compression?
  • RQ2How does LoSparse perform on NLU (GLUE), QA (SQuAD), and NLG (XSum) benchmarks compared to baselines like Movement pruning and ITP?
  • RQ3How does the allocation between low-rank and sparse components affect performance and stability across tasks?
  • RQ4Can LoSparse be effectively integrated with distillation methods and other compression frameworks?

Key findings

  • LoSparse significantly outperforms existing pruning methods on GLUE tasks such as MNLI, with more than 2.0% higher accuracy in some cases.
  • On SQuADv1.1, LoSparse surpasses other pruning methods by 3.3 points in F1 under extreme sparsity and remains competitive at higher remaining ratios.
  • In XSum summarization, LoSparse exceeds current methods by 2.99 points in ROUGE-1, and shows greater gains on harder tasks where abstractive summarization is needed.
  • LoSparse maintains stability during training by ensuring every weight matrix retains a low-rank component in addition to pruning the sparse part, reducing divergence seen in other pruning methods.
  • The method is orthogonal to knowledge distillation and can further improve performance when combined with distillation or embedded into other compression frameworks like CoFi.

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.