SoLA: Leveraging Soft Activation Sparsity and Low-Rank Decomposition for Large Language Model Compression
Organizations: The Hong Kong University of Science and Technology (Guangzhou) · The Hong Kong University of Science and Technology
Abstract
Large language models (LLMs) have demonstrated impressive capabilities across various tasks, but the billion-scale parameters pose deployment challenges. Although existing methods attempt to reduce the scale of LLMs, they require either special hardware support or expensive post-training to maintain model quality. To facilitate efficient and affordable model slimming, we propose a novel training-free compression method for LLMs, named "SoLA", which leverages Soft activation sparsity and Low-rAnk decomposition. SoLA can identify and retain a minority of components significantly contributing to inference, while compressing the majority through low-rank decomposition, based on our analysis of the activation pattern in the feed-forward network (FFN) of modern LLMs. To alleviate the decomposition loss, SoLA is equipped with an adaptive component-wise low-rank allocation strategy to assign appropriate truncation positions for different weight matrices. We conduct extensive experiments on LLaMA-2-7B/13B/70B and Mistral-7B models across a variety of benchmarks. SoLA exhibits remarkable improvement in both language modeling and downstream task accuracy without post-training. For example, with a 30% compression rate on the LLaMA-2-70B model, SoLA surpasses the state-of-the-art method by reducing perplexity from 6.95 to 4.44 and enhancing downstream task accuracy by 10%.
Figures & tables
| LLaMA- 2-13B | original | PN | MN | ||
|---|---|---|---|---|---|
| 1% | 10% | 30% | 50% | ||
| perplexity ( ) | 4.57 | 9665.4 | 4.83 | 6.58 | 17.03 |
| Methods | Ratio | Average | MMLU | BoolQ | PIQA | WinoGrande | HellaSwag | ARC-e | ARC-c | OBQA |
| LLaMA-2-7B | 0% | 0.6410 | 0.457 | 0.7777 | 0.7905 | 0.6938 | 0.7592 | 0.7449 | 0.4625 | 0.442 |
| LLM-Pruner | 20% | 0.5512 | 0.262 | 0.6376 | 0.7595 | 0.6338 | 0.6783 | 0.6431 | 0.3993 | 0.396 |
| FLAP | 0.5318 | 0.319 | 0.5394 | 0.7454 | 0.6298 | 0.6474 | 0.6128 | 0.3643 | 0.396 | |
| SliceGPT | 0.4184 | 0.263 | 0.3792 | 0.6126 | 0.5983 | 0.4428 | 0.4609 | 0.2841 | 0.306 | |
| Bolaco | 0.5733 | 0.343 | 0.7201 | 0.7509 | 0.6561 | 0.6433 | 0.6819 | 0.3748 | 0.416 | |
| SVD-LLM | 0.4673 | 0.268 | 0.5468 | 0.6513 | 0.6243 | 0.5173 | 0.4722 | 0.2782 | 0.380 |
| Method | Ratio | LLaMA-2 | Mistral | ||
|---|---|---|---|---|---|
| 7B | 13B | 70B | 7B | ||
| Dense | 0 | 5.11 | 4.57 | 3.12 | 4.92 |
| LLM-Pruner | 20 | 10.55 | 9.67 | - | - |
| FLAP | 6.76 | 5.90 | 8.76 | 7.11 | |
| SliceGPT | 9.70 | 8.21 | 5.76 | 8.23 | |
| Bolaco | 7.31 | 6.34 | - | - | |
| Model | Ratio | Perplexity ( ) | Avg. Acc. ( ) | ||
|---|---|---|---|---|---|
| Unif. | Adap. | Unif. | Adap. | ||
| LLaMA-2-7B | 20 | 8.07 | 7.18 | 0.467 | 0.541 |
| LLaMA-2-13B | 6.18 | 6.52 | 0.557 | 0.564 | |
| Mistral-7B | 7.26 | 6.68 | 0.528 | 0.578 | |
| LLaMA-2-7B | 30 | 11.40 | 9.32 | 0.425 | 0.492 |
| LLaMA-2-13B | 7.93 | 7.02 | 0.485 | 0.541 | |
| Ratio | Total Time of Operation (speedup) | ||
|---|---|---|---|
| 7B | 13B | 70B | |
| 0% | 20.04 | 31.64 | 96.58 |
| 20% | 16.39 (1.22 ) | 21.92 (1.44 ) | 65.76 (1.47 ) |
| 30% | 13.04 (1.54 ) | 17.87 (1.77 ) | 57.04 (1.69 ) |
| Methods | Ratio | Average | MMLU | BoolQ | PIQA | WinoGrande | HellaSwag | ARC-e | ARC-c | OBQA |
|---|---|---|---|---|---|---|---|---|---|---|
| Mistral-7B | 0% | 0.701 | 0.625 | 0.8398 | 0.8205 | 0.7395 | 0.8102 | 0.7955 | 0.5392 | 0.44 |
| FLAP | 20% | 0.500 | 0.259 | 0.6226 | 0.7231 | 0.6409 | 0.5594 | 0.5105 | 0.3191 | 0.368 |
| SliceGPT | 0.427 | 0.286 | 0.3786 | 0.6066 | 0.5943 | 0.4510 | 0.4815 | 0.3003 | 0.320 | |
| SVD-LLM | 0.578 | 0.418 | 0.6829 | 0.7339 | 0.6843 | 0.6175 | 0.7134 | 0.4053 | 0.366 | |
| SoLA (Ours) | 0.581 | 0.442 | 0.6609 | 0.7367 | 0.6875 | 0.6332 | 0.6999 | 0.3976 | 0.392 | |
| FLAP | 30% | 0.496 | 0.264 | 0.6526 | 0.6959 | 0.6480 | 0.5561 | 0.4891 | 0.3055 | 0.358 |
| Model | Compression Ratio | Operations( ) | ||||||
|---|---|---|---|---|---|---|---|---|
| Gate | Up | Down | Q | K | O | Total (speedup) | ||
| LLaMA-2-7B | Dense | 4.94 | 4.79 | 5.09 | 1.75 | 1.74 | 1.74 | 20.04 |
| 20% | 2.92 | 3.52 | 6.66 | 0.87 | 0.69 | 1.74 | 16.39 (1.22 ) | |
| 30% | 2.92 | 3.00 | 4.48 | 0.69 | 0.69 | 1.27 | 13.04 (1.54 ) | |
| LLaMA-2-13B | Dense | 7.14 | 7.12 | 8.11 | 3.07 | 3.09 | 3.12 | 31.64 |
| 20% | 5.61 | 5.08 | 5.44 | 1.34 | 1.34 | 3.12 | 21.92 (1.44 ) | |
LLM Compression
Large language model compression reduces the memory, compute, and context costs of LLMs while aiming to preserve their capabilities.
See all 273 papers