This gives you practical implementations of Wanda and SparseGPT for compressing LLMs without retraining. You get one-shot pruning that can hit 50% sparsity with under 1% accuracy loss, plus N:M structured patterns that actually map to NVIDIA's sparse tensor cores for real 2x speedups on A100s. The Wanda code is straightforward: multiply weight magnitudes by activation statistics, threshold, mask, done. What's useful here is seeing the tradeoff between unstructured pruning (better quality, no speedup) and semi-structured 2:4 patterns (hardware friendly, minimal accuracy hit). If you're deploying large models on constrained hardware or trying to cut serving costs, this walks through the techniques that actually work in production without the usual fine-tuning overhead.

skills.sh installs
1K
GitHub stars
14.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add orchestra-research/ai-research-skills --skill model-pruning --agent claude-code

Installs into .claude/skills of the current project.

Files

Model Pruning: Compressing LLMs

When to Use This Skill

Use Model Pruning when you need to:

  • Reduce model size by 40-60% with <1% accuracy loss
  • Accelerate inference using hardware-friendly sparsity (2-4× speedup)
  • Deploy on constrained hardware (mobile, edge devices)
  • Compress without retraining using one-shot methods
  • Enable efficient serving with reduced memory footprint

Key Techniques: Wanda (weights × activations), SparseGPT (second-order), structured pruning, N:M sparsity

Papers: Wanda ICLR 2024 (arXiv 2306.11695), SparseGPT (arXiv 2301.00774)

Installation

# Wanda implementation
git clone https://github.com/locuslab/wanda
cd wanda
pip install -r requirements.txt

# Optional: SparseGPT
git clone https://github.com/IST-DASLab/sparsegpt
cd sparsegpt
pip install -e .

# Dependencies
pip install torch transformers accelerate

Quick Start

Wanda Pruning (One-Shot, No Retraining)

Source: ICLR 2024 (arXiv 2306.11695)

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

Sponsors

Details

Repository
github.com/orchestra-research/ai-research-skills
Categories
AI & Agent Building, Data Science & ML
First seen
Jun 3, 2026

More from orchestra-research/ai-research-skills

All 95
1orchestra-research avatartorchforge-rl-trainingorchestra-research/ai-research-skillsProvides guidance for PyTorch-native agentic RL using torchforge, Meta's library separating infra from algorithms. Use when you want clean RL abstractions, easy1Kskills.sh installs
2orchestra-research avatarnemo-guardrailsorchestra-research/ai-research-skillsNVIDIA's runtime safety framework for LLM applications. Features jailbreak detection, input/output validation, fact-checking, hallucination detection, PII filte1Kskills.sh installs
3orchestra-research avatarconstitutional-aiorchestra-research/ai-research-skillsAnthropic's method for training harmless AI through self-improvement. Two-phase approach - supervised learning with self-critique/revision, then RLAIF (RL from 1Kskills.sh installs
4microsoft avatarskill-authoringmicrosoft/github-copilot-for-azureGuidelines for writing Agent Skills that comply with the agentskills.io specification. WHEN: \"create a skill\", \"new skill\", \"write a skill\", \"skill templ1Kskills.sh installs
5maplibre avatarmaplibre-pmtiles-patternsmaplibre/maplibre-agent-skillsServerless vector and raster tiles with PMTiles for MapLibre GL JS — single-file format, HTTP range requests, hosting on S3/R2/GitHub Pages, generating with Pla833skills.sh installs
6practicalswan avatarword-documentpracticalswan/agent-skillsWord (.docx) manipulation via MCP server. Use for reading, creating, editing, formatting Word documents including tables, footnotes, comments, images, headers, 795skills.sh installs