TL;DR
AdaSVD is a new compression framework that shrinks Large Language Models (LLMs) using Singular Value Decomposition (SVD) while significantly narrowing the performance gap compared to original models. By adaptively compensating for truncation errors and assigning layer-specific compression ratios, it outperforms existing state-of-the-art methods, particularly at high compression levels (60%+).
What Problem Does This Paper Address?
Large Language Models like LLaMA-70B are incredibly capable but notoriously memory-hungry, making them difficult to deploy on consumer hardware or edge devices. While Singular Value Decomposition (SVD) is a popular way to compress these models by approximating large weight matrices with smaller, low-rank ones, it has two major flaws:
- Truncation Error: Simply throwing away the smallest singular values introduces errors that degrade model performance. Existing methods often fail to effectively "fix" the remaining weights to compensate for this loss.
- Uniformity Bias: Most methods apply the same compression ratio to every layer in the transformer stack. However, not all layers are equally important; some are critical for reasoning, while others are more redundant.
Methods
The authors introduce AdaSVD, which consists of two primary components designed to make SVD compression "smarter":
- adaComp (Adaptive Compensation): After truncating a weight matrix, the remaining low-rank components ($U$ and $V^\top$) are no longer optimal for the original task.
adaCompuses an alternating update rule to refine these matrices. To ensure numerical stability, they employ the Moore-Penrose pseudoinverse rather than standard matrix inversion, which prevents the optimization from becoming erratic. - Stack-of-Batch (SOB) Strategy: To improve the quality of the compensation without exceeding GPU memory, the authors use a "stack-of-batch" approach. This allows the model to "see" more calibration data by averaging samples into buckets, effectively increasing the data volume used for refinement without increasing the memory footprint.
- adaCR (Adaptive Compression Ratio): Instead of a flat compression rate,
adaCRcalculates a "layer-wise importance" score based on the cosine similarity between a layer's input and output. Layers that significantly transform the data are deemed more important and assigned a higher retention ratio, while more "passive" layers are compressed more aggressively.
Datasets
The researchers evaluated AdaSVD across a diverse set of benchmarks:
- Language Modeling (Perplexity): WikiText-2, Penn Treebank (PTB), and C4.
- Zero-shot Reasoning (Accuracy): WinoGrande, HellaSwag, PIQA, ARC-e, and MMLU.
- Visual Language Models: Evaluated on the COCO dataset using the LLaVA-7B model to test image captioning performance.
Key Insights and Ideas
- The "Bowl Shape" of Importance: One of the most interesting findings is the distribution of layer importance. In the LLaMA family, importance typically follows a bowl-shaped curve: the very first and very last layers are highly critical, while middle layers are often more redundant and can be compressed further.
- Stability is King: The authors show that naive optimization of SVD errors leads to highly unstable updates. By reformulating the problem as a Least Squares Estimation and using the Moore-Penrose pseudoinverse, they achieved a smooth, consistent reduction in error.
- Synergy with Quantization: AdaSVD is orthogonal to weight quantization. The paper demonstrates that combining AdaSVD with 4-bit GPTQ quantization yields even better results than using either method alone at high compression ratios.
Key Results
AdaSVD consistently sets new benchmarks for SVD-based compression:
- High Compression Performance: At a 60% compression ratio on LLaMA2-7B, AdaSVD achieved a perplexity of 50.33 on WikiText-2, vastly outperforming the previous SOTA, SVD-LLM, which sat at 89.90.
- Generalizability: The method showed consistent improvements across different model families, including OPT, Mistral, and Vicuna.
- Visual Reasoning: In image captioning tasks, AdaSVD maintained much higher coherence than vanilla SVD, which often produced repetitive or nonsensical "gibberish" at similar compression levels.
Limitations and Future Work
- Calibration Data Dependency: While
adaCompis efficient, it still requires a small set of calibration data (e.g., 256 samples) to calculate updates. The performance is somewhat sensitive to the quality and volume of this data. - Iteration Overhead: The alternating update process requires several iterations (the authors suggest 15 for high compression). While this is a one-time post-training cost, it adds to the total compression time compared to "one-shot" SVD methods.
- Hardware-Specific Kernels: While SVD reduces the number of parameters, achieving actual wall-clock speedups often requires optimized hardware kernels for low-rank matrix multiplication, which were not the primary focus of this paper.
Summary updated