Abstract
Large Language Models (LLMs) present significant deployment challenges due to their immense computational and memory requirements. While structured compression techniques like pruning and low-rank approximation offer potential solutions, existing methods often apply a uniform strategy across all Transformer sub-layers. This paper introduces LoRAP (Low-Rank and Pruning), a framework that recognizes the distinct mathematical properties of Multi-Head Attention (MHA) and Feed-Forward Network (FFN) layers. By applying Activation Weighted SVD (AWSVD) to MHA and structured pruning to FFN, LoRAP achieves superior accuracy and perplexity compared to state-of-the-art uniform compression methods, maintaining high performance even at 50% compression ratios.
Introduction
The rapid advancement of Large Language Models (LLMs) such as LLaMA and ChatGPT has revolutionized natural language processing, yet their deployment remains constrained by high resource demands. To mitigate this, researchers have explored various compression techniques, primarily structured pruning (removing entire channels or heads) and low-rank approximation (decomposing weight matrices). However, most current approaches treat the Transformer architecture as a monolithic entity, applying the same compression logic to every module.
LoRAP challenges this "one-size-fits-all" paradigm. The authors observe a fundamental structural discrepancy: MHA sub-layers exhibit a strong low-rank structure, making them ideal candidates for decomposition, whereas FFN sub-layers do not. Forcing low-rank structures onto FFNs or aggressive pruning onto MHAs leads to significant and unnecessary performance degradation. LoRAP addresses this by implementing a differentiated compression strategy tailored to the specific mathematical nature of each sub-layer.
The LoRAP Framework
Differentiated Compression Strategy
LoRAP employs two distinct techniques for the primary components of the Transformer block:
- MHA: Activation Weighted SVD (AWSVD): Standard Singular Value Decomposition (SVD) treats all weights with equal priority. However, LLMs often exhibit "outlier" activations that carry disproportionate importance. LoRAP introduces AWSVD, which weights the weight matrix by the $L_2$ norm of input activations before decomposition. This ensures that weights interacting with critical activations are preserved. Furthermore, LoRAP optimizes parameter allocation within the MHA, assigning 75% of the budget to the Value ($W_v$) and Output ($W_o$) matrices, which were found to require higher capacity than the Query ($W_q$) and Key ($W_k$) matrices.
- FFN: Structured Channel Pruning: Because FFNs lack a natural low-rank structure, LoRAP utilizes gradient-free channel pruning. It identifies and groups interconnected channels across the FFN’s three linear layers, pruning them based on importance scores derived from activation norms. This approach avoids the high memory overhead associated with gradient calculations.
The "Junk DNA" Hypothesis
A unique finding in the LoRAP research is the importance of the least significant parameters. The authors discovered that retaining the bottom 1% of parameters—those typically discarded first—is vital for maintaining model performance. Completely removing these "junk" weights severely impacts emergent reasoning abilities, suggesting that even low-importance weights encode niche but necessary knowledge.
Knowledge Recovery
To bridge the gap between the compressed model and the original, LoRAP includes a brief post-compression phase of Low-Rank Adaptation (LoRA) fine-tuning. This step allows the model to recalibrate its remaining parameters and recover performance lost during the structural transformation.
Experimental Results
Performance and Accuracy
The authors evaluated LoRAP across LLaMA-1, LLaMA-2, and Vicuna models (7B to 30B parameters). In zero-shot commonsense reasoning tasks (including BoolQ, HellaSwag, and ARC), LoRAP demonstrated remarkable resilience. At a 20% compression ratio, LoRAP achieved an average accuracy of 61.71% on LLaMA-7B, closely trailing the original model's 63.25% and significantly outperforming other structured compression baselines.
In terms of perplexity, LoRAP showed a clear advantage. At 50% compression on LLaMA-7B without fine-tuning, LoRAP maintained a WikiText2 perplexity of 56.96. In contrast, competing methods like LLM-Pruner and LoRAPrune saw their perplexity spike to 112.44 and 121.96, respectively.
Hardware Efficiency
Beyond theoretical metrics, LoRAP delivers tangible efficiency gains. At a 50% compression ratio, the framework provides approximately a 31% reduction in inference latency on standard hardware. This confirms that the structured nature of LoRAP's pruning and decomposition translates effectively into real-world speedups.
Conclusion and Future Work
LoRAP demonstrates that differentiated compression is essential for maximizing the efficiency of LLMs. By respecting the mathematical differences between MHA and FFN sub-layers, LoRAP achieves a better balance of size, speed, and intelligence than uniform methods.
Future research directions include exploring non-uniform layer-wise compression, as early and late layers in a Transformer likely possess different sensitivities to parameter loss. Additionally, while LoRAP performs exceptionally well up to 50% compression, maintaining performance at extreme ratios (e.g., 70% or higher) remains a significant challenge for the field.
Summary updated