ShiftAddLLM: Accelerating Pretrained LLMs via Post-Training Multiplication-Less Reparameterization

要約

大規模言語モデル (LLM) は、言語タスクで優れたパフォーマンスを示していますが、リソースに制約のあるデバイスに展開すると、膨大なパラメーターと密な乗算への依存により課題に直面し、その結果、高いメモリ需要と待機時間のボトルネックが発生します。
シフトアンド加算再パラメータ化は、LLM のアテンション層と多層パーセプトロン (MLP) 層の両方で、コストのかかる乗算をハードウェアに優しいプリミティブに置き換えることにより、有望なソリューションを提供します。
ただし、現在の再パラメータ化手法では、精度を回復するために最初からトレーニングするか、パラメータを完全に微調整する必要があり、LLM にとってリソースを大量に消費します。
これに対処するために、トレーニング後のシフトアンド加算再パラメータ化を通じて事前トレーニング済み LLM を高速化し、効率的な乗算のないモデル (ShiftAddLLM と呼ばれる) を作成することを提案します。
具体的には、各重み行列をグループごとのスケーリング係数と組み合わせたバイナリ行列に量子化します。
関連する乗算は、(1) アクティベーションとスケーリング係数の間のシフト、および (2) バイナリ行列に従ってクエリと加算に再パラメータ化されます。
精度の損失を軽減するために、重みと出力のアクティベーション再パラメータ化エラーの両方を最小限に抑える多目的最適化手法を提案します。
さらに、再パラメータ化に対するレイヤー間のさまざまな感度に基づいて、メモリ使用量と遅延をさらに削減するための自動ビット割り当て戦略を開発します。
5 つの LLM ファミリと 8 つのタスクに関する実験では、ShiftAddLLM の有効性が一貫して検証されており、最も競争力のある量子化 LLM と比較して、それぞれ 3 ビットと 2 ビット、80% 以上のメモリと比較して、同等以下のレイテンシで 5.6 ポイントと 22.7 ポイントの平均パープレキシティの改善を達成しています。
元の LLM よりもエネルギーが削減されます。
コードとモデルは https://github.com/GATECH-EIC/ShiftAddLLM で入手できます。

要約(オリジナル)

Large language models (LLMs) have shown impressive performance on language tasks but face challenges when deployed on resource-constrained devices due to their extensive parameters and reliance on dense multiplications, resulting in high memory demands and latency bottlenecks. Shift-and-add reparameterization offers a promising solution by replacing costly multiplications with hardware-friendly primitives in both the attention and multi-layer perceptron (MLP) layers of an LLM. However, current reparameterization techniques require training from scratch or full parameter fine-tuning to restore accuracy, which is resource-intensive for LLMs. To address this, we propose accelerating pretrained LLMs through post-training shift-and-add reparameterization, creating efficient multiplication-free models, dubbed ShiftAddLLM. Specifically, we quantize each weight matrix into binary matrices paired with group-wise scaling factors. The associated multiplications are reparameterized into (1) shifts between activations and scaling factors and (2) queries and adds according to the binary matrices. To reduce accuracy loss, we present a multi-objective optimization method to minimize both weight and output activation reparameterization errors. Additionally, based on varying sensitivity across layers to reparameterization, we develop an automated bit allocation strategy to further reduce memory usage and latency. Experiments on five LLM families and eight tasks consistently validate the effectiveness of ShiftAddLLM, achieving average perplexity improvements of 5.6 and 22.7 points at comparable or lower latency compared to the most competitive quantized LLMs at 3 and 2 bits, respectively, and more than 80% memory and energy reductions over the original LLMs. Codes and models are available at https://github.com/GATECH-EIC/ShiftAddLLM.

arxiv情報

著者 Haoran You,Yipin Guo,Yichao Fu,Wei Zhou,Huihong Shi,Xiaofan Zhang,Souvik Kundu,Amir Yazdanbakhsh,Yingyan Celine Lin
発行日 2024-07-25 17:20:48+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG パーマリンク