Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Model compression techniques: pruning, knowledge distillation, and quantization. Covers compression ordering (P-KD-Q), tools, and evaluation metrics.
.claude/skills/mkurman-model-compression/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 28% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -48% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -43% | 0% |
Model compression reduces LLM size and inference cost through three main techniques: pruning (removing parameters), knowledge distillation (training smaller student models), and quantization (lower precision weights). A 2025 study on Qwen2.5 3B found the optimal ordering: Pruning → Knowledge Distillation → Quantization (P-KD-Q) achieves 3.68x compression while preserving instruction-following and language understanding.
| Technique | What it does | Compression | Quality Impact | |---|---|---|---| | Quantization | Lower precision (FP16→INT4/FP8) | Highest standalone | Low with PTQ, recoverable with QAT | | Structured Pruning | Remove attention heads, layers, neurons | Moderate | Moderate degradation, recoverable with KD | | Knowledge Distillation | Train smaller model on larger model outputs | Architecture-dependent | Best quality recovery post-pruning |
The paper shows ordering matters critically:
Applying quantization early causes irreversible information loss that impairs subsequent training.
| Toolkit | Features | Use Case | |---|---|---| | angelslim (Tencent) | PTQ/QAT, pruning, Eagle3 speculative decoding | Full compression pipeline, 1.25-bit to FP8 | | nvidia-model-optimizer | PTQ, QAT, pruning, distillation, speculative decoding | NVIDIA ecosystem, TensorRT-LLM deployment | | intel-neural-compressor | INT8/FP8/INT4 quantization, pruning, distillation | Intel hardware, ONNX Runtime | | peft + unsloth | QLoRA fine-tuning | Training-time efficiency, adapter-based |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | fail→pass | 17,186 | 17,977 | +5% | 1 | 1 | 0% | 2,918 | 3,739 | +28% | 0 | 0 | — |
case-02 | fail→pass | 20,883 | 20,966 | +0% | 1 | 1 | 0% | 3,488 | 4,110 | +18% | 0 | 0 | — |
case-03 | pass→fail | 17,367 | 14,615 | -16% | 1 | 1 | 0% | 3,136 | 3,352 | +7% | 0 | 0 | — |
case-01 | fail→pass | 21,048 | 17,583 | -16% | 1 | 1 | 0% | 3,615 | 3,401 | -6% | 0 | 0 | — |
case-05 | pass→pass | 40,764 | 18,218 | -55% | 1 | 1 | 0% | 3,405 | 3,575 | +5% | 0 | 0 | — |
case-06 | pass→pass | 17,081 | 12,413 | -27% | 1 | 1 | 0% | 2,600 | 2,554 | -2% | 0 | 0 | — |
case-07 | pass→pass | 15,381 | 11,647 | -24% | 1 | 1 | 0% | 2,361 | 2,317 | -2% | 0 | 0 | — |
case-08 | fail→pass | 19,413 | 6,618 | -66% | 1 | 1 | 0% | 3,210 | 1,671 | -48% | 0 | 0 | — |
case-09 | pass→pass | 13,619 | 10,816 | -21% | 1 | 1 | 0% | 2,286 | 2,286 | 0% | 0 | 0 | — |
case-10 | pass→pass | 15,966 | 10,720 | -33% | 1 | 1 | 0% | 2,529 | 2,450 | -3% | 0 | 0 | — |
case-11 | pass→pass | 16,598 | 14,304 | -14% | 1 | 1 | 0% | 2,789 | 2,939 | +5% | 0 | 0 | — |
case-12 | pass→pass | 14,400 | 11,581 | -20% | 1 | 1 | 0% | 2,379 | 2,540 | +7% | 0 | 0 | — |
case-13 | pass→pass | 18,664 | 16,705 | -10% | 1 | 1 | 0% | 2,935 | 3,197 | +9% | 0 | 0 | — |
case-14 | fail→fail | 17,395 | 18,880 | +9% | 1 | 1 | 0% | 2,763 | 3,588 | +30% | 0 | 0 | — |
case-15 | pass→pass | 7,454 | 3,864 | -48% | 1 | 1 | 0% | 1,186 | 1,036 | -13% | 0 | 0 | — |
case-16 | pass→pass | 15,524 | 13,202 | -15% | 1 | 1 | 0% | 2,437 | 2,613 | +7% | 0 | 0 | — |
case-17 | pass→pass | 14,735 | 14,425 | -2% | 1 | 1 | 0% | 2,458 | 2,933 | +19% | 0 | 0 | — |
case-18 | pass→pass | 11,803 | 11,558 | -2% | 1 | 1 | 0% | 2,010 | 2,381 | +18% | 0 | 0 | — |
case-19 | fail→pass | 9,776 | 2,516 | -74% | 1 | 1 | 0% | 1,660 | 953 | -43% | 0 | 0 | — |
case-20 | pass→pass | 18,726 | 17,664 | -6% | 1 | 1 | 0% | 2,901 | 3,326 | +15% | 0 | 0 | — |
case-21 | pass→pass | 19,347 | 15,680 | -19% | 1 | 1 | 0% | 3,277 | 3,407 | +4% | 0 | 0 | — |
case-22 | pass→fail | 13,692 | 9,142 | -33% | 1 | 1 | 0% | 2,104 | 1,862 | -12% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +14 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.