Abstract
Large Language Model (LLM) pruning is essential for reducing computational costs, yet its impact on specific task performance remains poorly understood. This paper investigates the generalizability of post-training pruning methods across 24 datasets and 10 model families. We identify a significant sensitivity in sentiment analysis tasks, where pruning often inadvertently removes neurons critical for identifying high-impact sentiment words. To address this, we introduce Neuron Semantic Attribution (NSA), an explainability framework that maps neurons to human-readable concepts. Our results demonstrate that calibration data choice significantly affects performance and that NSA can successfully diagnose "lobotomized" neurons in compressed models.
Introduction
The computational demands of Large Language Models (LLMs) necessitate efficient compression techniques like pruning. While pruning—the removal of weights or neurons—effectively reduces model size, its effect on task-specific performance is often unpredictable. Current research highlights a lack of understanding regarding why a pruning method might succeed in reasoning tasks while failing in sentiment classification. This study aims to bridge this gap by examining the role of calibration data and introducing a framework for explainable pruning.
Methods
The study evaluates three state-of-the-art post-training pruning methods: SparseGPT, Wanda, and RIA. Unlike traditional pruning, these methods do not require expensive retraining; they utilize mathematical metrics to identify which weights to remove.
To provide transparency into this process, we propose Neuron Semantic Attribution (NSA). NSA operates in three stages:
- Influential Word Selection: Utilizing Chain-of-Thought (CoT) prompting to identify task-critical words (e.g., "badly" or "excellent" for sentiment analysis).
- Neuron Matching: Identifying neurons in the original (unpruned) model that respond most strongly to these words.
- Comparison: Analyzing the state of these neurons in the pruned model to determine if critical semantic information was lost.
Experimental Setup
The evaluation spans 10 model families (including Llama-2, Llama-3, and OPT) across 24 datasets categorized into sentiment classification (e.g., SST2, Yelp), question answering (e.g., ARC, BoolQ), semantic similarity, and logical reasoning. Additionally, nine different calibration datasets (e.g., C4, WikiText2) were tested to assess the impact of calibration data "flavor" on the final pruned model's quality.
Results and Discussion
Our analysis reveals that sentiment analysis is particularly vulnerable to pruning. Accuracy in sentiment tasks varied by up to 20% depending solely on the calibration dataset used. In contrast, reasoning tasks (e.g., ARC-E, SciQ) proved more robust, likely due to their reliance on broader, more general linguistic patterns that are harder to accidentally delete.
Using NSA, we visualized the "lobotomy" effect, where neurons associated with critical sentiment markers lose activation in pruned models. For instance, in Llama-2-7b, the pruning process can lead to a near-zero activation for neurons responsible for recognizing negative sentiment words like "badly," directly causing the model to fail at sentiment classification tasks.
Key Findings
- Sparsity Limits: Performance generally remains stable up to a 0.4 sparsity ratio (40% removal) but degrades significantly beyond 0.8.
- Method Stability: SparseGPT emerged as the most stable and competitive method across various calibration datasets.
- Calibration Impact: The choice of calibration data is a primary driver of performance; for example, pruning an OPT-7B model using WikiText2 resulted in 77.42% accuracy on Yelp, while a different set dropped it to 55.08%.
Conclusion
This work highlights the risks of "black-box" pruning and introduces NSA as a tool for diagnosing performance drops. By mapping specific neurons to human-readable concepts, we can better understand the trade-offs involved in model compression. Future work includes using NSA to guide the pruning process by protecting critical neurons and extending the framework to vision-language models and bias detection.
Summary updated