TL;DR
This paper introduces PBS$^2$P, a novel framework that combines binarization (reducing model weights to 1 bit) with semi-structured pruning to drastically compress Large Language Models (LLMs) while maintaining high performance. Their key innovations, Stepwise Pruning with Binarization Optimization (SPBO) and Coarse-to-Fine Search (CFS), allow for more effective compression than previous methods, significantly narrowing the gap between binarized and full-precision models.
What Problem Does This Paper Address?
Large Language Models (LLMs) have revolutionized NLP, but their massive size leads to prohibitive computational and memory costs, hindering their deployment on resource-constrained devices. Binarization, a form of quantization that reduces weights to a single bit (±1), offers significant compression. However, even binarized models retain redundancy. While pruning can further reduce this, naively combining binarization and pruning often results in substantial performance degradation. Existing methods struggle to balance extreme compression with accuracy, especially when dealing with the intricate selection of parameters to prune. This paper tackles the challenge of achieving highly compressed, yet accurate, binarized LLMs by proposing a unified framework that intelligently integrates semi-structured pruning with binarization.
Methods
The core of the proposed solution is the Progressive Binarization with Semi-Structured Pruning (PBS$^2$P) framework, which comprises two main novel components:
- Stepwise Semi-Structured Pruning with Binarization Optimization (SPBO): Instead of pruning all at once, SPBO progressively prunes a small subset of elements at each step. Crucially, after each pruning step, it jointly optimizes the binarization parameters (scaling factors and binary weights) to adapt to the new sparsity. This iterative approach helps to minimize the cumulative error from both pruning and binarization, leading to more stable and accurate compression. The paper uses an N:M sparsity scheme (e.g., retaining N out of M weights) for semi-structured pruning, which balances compression with hardware efficiency.
- Coarse-to-Fine Search (CFS): This two-stage strategy enhances the selection of which parameters to prune.
- Coarse-Stage: It first estimates the "importance" of each layer by measuring the alignment between its input and output representations. This importance score is then used to assign layer-wise pruning ratios.
- Fine-Stage: Within each layer, it uses a Hessian-based metric, theoretically derived to minimize the error increase introduced by pruning under a second-order approximation, to identify the most redundant elements for pruning, guided by the ratios determined in the coarse stage.
Datasets
The paper evaluates its method on several standard datasets for language modeling and reasoning tasks:
- WikiText2: Used for perplexity evaluation.
- PTB (Penn Treebank): Used for perplexity evaluation.
- C4 (Colossal Clean Crawled Corpus): Used for calibration and perplexity evaluation.
- Seven zero-shot QA datasets: ARC-c, ARC-e, BoolQ, Hellaswag, OBQA, RTE, and Winogrande. These are used to evaluate the accuracy of the compressed models on downstream tasks.
The paper uses a small calibration set (128 samples) for the PTQ process, which is standard practice for such methods.
Key Insights and Ideas
- Progressive pruning is key: The paper's core insight is that gradually pruning and re-optimizing binarization parameters (SPBO) is far more effective than a one-shot approach. This allows the model to adapt and recover from pruning errors more gracefully.
- Hessian-based pruning is theoretically grounded: The use of a Hessian-based metric in the fine-stage search is not arbitrary; it's derived from a theoretical guarantee to minimize error increase under a second-order approximation, providing a principled way to select parameters.
- Layer importance matters for pruning ratios: The coarse-stage search, which assigns pruning ratios based on layer importance, is shown to be crucial. Simply applying uniform pruning or relying on other metrics can lead to worse results.
- Semi-structured pruning is the sweet spot: The paper confirms that semi-structured pruning (specifically N:M sparsity) offers a superior trade-off between compression, hardware efficiency, and performance compared to fully unstructured or structured pruning.
Key Results
- State-of-the-art performance: PBS$^2$P consistently outperforms existing SOTA binary post-training quantization (PTQ) methods across various LLM families (LLaMA, LLaMA-2, LLaMA-3, OPT) and evaluation benchmarks.
- Significant perplexity reduction: On LLaMA-1-7B with 4:8 structured binarization (50% pruning), PBS$^2$P achieved a perplexity of 10.78, a substantial improvement over STBLLM's 31.72.
- Narrowed gap to FP16: The method significantly reduces the performance gap between binarized models and their full-precision counterparts. For example, on LLaMA-13B with 0.8 bits, PBS$^2$P achieved a perplexity of 6.20, compared to the full-precision model's 5.47.
- Competitive zero-shot accuracy: In zero-shot evaluations, PBS$^2$P-compressed models showed superior average accuracy compared to STBLLM at similar bit-widths.
- Efficient inference: The paper demonstrates that PBS$^2$P achieves significant speedups in matrix multiplications compared to FP16 and other 1-bit baselines, especially for wider matrices.
Limitations and Future Work
- Computational overhead: While PBS$^2$P eliminates fine-tuning, the iterative nature of SPBO and the two-stage search (CFS) introduce a moderate increase in computation time compared to simpler PTQ methods. The paper notes this overhead is acceptable as it's performed offline.
- Calibration data sensitivity: Like most PTQ methods, PBS$^2$P's performance can be sensitive to the calibration data. The paper shows it's robust with 128 samples but reducing this further might impact performance.
- Future work: The paper's success suggests further exploration into optimizing the balance between compression and accuracy for even lower bit-widths or different model architectures. The framework's ability to unify pruning and binarization strategies for extreme model reduction is highlighted as a promising direction for deploying LLMs on highly resource-constrained devices.
Summary updated