ASVD: Activation-aware Singular Value Decomposition for Compressing Large Language Models

Zhihang Yuan, Yuzhang Shang, Yue Song, Qiang Wu, Yan Yan, Guangyu Sun · DOI

Abstract

ASVD (Activation-aware Singular Value Decomposition) is a training-free, post-training compression method that reduces the size of Large Language Models (LLMs) by 10-30% and cuts KV cache memory requirements by up to 50%. By accounting for activation outliers and varying layer sensitivities, it enables significant memory savings with minimal impact on model performance, even when combined with standard quantization.

Introduction

Large Language Models (LLMs) like LLaMA are notoriously memory-hungry, making them difficult to deploy on consumer hardware or in high-throughput environments. While techniques like quantization (reducing bit-precision) and pruning (removing weights) are popular, low-rank decomposition—approximating a large weight matrix with two smaller ones—has historically struggled with LLMs.

The authors identify two main reasons for this failure:

  1. Activation Outliers: LLMs produce activations with extreme values in specific channels. Standard Singular Value Decomposition (SVD) only looks at weight values, ignoring how these weights interact with massive activation spikes, leading to significant approximation errors.
  2. Layer Sensitivity: Not all layers are created equal. Some (like Multi-Head Attention) are resilient to being thinned out, while others (like Multi-Layer Perceptrons) are highly sensitive. Decomposing every layer at the same ratio leads to immediate performance collapse.

Methodology

The researchers propose ASVD, a training-free paradigm consisting of two main components:

Activation-aware SVD

Instead of performing SVD directly on the weight matrix $W$, ASVD first scales $W$ using a diagonal matrix $S$ derived from the distribution of input activations. This "absorbs" the influence of activation outliers into the weights before decomposition. After the low-rank approximation is made, the scaling is mathematically reversed to maintain the original functional mapping. As illustrated in Figure 4, this approach drastically reduces the Mean Squared Error (MSE) compared to naive SVD when outliers are present.

Figure 4: Comparison of standard SVD versus ASVD in the presence of activation outliers. ASVD significantly reduces the Mean Squared Error (MSE) of the output approximation.

Sensitivity-based Truncation Rank Searching (STRS)

Rather than using a fixed compression ratio, ASVD uses an iterative calibration process. It evaluates how much each layer's rank can be reduced before the model's perplexity (a measure of prediction quality) starts to suffer. It then uses a binary search to find the optimal rank for every single layer in the network.

KV Cache Compression

A particularly clever application of this method is KV Cache Compression. By decomposing the projection matrices in the self-attention mechanism, the model can store intermediate activations in a lower-dimensional space. This drastically reduces the memory footprint required for long-sequence generation without needing to retrain the model.

Evaluation and Results

The authors evaluated ASVD on LLaMA and LLaMA-2 (7B and 13B parameters) using WikiText-2 and Penn Treebank (PTB) for perplexity, and the MMLU benchmark for zero-shot accuracy.

Key results include:

  • Model Size: ASVD achieved a 10-30% reduction in total parameters with negligible loss in accuracy.
  • KV Cache: It successfully reduced KV cache memory by 50% in a training-free manner.
  • Quantization Compatibility: The method remains robust when combined with 8-bit quantization, allowing for stacked memory savings.
Figure 1: Pareto front showing the trade-off between perplexity and weight memory cost for LLaMA-2-13b across different quantization levels. ASVD maintains better performance at lower memory costs.

Discussion and Insights

  • Outliers are the Key: Much like recent breakthroughs in quantization (e.g., LLM.int8()), this paper confirms that managing activation outliers is the secret to LLM efficiency. Making SVD "aware" of these outliers makes the decomposition much more stable.
  • Attention vs. MLP: The study reveals that Attention layers are significantly easier to compress than MLP layers. In some cases, Attention layers could be reduced to 10% of their original rank, whereas MLPs often required 90% to remain functional.

Limitations

Despite the improvements, MLP layers remain difficult to compress deeply. Additionally, while the method is training-free, the STRS rank-searching process requires several forward passes on a calibration set, which can be computationally demanding for very large models. Finally, at extreme compression ratios (below 70% of original parameters), performance begins to degrade sharply, suggesting a hard limit to redundancy removal without retraining.

Summary updated

BibTeX
@misc{yuan2023asvd,
  author = {Zhihang Yuan and Yuzhang Shang and Yue Song and Qiang Wu and Yan Yan and Guangyu Sun},
  title = {{ASVD: Activation-aware Singular Value Decomposition for Compressing Large Language Models}},
  year = {2023},
  eprint = {2312.05821},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.05821},
}
Figure