PATCH: Learnable Tile-level Hybrid Sparsity for LLMs

Younes Hourri, Mohammad Mozaffari, Maryam Mehri Dehnavi

TL;DR

PATCH introduces a novel hybrid sparsity framework for Large Language Models (LLMs) that bridges the gap between flexible-but-slow unstructured pruning and fast-but-rigid 2:4 semi-structured pruning. By partitioning weight matrices into hardware-friendly tiles and learning whether each tile should be dense or 2:4 sparse, PATCH enables continuous global sparsity control (0% to 50%) with practical GPU acceleration and minimal accuracy loss.

What Problem Does This Paper Address?

Deploying LLMs is notoriously expensive due to massive memory and computational overheads. Weight pruning—setting redundant parameters to zero—is a popular solution, but existing methods force a frustrating trade-off:

  1. Unstructured Sparsity: Allows zeroes to be placed anywhere, preserving model accuracy well. However, it creates irregular memory access patterns that modern GPUs cannot accelerate, resulting in zero practical speedup.
  2. Semi-structured (2:4) Sparsity: Requires exactly two out of every four consecutive elements to be zero. This is natively accelerated by NVIDIA Tensor Cores, but the rigid 50% sparsity constraint applied uniformly across all layers often severely degrades model accuracy.

PATCH addresses this rigidity by creating a flexible middle ground: tile-level hybrid sparsity that maintains hardware compatibility while allowing variable sparsity across the model.

Methods

PATCH partitions weight matrices into uniform tiles (e.g., $128 \times 128$). It then formulates mask selection as a probabilistic sampling problem solved end-to-end using the Gumbel-Softmax relaxation while keeping the underlying model weights frozen.

Illustration of the PATCH learning process for generating tile-level hybrid masks.

The framework introduces two main variants:

  • $PATCH^{\text{Joint}}$: Simultaneously optimizes the location of the dense tiles and the fine-grained 2:4 sparsity patterns within the sparse tiles.
  • $PATCH^{\text{Tile}}$: A memory-efficient variant designed for larger models that freezes a high-quality 2:4 mask and only learns the tile-level decisions (dense vs. sparse), drastically reducing training overhead.

Crucially, PATCH uses a global sparsity regularization term in its loss function. Instead of forcing every layer to meet a strict sparsity target, the model dynamically allocates density to critical layers and prunes redundant layers more aggressively. To achieve actual wall-clock speedups, PATCH integrates with the STOICC compiler, which supports the execution of mixed dense-sparse tile formats on GPUs.

Datasets

  • Mask Training / Calibration: Models are trained for 2000 steps on a 2-billion token subset of the SlimPajama dataset. To test robustness against data distribution shifts, the authors also evaluate masks trained on the C4 dataset.
  • Evaluation:
  • Language modeling perplexity is measured using WikiText2.
  • Downstream performance is evaluated across eight zero-shot tasks via the Language Model Evaluation Harness: PIQA, ARC-Easy, ARC-Challenge, Winogrande, OpenBookQA, RACE, HellaSwag, and MMLU.

Key Insights and Ideas

  • Sparsity is Non-Uniform by Nature: When given global freedom, PATCH naturally discovers that deeper and initial transformer blocks are highly sensitive and should remain dense, while middle blocks and MLP layers (up, gate, and down matrices) can absorb the majority of the sparsity. Attention key and value matrices are almost never pruned.
  • Granularity is a Hardware Knob, Not a Quality Knob: The authors found that changing the mask-learning tile size from $4 \times 4$ down to $128 \times 128$ has a negligible impact on final model accuracy. This means developers can safely use larger, hardware-friendly tile sizes ($128 \times 128$) to maximize GPU throughput without sacrificing model quality.

Key Results

PATCH was evaluated across multiple model families (Qwen-2.5, Gemma-3, LLaMA-2, and LLaMA-3.1) ranging from 0.5B to 13B parameters.

  • Superior Accuracy-Sparsity Trade-off: $PATCH^{\text{Joint}}$ consistently outperforms standard 2:4 pruning methods (like MaskLLM, Wanda, and SparseGPT) at various target global sparsities (25%, 35%, and 45%).
Model quality results for smaller models (Qwen-2.5, LLaMA-3.2, Gemma-3)
  • Scalability to Large Models: On larger models like LLaMA-2 13B, $PATCH^{\text{Tile}}$ at 25% sparsity recovers performance within 2 percentage points of the fully dense baseline, far surpassing one-shot 2:4 alternatives.
Table 2: Model quality (average accuracy across eight zero-shot tasks and perplexity on WikiText2 dataset) for different pruning methods. By only optimizing the location of dense tiles while keeping sparsity pattern within the sparse tiles frozen, PATCHTile provides a memory efficient variant for PATCHJoint, allowing for a continuous sparsity ratio for the models and providing a flexible tradeoff between sparsity and model quality.
  • Real-World Speedups: On an NVIDIA A6000 GPU, PATCH achieves 1.18× to 1.38× end-to-end throughput speedups over dense baselines while reducing the GPU memory footprint to 0.59×–0.76× of the original model size.

Limitations and Future Work

  • The Long-Context Bottleneck: As the input context length grows (e.g., 8K to 16K tokens), attention computation begins to dominate the total inference time. Because PATCH primarily accelerates linear/FFN layers, its relative end-to-end speedup degrades in long-context scenarios. The authors note that integrating PATCH with optimized attention kernels like FlashAttention is a necessary next step.
  • Expanding Beyond 2:4: The current implementation relies heavily on the 2:4 pattern due to native hardware support in current NVIDIA GPUs. However, the framework is mathematically pattern-agnostic and could be extended to future hardware-supported patterns like 4:8 or alternative N:M ratios.

Summary updated

BibTeX
@inproceedings{hourri2026patch,
  author = {Younes Hourri and Mohammad Mozaffari and Maryam Mehri Dehnavi},
  title = {{PATCH: Learnable Tile-level Hybrid Sparsity for LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ABuaxVr804},
}
Figure