Scalable MatMul-free Language Modeling

要約

行列乗算 (MatMul) は通常、大規模言語モデル (LLM) の全体的な計算コストの大半を占めます。
このコストは、LLM がより大きな埋め込み次元とコンテキスト長にスケールアップするにつれて増加するだけです。
この研究では、10 億パラメータ規模で強力なパフォーマンスを維持しながら、MatMul 演算を LLM から完全に排除できることを示します。
私たちの実験では、私たちが提案する MatMul フリー モデルが、少なくとも 2.7B パラメータまでのスケールで推論中にはるかに多くのメモリを必要とする最先端の Transformer と同等のパフォーマンスを達成することが示されています。
私たちはスケーリングの法則を調査し、MatMul フリー モデルと完全精度の Transformers の間のパフォーマンスのギャップが、モデル サイズが大きくなるにつれて狭まっていることを発見しました。
また、このモデルの GPU 効率の高い実装も提供しており、トレーニング中に最適化されていないベースラインと比較してメモリ使用量を最大 61% 削減します。
推論中に最適化されたカーネルを利用することにより、モデルのメモリ消費量は、最適化されていないモデルと比較して 10 倍以上削減できます。
アーキテクチャの効率を適切に定量化するために、GPU の能力を超える軽量オペレーションを活用するカスタム ハードウェア ソリューションを FPGA 上に構築します。
私たちは、人間が判読できるスループットを超える 13 W で 10 億パラメータ スケールのモデルを処理し、LLM を脳のような効率に近づけました。
この研究は、効率的に実行しながら LLM をどこまで削減できるかを示すだけでなく、次世代の軽量 LLM を処理する際に将来のアクセラレータが最適化されるべき操作のタイプも示しています。
私たちのコード実装は \url{https://github.com/ridgerchu/matmulfreellm} で入手できます。

要約(オリジナル)

Matrix multiplication (MatMul) typically dominates the overall computational cost of large language models (LLMs). This cost only grows as LLMs scale to larger embedding dimensions and context lengths. In this work, we show that MatMul operations can be completely eliminated from LLMs while maintaining strong performance at billion-parameter scales. Our experiments show that our proposed MatMul-free models achieve performance on-par with state-of-the-art Transformers that require far more memory during inference at a scale up to at least 2.7B parameters. We investigate the scaling laws and find that the performance gap between our MatMul-free models and full precision Transformers narrows as the model size increases. We also provide a GPU-efficient implementation of this model which reduces memory usage by up to 61% over an unoptimized baseline during training. By utilizing an optimized kernel during inference, our model’s memory consumption can be reduced by more than 10x compared to unoptimized models. To properly quantify the efficiency of our architecture, we build a custom hardware solution on an FPGA which exploits lightweight operations beyond what GPUs are capable of. We processed billion-parameter scale models at 13W beyond human readable throughput, moving LLMs closer to brain-like efficiency. This work not only shows how far LLMs can be stripped back while still performing effectively, but also points at the types of operations future accelerators should be optimized for in processing the next generation of lightweight LLMs. Our code implementation is available at \url{https://github.com/ridgerchu/matmulfreellm}.

arxiv情報

著者 Rui-Jie Zhu,Yu Zhang,Ethan Sifferman,Tyler Sheaves,Yiqiao Wang,Dustin Richmond,Peng Zhou,Jason K. Eshraghian
発行日 2024-06-04 17:50:34+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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