model-pruning

Prune large language models with Wanda, SparseGPT, and N:M sparsity.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/arsity/scholar-tools --skill model-pruning-arsity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-pruning
Source: https://github.com/arsity/scholar-tools/tree/main/vendor/ai-research-skills/19-emerging-techniques/model-pruning
Command: npx skills add https://github.com/arsity/scholar-tools --skill model-pruning-arsity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, and includes references (resource) components.

What problem does it solve?

Reduce the size of large language models and accelerate inference through pruning techniques, enabling deployment on constrained hardware and faster runtimes without substantial retraining.

Core Features & Use Cases

  • Apply one-shot pruning to achieve target sparsity without retraining.
  • Support Wanda, SparseGPT, N:M structured pruning, and magnitude pruning.
  • Use case: Deploy smaller, faster models on edge devices or latency-constrained services while maintaining acceptable accuracy.

Quick Start

Prune a selected LLM to 50% sparsity using Wanda or SparseGPT with calibration data and export the pruned model.

Frequently Asked Questions about model-pruning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prune a large language model to reduce its size and speed up inference?

Prune large language models to reduce size and accelerate inference using one-shot techniques like Wanda, SparseGPT, or N:M sparsity. This shrinks the model for constrained hardware without requiring substantial retraining.

What is the difference between unstructured pruning and N:M sparsity for LLMs?

Unstructured pruning removes individual weights based on activation-aware scoring, while N:M sparsity enforces a structured pattern of zeroed weights. Both balance accuracy and speed, but N:M is often better supported by hardware accelerators.

Do I need calibration data to perform one-shot model pruning?

Yes, calibration data is required for activation-aware scoring during the pruning pipeline. This data allows techniques like Wanda and SparseGPT to evaluate weight importance accurately before exporting the final pruned model.

Can I use PyTorch and Hugging Face transformers to apply magnitude pruning?

Yes, the pruning pipeline relies on PyTorch via the torch dependency and Hugging Face via the transformers dependency. These frameworks support applying magnitude pruning and exporting the resulting sparse model.

What is the best way to deploy a smaller LLM on edge devices without retraining?

The best way to deploy on edge devices without retraining is applying one-shot pruning to achieve target sparsity. Methods like SparseGPT and Wanda compress the model while maintaining acceptable accuracy for latency-constrained services.

When should I not use one-shot pruning for model compression?

Avoid one-shot pruning if your target deployment cannot handle unstructured sparsity efficiently or if your accuracy requirements are too strict to tolerate the degradation from aggressive sparsity levels without subsequent retraining.