Efficiency

SliceGPT

First page
SliceGPT
Paper summary

Microsoft's SliceGPT is a post-training LLM compression technique that literally slices rows and columns out of weight matrices while preserving zero-shot quality.

Ask this paper

Key points
01

Structured sparsification: Unlike unstructured pruning that zeros weights, SliceGPT replaces each weight matrix with a smaller dense matrix by removing whole rows and columns, giving actual speedups on standard hardware.

02

Embedding dimension reduction: The approach reduces the effective embedding dimension of the network, which shrinks activations and optimizer state along with weights.

03

20% parameter removal: Up to 20% of parameters can be removed from Llama 2 70B and Phi-2 while retaining most zero-shot performance on standard benchmarks.

04

Dense and fast: Because the resulting model is still dense and smaller, it runs faster on GPU without requiring specialized sparse kernels, unlike many competing pruning methods.

Abstract

Large language models have become the cornerstone of natural language processing, but their use comes with substantial costs in terms of compute and memory resources. Sparsification provides a solution to alleviate these resource constraints, and recent works have shown that trained models can be sparsified post-hoc. Existing sparsification techniques face challenges as they need additional data structures and offer constrained speedup with current hardware. In this paper we present SliceGPT, a new post-training sparsification scheme which replaces each weight matrix with a smaller (dense) matrix, reducing the embedding dimension of the network. Through extensive experimentation, we show that SliceGPT can remove up to 25% of the model parameters (including embeddings) for LLAMA2-70B, OPT 66B and Phi-2 models while maintaining 99%, 99% and 90% zero-shot task performance of the dense model respectively. Our sliced models run on fewer GPUs and run faster without any additional code optimization: on 24GB consumer GPUs we reduce the total compute for inference on LLAMA2-70B to 64% of that of the dense model; on 40GB A100 GPUs we reduce it to 66%. We offer a new insight, computational invariance in transformer networks, which enables SliceGPT and we hope it will inspire and enable future avenues to reduce memory and computation demands for pre-trained models. Code is available at: https://github.com/microsoft/TransformerCompression

Every Monday
Get next week’s papers.
Subscribe on Substack