Abstract
Large foundation models (LFMs) achieve strong performance through scaling, yet current structural pruning methods derive fixed pruning decisions during inference, overlooking sparsity patterns that emerge in the autoregressive token generation. In this paper, we propose POP (Partition-guided Online Pruning), an efficient online structural pruning framework that enables context-conditioned dynamic pruning with minimal computational overhead. POP partitions model channels into retained, candidate, and pruned regions, where prefilling defines a coarse pruning partition, and the decoding stage generates a fine-grained mask within the candidate region, avoiding full-channel re-evaluation. The coarse pruning partition preserves consistently important weights, while the fine-grained masking provides context-conditioned variation during decoding. Moreover, POP is a lightweight, plug-and-play method that requires no preprocessing, including offline calibration, retraining, or learning predictors. Extensive evaluations across diverse LFMs, including large language models (LLMs), mixture-of-experts models (MoEs), and vision-language models (VLMs), demonstrate that POP consistently delivers higher accuracy than existing pruning approaches while incurring smaller computational overhead and minimizing inference latency.
Introduction
Large Foundation Models (LFMs), such as Llama and various Vision-Language Models, have revolutionized AI but remain computationally prohibitive for many real-world applications. Structural pruning is a common strategy to mitigate these costs by removing entire neural pathways (channels), which leads to direct hardware speedups. However, traditional structural pruning is typically static: pruning decisions are made once—either offline or during the initial prompt processing (prefilling)—and remain fixed throughout the generation process.
This static approach fails to account for contextual sparsity. As a model generates text token-by-token, the importance of specific channels can shift dramatically. A channel deemed unimportant for the initial prompt may become vital for the 50th generated token. Consequently, static methods often suffer significant performance degradation in long-form generative tasks like coding or mathematics. POP addresses this by enabling dynamic, context-aware pruning updates during the decoding stage without the prohibitive overhead of full-model re-evaluation.
Methodology: Partition-guided Online Pruning (POP)
POP is a two-stage, plug-and-play framework that operates entirely at inference time. It focuses on pruning Feed-Forward Networks (FFNs), which constitute the majority of parameters in modern LFMs.
1. Prefilling Stage (Coarse Partitioning)
During the initial processing of the prompt, POP calculates importance scores for all FFN channels. Instead of a simple binary mask, it partitions channels into three distinct regions:
- Retained Region: Channels with consistently high importance that remain active.
- Pruned Region: Channels with consistently low importance that are permanently disabled.
- Candidate Region: A subset of borderline channels whose importance is likely to fluctuate during generation.
2. Decoding Stage (Fine-Grained Online Pruning)
As the model generates tokens, POP dynamically recalculates importance scores only for channels within the Candidate Region. By restricting dynamic updates to this small subset, POP captures contextual sparsity while avoiding the massive computational bottleneck of re-evaluating the entire network at every step.
Key Results and Discussion
POP was evaluated across a diverse suite of benchmarks, including QA tasks (BoolQ, ARC), coding (MBPP, HumanEval), and math (GSM8K). The results demonstrate that POP effectively "rescues" performance that is typically lost by static pruning methods.
- Superior Accuracy: On Llama-3.1-8B at 20% sparsity, POP outperformed state-of-the-art baselines like Wanda-sp and FLAP by an average of 17.71% on generation tasks. It maintains robust performance even at aggressive 40% pruning ratios where other methods often collapse.
- Minimal Overhead: The dynamic candidate selection adds only a negligible 2.85% FLOPs overhead to FFN computations. Overall, POP achieves a 1.29x end-to-end inference speedup on Llama2-7B.
- Zero Preparation Time: Unlike methods like Týr, which can require over 170 hours of offline calibration for large models, POP requires zero preprocessing. It is a truly "plug-and-play" solution that relies solely on runtime activations.
Conclusion
POP demonstrates that dynamic, context-conditioned pruning is not only possible but highly efficient when guided by a partitioned approach. By exploiting the natural stability of high-importance channels and the volatility of middle-tier ones, POP sets a new standard for efficient LFM inference. Future work will explore extending this partition-guided logic to other architectural components, such as attention mechanisms, to further push the boundaries of model compression.
Summary updated