Abstract
Large language models (LLMs) significantly enhance the performance of various applications, but they are computationally intensive and energy-demanding. This makes it challenging to deploy them on devices with limited resources, such as personal computers and mobile/wearable devices, and results in substantial inference costs in resource-rich environments like cloud servers. To extend the use of LLMs, we introduce a low-rank decomposition approach to effectively compress these models, tailored to the requirements of specific applications. We observe that LLMs pretrained on general datasets contain many redundant components not needed for particular applications. Our method focuses on identifying and removing these redundant parts, retaining only the necessary elements for the target applications. Specifically, we represent the weight matrices of LLMs as a linear combination of base components. We then prune the irrelevant bases and enhance the model with new bases beneficial for specific applications. Deep compression results on the Llama 2-7b and -13B models, conducted on target applications including mathematical reasoning and code generation, show that our method significantly reduces model size while maintaining comparable accuracy to state-of-the-art low-rank compression techniques.
Introduction: The Redundancy Problem in LLMs
While Large Language Models (LLMs) have revolutionized natural language processing, their massive parameter counts pose significant deployment challenges. Running these models in the cloud is expensive, and edge deployment on smartphones or wearables is often unfeasible. Standard compression techniques, such as Singular Value Decomposition (SVD) or weight pruning, frequently encounter a "performance cliff"—a sharp drop in accuracy once a certain compression threshold is crossed.
Researchers from Meta and Iowa State University argue that this performance degradation occurs because general-purpose LLMs contain massive amounts of task-irrelevant redundancy. A model trained on a diverse internet corpus contains "semantic bases" for a vast array of topics. If a specific application only requires mathematical reasoning, the components dedicated to unrelated topics like poetry or historical trivia become "dead weight." The core challenge lies in identifying and retaining only the specific components essential for the target task.
Methodology: Basel (Basis Selection)
The proposed method, Basel, approaches weight compression through the lens of signal processing and task-specific importance.
The Basel framework follows a structured four-step process:
- Weight Decomposition: A weight matrix $W$ is viewed as a linear combination of orthonormal bases ($u_i v_i^T$) weighted by singular values ($s_i$).
- Retraining Importance: Unlike standard SVD, which prunes based on original singular values, Basel retrains these values on a target dataset while keeping the basis vectors fixed. This allows the model to signal which bases are truly useful for the task.
- Basis Augmentation: To capture task-specific nuances missing from general pretraining, Basel introduces a small set of new, learnable bases.
- Iterative Pruning: Unimportant bases (those with low retrained singular values) are pruned gradually, allowing the remaining parameters to adapt and maintain performance.
This approach is highly efficient, requiring only approximately 30% of the memory and 46% of the GPU hours compared to full fine-tuning.
Experimental Evaluation
The authors evaluated Basel using Llama 2 (7B and 13B) and Llama 3.2 (3B) models across several domains:
- Mathematical Reasoning: GSM8K and MATH datasets.
- Code Generation: MBPP and HumanEval.
- Language Modeling: WikiText-2.
Key Results and Insights
Basel demonstrates a significant advantage over existing state-of-the-art compression methods, particularly at high compression ratios.
Superior Compression Performance
On mathematical and coding tasks, Basel achieved up to 2.7x more size reduction than standard SVD and FWSVD while maintaining accuracy. In language modeling (WikiText-2), Basel provided a 4x greater size reduction than SVD-LLM. For instance, at a 10x compression ratio, Basel maintained a perplexity of 10.45, whereas SVD-LLM's performance degraded to a perplexity of 15.00 at only a 2.5x ratio.
System Efficiency
Beyond accuracy, Basel-compressed models offer tangible system benefits. At equivalent accuracy levels, Basel improved inference throughput by up to 19% and reduced the memory footprint by up to 37% compared to baseline SVD.
The Value of Frozen Bases
A key insight from the study is that freezing the original basis vectors and only updating the singular values yields better accuracy than allowing the bases to be trainable. This suggests that the necessary "knowledge" is already present within the pretrained bases; the task is simply to select the correct subset. Furthermore, combining Basel with 8-bit quantization was shown to produce a smaller and more accurate model than standard 4-bit quantization.
Conclusion and Future Work
Basel provides a robust alternative to traditional LLM training and compression. By compressing a Llama 3.2-3B model to 1B parameters, the researchers achieved performance comparable to a native 1B model at a fraction of the training cost.
Future research directions include exploring joint pruning of attention matrices (Value and Output) and conducting a more rigorous semantic analysis of the basis vectors to enhance model interpretability. While Basel requires a representative training set for the target application, its ability to drastically reduce model size without sacrificing performance makes it a powerful tool for specialized LLM deployment.
Summary updated