Greedy Output Approximation: Towards Efficient Structured Pruning for LLMs Without Retraining

Jianwei Li, Yijun Dong, Qi Lei

TL;DR

Retraining large language models (LLMs) after pruning is prohibitively expensive, while unstructured pruning demands specialized hardware accelerators. This paper introduces an inference-aware, retraining-free structured pruning framework that models attention and MLP blocks as modular "depth-2" structures, prunes them using greedy output-approximation metrics (Jensen-Shannon head similarity and activation second moments), and corrects pruning drift with closed-form linear weight reconstruction.

What Problem Does This Paper Address?

Deploying billion-parameter LLMs imposes severe compute and memory constraints during inference. While structured pruning (removing entire attention heads, channels, or layers) offers immediate hardware speedups on standard GPUs, existing approaches face a dilemma:

  1. Retraining-based methods (e.g., fine-tuning with LoRA) recover lost accuracy but require heavy compute, complex data curation, and hyperparameter tuning.
  2. Retraining-free methods often rely on computationally expensive second-order Hessian calculations, target irregular/unstructured sparsity, or struggle with performance degradation.
  3. Residual connections restrict channel pruning across layers: if output dimensions of consecutive residual blocks do not match, the skip-connection breaks.

The authors set out to develop a fully structured pruning framework that requires zero model retraining, uses only inference-aware metrics (no backpropagation or Hessians), and respects Transformer structural dependencies without bottlenecking residual connections.

Methods

The authors' pipeline rests on three primary pillars:

[Transformer Block] ──► Identify Depth-2 Modules (Attention & FFD)
                             │
                             ├──► Inner Channel Pruning (Preserves Residual Streams)
                             ├──► Metric: Attention Head Divergence (JS Divergence)
                             ├──► Metric: Second-Moment Channel Score (Weights + Covariance)
                             │
                             └──► Post-Pruning Recovery (Closed-Form Least Squares)
  1. Depth-2 Module Framing & Inner-Channel Pruning: Both multi-head attention ($W_Q, W_K, W_V$ followed by $W_O$) and feed-forward networks (up/gate projections followed by down projection) are treated as two-level sequential linear structures. Instead of pruning inter-block channels (which requires rigid alignment across all layers due to residual connections), the authors prune inner channels (the output of level 1 and the input of level 2). This isolates each block, giving every layer full independence in choosing which channels to remove.

  2. Output Approximation Pruning Criteria: Rather than approximating weights (function approximation) or loss gradients (objective approximation), the paper targets output approximation ($f(X) \approx Y$):

  3. Attention Head Redundancy via JS Divergence: Attention heads operate in parallel and frequently extract duplicate patterns. The authors compute pairwise Jensen-Shannon (JS) divergence between attention score matrices. Heads that exhibit divergence below a threshold $\tau$ form redundant clusters; redundant heads are prioritized for removal over simply pruning heads with low weight magnitudes.

  4. Second-Moment Importance Metric: For linear transformations $f(x) = B \sigma(A x)$, the importance of channel $j$ is derived from the second moment of its output: $$M_j := \frac{1}{2} \|B_j\|_2^2 (A_j^\top \Sigma A_j)$$ where $\Sigma$ is the input covariance matrix. This metric accounts for both weight magnitude and feature activation variance across nonlinearities (ReLU, GeLU, SiLU).

  5. Closed-Form Post-Pruning Weight Reconstruction: Pruning earlier blocks inevitably changes the input distribution to later blocks. To mitigate cascading errors without gradient-based training, the authors apply a closed-form least-squares weight update to the surviving dense modules: $$\bar{W} = (\hat{X} \hat{X}^\top)^{-1} \hat{X}^\top Y$$ where $\hat{X}$ is the activations from the preceding pruned layers and $Y$ is the original unpruned layer output.

  6. Self-Generated Data-Free Pruning: In data-free regimes, rather than using an uninformative identity covariance, the authors prompt the LLM to generate its own synthetic calibration sentences, naturally capturing realistic token and activation distributions.

Datasets

  • Language Modeling (Perplexity): WikiText-2 and Penn Treebank (PTB), evaluated at sequence lengths of 128 (LLaMA family) and 1024 (GPT-2).
  • Downstream Zero-Shot Common-Sense Reasoning: BoolQ, PIQA, HellaSwag, WinoGrande, ARC-easy, ARC-challenge, and OpenBookQA.
  • Calibration: 16 randomly sampled sequences from WikiText-2 or BookCorpus for metric calculation; 1,024 downstream samples used solely during the data-dependent reconstruction phase.
  • Evaluated Architectures: LLaMA-7B, LLaMA-2-7B, LLaMA-3.1-8B, Vicuna-7B, and GPT-2 (110M).

Key Insights and Ideas

  • Redundancy Over Magnitude in Attention: Random pruning often matches or beats magnitude-based pruning for attention heads below 50% sparsity. Attention heads act redundantly rather than uselessly; detecting and removing co-dependent heads via JS divergence preserves significantly more knowledge.
  • Residual Independence via Inner Channels: Pruning internal projection channels decouples Transformer layers from one another, avoiding global channel synchronization constraints imposed by residual addition.
  • Self-Generated Data Outperforms Standard Data-Free Norms: In data-free scenarios, prompting the model to generate its own calibration text beats traditional $L_1$ and $L_2$ norm metrics by up to 20% on downstream tasks.
  • Activation Scale Explains LLM Pruning Differences: Colossal models (LLaMA-7B) display substantially higher average activation magnitudes than smaller models (GPT-2), explaining why feature/activation statistics play a far more decisive role than raw weight values in larger models.

Key Results

  • Outperforming Retraining-Based Baselines: On LLaMA-7B at 20% global sparsity (pruning blocks 4–30), the proposed method with reconstruction achieved an average downstream score of 60.65% and a WikiText-2 perplexity of 17.90, outperforming LLM-Pruner with LoRA retraining (60.07% accuracy, 17.37 PPL) and structured Wanda (57.97% accuracy, 27.45 PPL).
  • Data-Free Pruning Gains: The data-free self-generation variant reached 52.72% average accuracy on LLaMA-7B, outperforming random pruning (49.95%) and conventional $L_1$ norm pruning (43.12%).
  • Consistent Across Generations: On LLaMA-3.1-8B, the method achieved 61.0% zero-shot accuracy compared to LLM-Pruner Element-2's 57.8%.
  • Sample Efficiency: On LLaMA-7B, pruning performance saturated with as few as 8 to 16 calibration samples, demonstrating extreme robustness to small data budgets.

Limitations and Future Work

  • Emergent Capability Assessment: Evaluations are restricted to standard perplexity and multiple-choice commonsense reasoning; complex emergent behaviors (e.g., chain-of-thought math, multi-turn dialogue, safety alignment, code synthesis) were not assessed.
  • Partial Block Pruning: Following the LLM-Pruner setup, experiments on LLaMA models left blocks 0–3 and the final block untouched to prevent catastrophic collapse.
  • Long-Context Behavior: Calibration and evaluation were conducted with relatively short sequence lengths (128 for LLaMA), leaving open the question of how output-approximation pruning affects long-context attention heads.

Summary updated

BibTeX
@inproceedings{li2025greedy,
  author = {Jianwei Li and Yijun Dong and Qi Lei},
  title = {{Greedy Output Approximation: Towards Efficient Structured Pruning for LLMs Without Retraining}},
  booktitle = {CPAL (Proceedings Track)},
  year = {2025},
  url = {https://openreview.net/forum?id=hp7txxx8hv},
}

Loading related content...

Figure