atlas

Research map / Large language models / Language, safety and interpretability

MaskLLM: Learnable Semi-Structured Sparsity for Large Language Models

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 14 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Learns 2:4 semi-structured sparsity masks for frozen LLMs by modeling mask choice as a learnable categorical distribution sampled with Gumbel Softmax and trained end-to-end on large data, with optional mask priors for transfer.

Problem

Finding accurate N:M (2:4) semi-structured sparsity masks for LLMs is combinatorially hard and non-differentiable, and one-shot methods rely on small calibration sets and proxy importance criteria that do not scale to large data.

Approach

Model each group of four weights' 2:4 mask as a learnable categorical distribution over the six valid masks, sample differentiably with Gumbel Softmax, and optimize the language modeling loss end-to-end with frozen weights; initialize logits from one-shot prior masks and add a sparse weight regularizer to keep gradients flowing.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use MaskLLM instead of SparseGPT for 2:4 pruningLLaMA-2 7B · Wikitext-2PPL: 10.42 -> 6.72Helped
Use MaskLLM instead of the strongest listed one-shot baselineLLaMA-2 13B · Wikitext-2PPL: 8.47 -> 5.85Helped
Use MaskLLM instead of SparseGPTNemotron-4 15B · Wikitext-2PPL: 13.38 -> 7.31Helped
Use MaskLLM instead of SparseGPTGPT-3 2B · Wikitext-2PPL: 22.14 -> 11.42Helped
Use MaskLLM instead of SparseGPTGPT-3 843M · Wikitext-2PPL: 38.78 -> 15.39Helped
Use MaskLLM instead of SparseGPTLLaMA-3 8B · Wikitext-2PPL: 17.64 -> 8.50Helped
Initialize mask learning with a Magnitude prior instead of no prior (ablation)MaskLLM on LLaMA-2 7B · WikitextPPL: 9.12 -> 6.77Helped
Transfer the general mask as a prior to the downstream task (ablation)GPT-3 2B · Downstream tasksAverage task PPL: 7.51 -> 7.39Helped
Use a task-specific general mask rather than the dense modelGPT-3 2B · Downstream tasksAverage task PPL: 7.42 -> 10.61Hurt
Add sparse weight regularization (1e-5) (ablation)MaskLLM on GPT-3 2B · Mask trainingAverage gradient norm: 0.219 -> 0.542Helped
Add sparse weight regularization (ablation)MaskLLM on GPT-3 2B · Mask-only, sub-domain, and finetuningPPL: 11.59 -> 11.42; 7.61 -> 7.39; 10.21 -> 9.96Helped
Increase Gumbel temperature from 1 → 0.05 to 4 → 0.05 (ablation)MaskLLM on GPT-3 843M · WikitextPPL: 17.52 -> 15.39Helped

Surprising findings

Limitations

Experimental setup

Datasets: C4 Wikitext-2 LM-Eval-Harness tasks ImageNet-1K Blended pretraining-style domain data

Benchmarks: Wikitext-2 HellaSwag RACE PIQA WinoGrande ARC-E ARC-C OBQA ImageNet-1K

Metrics: perplexity accuracy top-1 accuracy throughput

Baselines: Magnitude pruning SparseGPT Wanda SR-STE ADMM-Iter GBLM RIA Pruner-Zero

Builds on: Gumbel Softmax SparseGPT Wanda Megatron-LM

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy