SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.13048 · 2023

RWKV: Reinventing RNNs for the Transformer Era

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 11 functions out of this paper's own repositories and ran 6 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
BlinkDL/RWKV-LM canonical 2 of 4
blinkdl/chatrwkv canonical 1 of 3
rwkv/rwkv.cpp pwc_unofficial 3 of 4
FunctionStatusWhere it lives
batch Ran BlinkDL/RWKV-LM/RWKV-v7/train_temp/rwkv7_train_simplified.py
code served (permissive licence) · get_code("7e9cf65e078afda5")
format_loss Ran rwkv/rwkv.cpp/python/measure_pexplexity.py
code served (permissive licence) · get_code("922e0a890b2fbbab")
format_loss_with_perplexity Ran rwkv/rwkv.cpp/python/measure_pexplexity.py
code served (permissive licence) · get_code("c64ea6a80f61aeac")
get_layer_count Ran rwkv/rwkv.cpp/python/convert_pytorch_to_ggml.py
code served (permissive licence) · get_code("4dbb2fe483ceceed")
sample_logits Ran blinkdl/chatrwkv/RWKV_in_150_lines.py
code served (permissive licence) · get_code("35e590faf9de67ca")
time_mixing__ Ran BlinkDL/RWKV-LM/RWKV-v7/rwkv_v7_demo_rnn.py
code served (permissive licence) · get_code("07a576b3352ec5ac")
RUN_CUDA_RWKV7g Not yet run BlinkDL/RWKV-LM/RWKV-v7/train_temp/rwkv7_train_simplified.py
code served (permissive licence) · get_code("4ba3321ca44d1608")
channel_mixing__ Not yet run BlinkDL/RWKV-LM/RWKV-v7/rwkv_v7_demo_rnn.py
code served (permissive licence) · get_code("a43aabdbc73f2f29")
load_all_stat Not yet run blinkdl/chatrwkv/chat.py
code served (permissive licence) · get_code("5256b8e5b92e6c98")
mm8 Not yet run blinkdl/chatrwkv/rwkv_pip_package/src/rwkv/model.py
code served (permissive licence) · get_code("104b35c3b39791a5")
split_last_end_of_line Not yet run rwkv/rwkv.cpp/python/chat_with_bot.py
code served (permissive licence) · get_code("ecd9b52290cb9d64")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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, thus parallelizing computations during training and maintains constant computational and memory complexity during inference. We scale our models as large as 14 billion parameters, by far the largest dense RNN ever trained, and find RWKV performs on par with similarly sized Transformers, suggesting future work can leverage this architecture to create more efficient models. This work presents a significant step towards reconciling trade-offs between computational efficiency and model performance in sequence processing tasks.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2305.13048")
get_code_for_paper("2305.13048")
have("2305.13048")

Connect an agent — have() is free.