This repository hosts a
mask only release for the paper
PATCH: Learnable Tile-level Hybrid Sparsity for LLMs.
PATCH (Pruning with a Learnable Tile-level Configuration for Hybrid Sparsity) learns a structured mask on
frozen pretrained weights, assigning each tile as dense (0% sparsity) or 2:4 sparse (50% sparsity) to hit a flexible global sparsity target while staying hardware-friendly.
All numbers are from the PATCH paper (
arXiv:2509.23410); accuracy
is the average over MMLU, PIQA, ARC-Easy, ARC-Challenge, Winogrande, OpenBookQA,
RACE and HellaSwag, evaluated with the LM-Evaluation-Harness. PPL is WikiText2.
1from huggingface_hub import hf_hub_download
2from transformers import AutoModelForCausalLM
3import torch
4from load_patch_mask import apply_patch_mask # shipped in this repo
5
6npz = hf_hub_download(repo_id="mohammad-mozaffari/llama_3.2_1b-PATCH-45Sparse", filename="mask.npz")
7model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B", torch_dtype=torch.bfloat16)
8apply_patch_mask(model, npz) # zeroes the pruned weights in place
Speedup on real hardware requires a 2:4-aware / hybrid sparse kernel; see the
GitHub repository and
STOICC.
The released mask is a derivative of the base model and is distributed under the
base model's license (llama3.2). You must comply with that license and
obtain access to the base model separately.
The mask-generation code is released under the MIT license (see the
PATCH repository).
1@article{hourri2025patch,
2 title = {PATCH: Learnable Tile-level Hybrid Sparsity for LLMs},
3 author = {Hourri, Younes and Mozaffari, Mohammad and Mehri Dehnavi, Maryam},
4 year = 2025,
5 journal = {arXiv preprint arXiv:2509.23410}
6}