Back to Search Start Over

RWKV: Reinventing RNNs for the Transformer Era

Authors :
Peng, Bo
Alcaide, Eric
Anthony, Quentin
Albalak, Alon
Arcadinho, Samuel
Cao, Huanqi
Cheng, Xin
Chung, Michael
Grella, Matteo
GV, Kranthi Kiran
He, Xuzheng
Hou, Haowen
Kazienko, Przemyslaw
Kocon, Jan
Kong, Jiaming
Koptyra, Bartlomiej
Lau, Hayden
Mantri, Krishna Sri Ipsit
Mom, Ferdinand
Saito, Atsushi
Tang, Xiangru
Wang, Bolun
Wind, Johan S.
Wozniak, Stansilaw
Zhang, Ruichong
Zhang, Zhenyuan
Zhao, Qihang
Zhou, Peng
Zhu, Jian
Zhu, Rui-Jie
Publication Year :
2023
Publisher :
arXiv, 2023.

Abstract

Transformers have revolutionized almost all natural language processing (NLP) tasks but suffer from memory and computational complexity that scales quadratically with sequence length. In contrast, recurrent neural networks (RNNs) exhibit linear scaling in memory and computational requirements but struggle to match the same performance as Transformers due to limitations in parallelization and scalability. We propose a novel model architecture, Receptance Weighted Key Value (RWKV), that combines the efficient parallelizable training of Transformers with the efficient inference of RNNs. Our approach leverages a linear attention mechanism and allows us to formulate the model as either a Transformer or an RNN, which parallelizes computations during training and maintains constant computational and memory complexity during inference, leading to the first non-transformer architecture to be scaled to tens of billions of parameters. Our experiments reveal that RWKV performs on par with similarly sized Transformers, suggesting that future work can leverage this architecture to create more efficient models. This work presents a significant step towards reconciling the trade-offs between computational efficiency and model performance in sequence processing tasks.

Details

Database :
OpenAIRE
Accession number :
edsair.doi.dedup.....976e51bb836a159002f80744accdc096
Full Text :
https://doi.org/10.48550/arxiv.2305.13048