指数関数的に高速化された言語モデリング
Exponentially Faster Language Modelling
November 15, 2023
著者: Peter Belcak, Roger Wattenhofer
cs.AI
要旨
言語モデルは、個々の推論において実際にはそのニューロンの指数関数的な一部のみを使用すれば十分である。その証拠として、我々はFastBERTを提示する。これは推論時にニューロンの0.3%のみを使用しながら、類似のBERTモデルと同等の性能を発揮するBERTの変種である。FastBERTは各層の推論において、4095個のニューロンのうちわずか12個を選択的に活性化する。これはフィードフォワードネットワークを高速フィードフォワードネットワーク(FFFs)に置き換えることで実現されている。条件付きニューラル実行の完全な加速ポテンシャルを引き出す真に効率的な実装は現時点では存在しないが、我々は最適化されたベースラインのフィードフォワード実装に対して78倍の高速化を達成する高水準のCPUコードと、同等のバッチ処理されたフィードフォワード推論に対して40倍の高速化を実現するPyTorch実装を提供する。我々はトレーニングコード、ベンチマーク設定、およびモデル重みを公開する。
English
Language models only really need to use an exponential fraction of their
neurons for individual inferences. As proof, we present FastBERT, a BERT
variant that uses 0.3\% of its neurons during inference while performing on par
with similar BERT models. FastBERT selectively engages just 12 out of 4095
neurons for each layer inference. This is achieved by replacing feedforward
networks with fast feedforward networks (FFFs). While no truly efficient
implementation currently exists to unlock the full acceleration potential of
conditional neural execution, we provide high-level CPU code achieving 78x
speedup over the optimized baseline feedforward implementation, and a PyTorch
implementation delivering 40x speedup over the equivalent batched feedforward
inference. We publish our training code, benchmarking setup, and model weights.