[論文レビュー] SliceGPT: Compress Large Language Models by Deleting Rows and Columns
SliceGPT は直交変換を適用し、重み行列の主要な行/列を削除することで大規模言語モデルを圧縮し、最大 30% の圧縮を実現し、性能低下は最小で推論を速くする。
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
研究の動機と目的
- 訓練後に大規模言語モデル(LLMs)のメモリと計算コストを削減する動機づけ。
- 埋め込みと層行列を縮小しつつ機能を維持しながら新しいスパース化パラダイムを導入する。
- 広範なファインチューニングを要さず、GPU要件を低減した高速推論を実現する。
- トランスフォーマーネットワークにおける計算不変性に関する理論的および実証的知見を提供する。
提案手法
- 活性化を主成分へ投影して PCA を用い、各重み行列をより小さな密行列に置き換える。
- 適切な逆変換が続くと出力を保持する直交変換などの計算的不変性を導入・活用する。
- LayerNorm を RMSNorm に変換して不変変換を可能にする。
- 各層に対して直交変換 Q_l を適用し、同等性を維持するために残差接続を適応させる。
- 僅かな主成分を削除することによるスライシングを行い、W_in,W_out,W_embd の対応する行/列を削除して性能影響を最小化する。
- キャリブレーションデータセットを用いて Q_l を較正し、層の活性化に対して PCA を用いて計算し、データ駆動のスライシングを可能にする。
実験結果
リサーチクエスチョン
- RQ1RMSNorm 接続されたネットワークにおいて、直交変換は層間でトランスフォーマーの出力を保持できるのか?
- RQ2層ごとの PCA ベースのスライシングは、ゼロショットおよび生成性能を維持しつつ、パラメータ数と埋め込みを有意に削減するか?
- RQ3約 30% までのスライシングにより、性能とスループットのトレードオフはどうなるか(LLMs(OPT、Llama-2、Phi-2)を対象)?
- RQ4スライシング後の回復ファインチューニングは、精度を維持するために必要か、または有益か?
主な発見
| Method | OPT 125M | OPT 1.3B | OPT 2.7B | OPT 6.7B | OPT 13B | OPT 30B | OPT 66B | Llama-2 7B | Llama-2 13B | Llama-2 70B |
|---|---|---|---|---|---|---|---|---|---|---|
| Dense | 27.64 | 14.61 | 12.46 | 10.85 | 10.12 | 9.56 | 9.33 | 5.47 | 4.88 | 3.32 |
| SparseGPT 2:4 | 45.07 | 29.61 | 14.90 | 13.00 | 11.80 | 10.53 | 10.22 | 8.69 | 7.07 | 4.98 |
| SliceGPT ( 10%) | 29.34 | 15.10 | 12.75 | 10.92 | 10.27 | 9.65 | 9.43 | 5.89 | 5.21 | 3.69 |
| SliceGPT ( 20%) | 34.26 | 16.43 | 13.73 | 11.48 | 10.66 | 9.87 | 9.57 | 6.64 | 5.81 | 4.25 |
| SliceGPT ( 25%) | 37.74 | 17.46 | 14.56 | 11.90 | 10.94 | 10.04 | 9.68 | 7.24 | 6.30 | 4.60 |
| SliceGPT ( 30%) | 43.98 | 19.09 | 15.83 | 12.51 | 11.33 | 10.27 | 9.85 | 8.12 | 6.99 | 5.05 |
- SliceGPT は OPT および Llama-2 モデルを最大で 30%(埋め込みを含む)圧縮しつつ、高いタスク性能を維持できる。
- WikiText-2 で、25% のスライシングを適用した SliceGPT は、モデル規模を問わずほぼデンスな perplexity を維持し、SparseGPT 2:4 のベースラインを上回る。
- ゼロショットタスクにおいて、より大きなモデルでは SliceGPT はデンスモデルと同等の精度を達成し、OPT は一般に Llama-2 より圧縮に適している。
- Alpaca 風データを用いた回復ファインチューニング(RFT)と組み合わせると、スライスした大規模モデルは substantial accuracy を回復し、例として 70B OPT のスライスは RFT でダウンストリームタスクの dense 性能に近づく。
- SliceGPT は意味のあるスループット向上を実現する:80GB H100 GPU で、25% のスライシングはスループットを最大で 1.55 倍に、50% のスライシングでは最大モデルで必要な GPU を 2 台から 1 台へ削減できる。
- 方法は、 substantial parameter reductions and speedups を達成するために、 extensive re-training なしの単一ショットのポストトレーニング手順のみを必要とする。
より良い研究を、今すぐ始めましょう
論文設計から論文執筆まで、研究時間を劇的に削減しましょう。
クレジットカード登録不要
このレビューはAIが作成し、人間の編集者が確認しました。