Thanos: A Block-wise Pruning Algorithm for Efficient Large Language Model Compression

Ivan Ilin, Peter Richtárik · Submission to ICLR 2026 · Rejected

TL;DR

Thanos is a novel block-wise pruning algorithm designed to compress Large Language Models (LLMs) without the need for retraining. By updating multiple weights simultaneously and incorporating an "outlier row" protection strategy, it achieves state-of-the-art performance in structured pruning and remains highly competitive in unstructured and semi-structured ($n:m$) sparsity formats.

What Problem Does This Paper Address?

Deploying Large Language Models (LLMs) is notoriously difficult due to their massive memory footprints and high computational demands. While quantization (reducing bit-precision) is a popular solution, pruning—the process of removing redundant weights by setting them to zero—offers a powerful alternative for model compression.

Existing state-of-the-art pruning methods like SparseGPT often operate "greedily," pruning weights one by one or column by column. The authors of Thanos argue that this approach fails to account for the cumulative impact of removing multiple weights at once. When you remove a group of weights, the optimal adjustment for the remaining weights isn't just the sum of individual adjustments. Thanos aims to bridge this gap by formulating pruning as a block-wise optimization problem, allowing for more accurate weight updates and better preservation of model performance.

Methods

Thanos introduces several key technical innovations:

  1. Block-Wise Weight Updates: Unlike sequential methods, Thanos solves a discrete constrained optimization problem to prune and update a block of weights simultaneously. This accounts for the interactions between multiple removed weights within a row.
  2. Adaptive Masking: The algorithm dynamically constructs a pruning mask based on weight importance. It leverages the "Wanda" metric—a combination of weight magnitude and the norm of the corresponding input activations—to decide which weights to cut.
  3. Structured Outlier Protection: For structured pruning (where entire columns are removed), Thanos introduces a parameter $\alpha$ to identify and preserve "outlier rows." These are rows that contribute disproportionately to the model's output; by keeping a small fraction (e.g., 10%) of these rows intact, the model maintains much higher accuracy.
  4. Flexible Sparsity Support: The framework is designed to handle unstructured sparsity, structured sparsity, and the hardware-friendly semi-structured $n:m$ format (like the 2:4 pattern supported by NVIDIA Ampere GPUs).

Datasets

The authors evaluated Thanos across a wide range of models and tasks:

  • Models: OPT family, LLaMA-2 (7B to 70B), LLaMA-3 (1B to 70B), and TinyLlama-1.1B.
  • Language Modeling: Perplexity was measured using the WikiText-2 validation set.
  • Zero-Shot Evaluation: Seven tasks from the EleutherAI LM Harness, including WinoGrande, OBQA, BoolQ, PiQA, HellaSwag, and ARC (Easy/Challenge).

Key Insights and Ideas

  • The Power of Together: The core "aha moment" is that updating weights in response to a block of removals is mathematically superior to updating them one by one. This is particularly evident in structured pruning, where the error accumulates quickly.
  • Rows Aren't Created Equal: In structured pruning, the "outlier row" strategy is a game-changer. By protecting just 10% of the most important rows, the authors observed a massive drop in perplexity (e.g., from 64.43 down to 36.61 for LLaMA-3 8B at 30% structured sparsity).
  • Hardware Alignment: By supporting $n:m$ sparsity, Thanos isn't just a theoretical exercise in compression; it is optimized for actual speedups on modern GPU architectures.

Key Results

Thanos consistently outperforms or matches existing baselines like Wanda and SparseGPT:

  • Structured Pruning: On LLaMA-3 8B (30% sparsity), Thanos achieved a perplexity of 36.61, vastly outperforming SparseGPT (82.19) and Wanda (167.57).
  • Unstructured Pruning: At 50% sparsity, Thanos is neck-and-neck with SparseGPT, often providing slightly better zero-shot accuracy on the latest LLaMA-3 models.
  • Efficiency: Thanos is significantly faster than SparseGPT for structured pruning and for models under 3 billion parameters, thanks to its block-wise processing and efficient batched linear solvers.

Limitations and Future Work

The authors acknowledge a few hurdles:

  • Computational Cost: Solving systems of linear equations for every block is more computationally expensive than simple magnitude-based pruning. As models grow to hundreds of billions of parameters, these calculations could become a bottleneck.
  • Scalability in Unstructured Tasks: While Thanos excels in structured settings, SparseGPT still occasionally holds an edge in zero-shot tasks for unstructured sparsity on very large models.
  • Future Directions: The authors suggest that further optimizing the linear solvers and exploring even more fine-grained sparsity patterns could be promising avenues for future research.

The implementation of Thanos has been released publicly to encourage further research into efficient LLM deployment.

Summary updated

BibTeX
@misc{ilin2025thanos,
  author = {Ivan Ilin and Peter Richtárik},
  title = {{Thanos: A Block-wise Pruning Algorithm for Efficient Large Language Model Compression}},
  year = {2025},
  eprint = {2504.05346},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.05346},
}
Figure