QK-Wanda: Coupling Queries and Keys for Unstructured Pruning
cs.LG, cs.CL
Submitted: 2026-10-01
Updated: 2026-10-01
Comments: 81 pages, including appendices
Code: https://github.com/vectozavr/qk-wanda
License: http://creativecommons.org/licenses/by/4.0/
The gist: Wanda (Sun et al., 2024) prunes large language models by scoring weights independently within each linear projection, although queries and keys interact through dot products.
Terminology
Abstract
Wanda (Sun et al., 2024) prunes large language models by scoring weights independently within each linear projection, although queries and keys interact through dot products. We introduce QK-Wanda, which scores query and key weights by their individual deletion costs under an unmasked pre-RoPE reconstruction objective. It augments Wanda scores with information from the opposite projection (keys for query weights, and queries for key weights), allowing both projections to share a pruning budget. Its closed-form scores require no gradients or weight updates; full pruning takes 1.3% longer than Wanda on A100 and 3.1% longer on H200 with the calibration used in our main experiments. We evaluate QK-only pruning across 15 models from TinyLlama, Llama 2, Llama 3, and Qwen2.5, spanning 0.5B-72B parameters. Relative to Wanda, QK-Wanda reduces QK reconstruction error by an average of 60% at 50% sparsity and 45% at 80%. Downstream gains depend on the model. At 80% sparsity on Llama 2 70B, WikiText-2 and C4 perplexity decrease by 20.3% and 13.5%, while mean zero-shot accuracy rises by 5.94 percentage points. Qwen2.5-72B also improves, but Llama-3.1-70B has substantially higher perplexity despite lower reconstruction error. These results show both the promise of coupled pruning criteria and the limits of local reconstruction as a predictor of model quality.
Sources
- Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge
- Optimal Brain Compression: A Framework for Accurate Post-Training Quantization and Pruning
- The Llama 3 Herd of Models
- FASP: Fast and Accurate Structured Pruning of Large Language Models
- Thanos: A Block-wise Pruning Algorithm for Efficient Large Language Model Compression
- Beware of Calibration Data for Pruning Large Language Models
- LLM-Pruner: On the Structural Pruning of Large Language Models
- Qwen2.5 Technical Report
- Llama 2: Open Foundation and Fine-Tuned Chat Models
- Attention Is All You Need
- RAP: KV-Cache Compression via RoPE-Aligned Pruning
- Symmetric Pruning of Large Language Models
- CORP: Closed-Form One-shot Representation-Preserving Structured Pruning for Transformers
- TinyLlama: An Open-Source Small Language Model
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks