Improving Generalization in LLM Structured Pruning via Function-Aware Neuron Grouping

Tao Yu, Yongqi An, Kuan Zhu, Guibo Zhu, Ming Tang, Jinqiao Wang

Abstract

Large Language Models (LLMs) demonstrate impressive performance across natural language tasks but incur substantial computational and storage costs due to their scale. Post-training structured pruning offers an efficient solution. However, when few-shot calibration sets fail to adequately reflect the pretraining data distribution, existing methods exhibit limited generalization to downstream tasks. To address this issue, we propose Function-Aware Neuron Grouping (FANG), a post-training pruning framework that alleviates calibration bias by identifying and preserving neurons critical to specific function. FANG groups neurons with similar function based on the type of semantic context they process and prunes each group independently. During importance estimation within each group, tokens that strongly correlate with the functional role of the neuron group are given higher weighting. Additionally, FANG also preserves neurons that contribute across multiple context types. To achieve a better trade-off between sparsity and performance, it allocates sparsity to each block adaptively based on its functional complexity. Experiments show that FANG improves downstream accuracy while preserving language modeling performance. It achieves the state-of-the-art (SOTA) results when combined with FLAP and OBC, two representative pruning methods. Specifically, FANG outperforms FLAP and OBC by 1.5%–8.5% in average accuracy under 30% and 40% sparsity.

Introduction

Structured pruning is a critical technique for deploying massive Large Language Models (LLMs) on resource-constrained hardware. By removing entire rows or columns of weights, it enables actual computational speedups. However, a significant challenge remains: calibration bias. Most current pruning methods rely on a small "calibration set" (e.g., WikiText2) to estimate neuron importance. These small datasets often fail to represent the diverse knowledge—such as coding, mathematics, or specialized sciences—embedded within the model during pretraining.

Consequently, traditional pruning tends to favor "generalist" neurons that perform well on the calibration task while inadvertently deleting "specialist" neurons. This results in models that maintain low perplexity on the calibration set but suffer from poor generalization on diverse downstream tasks.

Comparison between traditional pruning and the proposed FANG framework.

Methodology: Function-Aware Neuron Grouping (FANG)

To mitigate calibration bias, we introduce FANG, a framework that treats the LLM as a collection of specialized functional units. FANG consists of four primary components:

1. Functional Grouping via Context Clustering

The process begins by clustering input tokens from the calibration set into semantic groups (e.g., math, code, literature) using K-means on hidden state embeddings. We then calculate a sensitivity score for each neuron relative to these clusters using a Taylor expansion-based metric. Neurons are then grouped based on which semantic context they are most responsive to.

2. Token-Aware Importance Reweighting

Within each functional group, we refine the importance estimation. Instead of treating all calibration tokens equally, FANG assigns higher weights to tokens that are semantically aligned with the group's specific function. For instance, when evaluating neurons in the "coding group," tokens related to programming syntax are prioritized. This ensures that specialized neurons are judged based on the data they were designed to process.

3. Shared Neuron Group Retention

Some neurons act as "jacks-of-all-trades," contributing significantly across multiple semantic contexts. FANG identifies these high-frequency generalist neurons and exempts them from the pruning process entirely, preserving the model's foundational capabilities.

4. Adaptive Sparsity Allocation

Rather than applying a uniform sparsity level across all layers, FANG adaptively allocates sparsity based on Functional Complexity (FC). FC measures the degree of transformation a block applies to its input (calculated via cosine similarity). Blocks with high functional complexity are pruned less, while more redundant blocks are pruned more aggressively.

The complete FANG pipeline including context clustering, neuron assignment, and function-aware pruning strategy.

Experimental Results

We evaluated FANG across several model families, including LLaMA-1, LLaMA-2, LLaMA-3.1, and Qwen-2.5, with parameter counts ranging from 7B to 70B.

Performance and Generalization

When integrated with existing pruning methods like OBC or FLAP, FANG consistently achieves state-of-the-art results. For LLaMA2-7B at 30% sparsity, the "O-FANG" variant achieved an average accuracy of 59.50%, a significant improvement over the baseline OBC's 57.56%. On the MMLU benchmark for LLaMA2-13B, FANG boosted accuracy from 38.08% to 42.37% at 30% sparsity, demonstrating superior generalization.

Efficiency

Despite the additional clustering and assignment steps, FANG remains highly efficient. The total execution time for a 7B parameter model is under one hour on a single A100 GPU, making it significantly faster than training-based pruning alternatives.

Conclusion

FANG addresses the fundamental issue of calibration bias in LLM structured pruning by explicitly accounting for neuron specialization. By grouping neurons by function and adaptively allocating sparsity, it preserves critical knowledge that traditional methods often discard. Future work will explore finer-grained clustering techniques and extend functional grouping to attention mechanisms to further enhance model compression.

Summary updated

BibTeX
@inproceedings{yu2026improving,
  author = {Tao Yu and Yongqi An and Kuan Zhu and Guibo Zhu and Ming Tang and Jinqiao Wang},
  title = {{Improving Generalization in LLM Structured Pruning via Function-Aware Neuron Grouping}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i33.40021},
}
Figure