ChatPaper.aiChatPaper

SliceGPT: 大規模言語モデルの行と列の削除による圧縮

SliceGPT: Compress Large Language Models by Deleting Rows and Columns

January 26, 2024
著者: Saleh Ashkboos, Maximilian L. Croci, Marcelo Gennari do Nascimento, Torsten Hoefler, James Hensman
cs.AI

要旨

大規模言語モデルは自然言語処理の基盤となっているが、その利用には計算資源とメモリ資源の面で多大なコストが伴う。スパース化はこれらの資源制約を緩和する解決策を提供し、最近の研究では訓練済みモデルを事後的にスパース化できることが示されている。既存のスパース化技術は、追加のデータ構造を必要とし、現在のハードウェアでは速度向上が限定的であるという課題に直面している。本論文では、SliceGPTという新しい事後訓練スパース化手法を提案する。これは各重み行列をより小さい(密な)行列に置き換え、ネットワークの埋め込み次元を削減するものである。広範な実験を通じて、SliceGPTがLLAMA2-70B、OPT 66B、Phi-2モデルのパラメータ(埋め込みを含む)を最大25%削減しながら、それぞれ密モデルの99%、99%、90%のゼロショットタスク性能を維持できることを示す。スライスされたモデルはより少ないGPUで動作し、追加のコード最適化なしで高速に実行される:24GBのコンシューマーGPUでは、LLAMA2-70Bの推論に必要な総計算量を密モデルの64%に削減し、40GBのA100 GPUでは66%に削減する。我々は、Transformerネットワークにおける計算不変性という新しい洞察を提供し、これがSliceGPTを可能にしている。この洞察が、事前訓練済みモデルのメモリと計算要求を削減するための将来の道筋を刺激し、可能にすることを期待している。コードは以下で公開されている: https://github.com/microsoft/TransformerCompression
English
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
PDF746December 15, 2024