TensorX
返回文献探索

Paper · arXiv 2311.10770

Exponentially Faster Language Modelling

Peter Belcak, Roger Wattenhofer

119 upvotesNovember 15, 2023arXiv 预印本
AI 摘要

FastBERT achieves significant inference speedup over BERT by selectively engaging a small fraction of neurons using fast feedforward networks.

FastBERTBERTfeedforward networksfast feedforward networks (FFFs)conditional neural executioninference speedup

Abstract

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.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号
Exponentially Faster Language Modelling | TensorX