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

Yixiao Li, Yifan Yu, Qingru Zhang, Chen Liang, Pengcheng He, Weizhu Chen, Tuo Zhao

Introduction

Large Language Models (LLMs) such as GPT-3, T5, and DeBERTa have redefined the state-of-the-art in natural language processing. However, their massive parameter counts—often reaching billions—present significant challenges for deployment on standard hardware due to high memory and computational requirements. To address this, researchers typically employ model compression techniques, primarily categorized into pruning and low-rank approximation.

While effective at moderate compression levels, both methods face limitations at extreme scales. Pruning removes "unimportant" weights, but in dense LLMs, most neurons are highly expressive; aggressive pruning often discards vital information, leading to performance collapse. Low-Rank Approximation factors large matrices into smaller ones, assuming neurons share a common subspace. While efficient, this approach ignores the "diversity" of neurons—the unique, incoherent features that are essential for nuanced language understanding.

LoSparse (Low-Rank and Sparse) is a novel compression strategy that bridges this gap by approximating weight matrices as the sum of a low-rank matrix and a sparse matrix, effectively capturing both shared and unique features of the model's neurons.

The LoSparse Methodology

The core innovation of LoSparse is the decomposition of the weight matrix $W$ into two distinct components:

$$W \approx UV + S$$

  • Low-Rank Component ($UV$): This captures the "coherent" parts of the neurons—features that are shared across the parameter space. It is initialized using Singular Value Decomposition (SVD) on the pre-trained weights.
  • Sparse Component ($S$): This captures the "incoherent" but highly expressive parts—the unique features that do not fit into the low-rank subspace.

The Algorithm

  1. Initialization: The process begins with an SVD of the original weight matrix. The top $r$ singular values and vectors form the initial $U$ and $V$ matrices. The remaining residual information is used to initialize the sparse matrix $S$.
  2. Iterative Pruning: During the fine-tuning phase, $U, V$, and $S$ are updated via gradient descent. The authors apply structured pruning to $S$, removing entire columns (neurons) based on an importance score calculated as the product of the weight and its gradient.
  3. Computational Efficiency: To maintain hardware friendliness, the forward pass is reorganized as $(XU)V + XS$. This ensures the model remains structured, allowing for efficient computation on standard accelerators.

Key Insights and Theoretical Motivation

The Decoupling Effect

By explicitly removing the coherent subspace via the $UV$ component, the importance scores of the remaining $S$ matrix become significantly more skewed. This decoupling makes it easier for the pruning algorithm to distinguish between truly redundant information and the critical "tail" of the distribution.

Diversity vs. Coherence

LLM weight matrices typically exhibit a "heavy-tailed" distribution of singular values. The low-rank component $UV$ handles the dominant singular values, providing a "knowledge floor" that prevents the model from diverging during aggressive compression. Meanwhile, the sparse component $S$ allows the model to retain the diverse, high-frequency information hidden in the tail of the spectrum—information that a pure low-rank approach would otherwise smooth over.

Synergy with Knowledge Distillation

LoSparse is orthogonal to Knowledge Distillation (KD). When combined with KD, LoSparse reaches performance levels that exceed specialized distilled models like TinyBERT, suggesting that the structural preservation offered by LoSparse provides a better foundation for student models to learn from teachers.

Experimental Results

The authors evaluated LoSparse across Natural Language Understanding (GLUE), Question Answering (SQuAD), and Natural Language Generation (XSum, CNN/DailyMail) benchmarks using architectures like BERT, DeBERTaV3, and BART-large.

  • NLU Performance: On the MNLI benchmark at 10% parameter retention, LoSparse achieved 81.7% accuracy, outperforming the best baseline (Iterative Pruning) by 2.0%.
  • Question Answering: On SQuAD v1.1 with DeBERTaV3, LoSparse outperformed the baseline by 2.5 F1 points at 10% parameters. At an extreme 5% parameter level, the performance gap widened to 3.3 points.
  • Generative Tasks: Compressing BART-large to 30% of its original size for the XSum task, LoSparse outperformed Iterative Pruning by 2.99 points in Rouge-1, demonstrating its efficacy for complex sequence-to-sequence tasks.
  • Stability: Unlike standard pruning, which often leads to model divergence at high sparsity levels, LoSparse remained stable. The low-rank component ensures that weight matrices never drop to zero, maintaining the structural integrity of the network.

Limitations and Future Work

While LoSparse demonstrates superior performance, it introduces new hyperparameters, specifically the balance between the rank $r$ of $UV$ and the sparsity level of $S$. While the model is not overly sensitive to these values, finding the optimal configuration for every layer currently requires manual tuning. Additionally, while the method is "structured" and theoretically faster, future research is needed to provide extensive wall-clock latency benchmarks across diverse hardware backends, such as mobile CPUs and edge devices. Extending LoSparse to massive foundation models like Llama or GPT-4 remains a promising avenue for future exploration.

Summary updated

BibTeX
@inproceedings{li2023losparse,
  author = {Yixiao Li and Yifan Yu and Qingru Zhang and Chen Liang and Pengcheng He and Weizhu Chen and Tuo Zhao},
  title = {{LoSparse: Structured Compression of Large Language Models based on Low-Rank and Sparse Approximation}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=STmbtFRpdz},
}
Figure