All models

rwkv_tiny

An attention-free RNN that trains like a GPT and runs with constant memory per token.

Language · 6,060 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 6,060 operations (1.4 MB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
72M
Operations
6,060
Framework
PyTorch
Recurrent
Yes
Published
Findings of EMNLP 2023
Cited by
367 (as of 9 October 2026)
Authors
Bo Peng, Eric Alcaide, Quentin G. Anthony and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8990
Graph hash
c94d701a8c9341b542bd86517c43e6fbb4b9f8dba609c9807a05c2b54c2f2696
Skeleton hash
6674f41d30d12f5db1c8173ddaa7f8ec948c167426a2ea232a88b8480ba245bc
Architecture hash
6c5d4d6eb6fe49100a66cd8abc95a9c5c08404287c12fc957ca8ed57ba9c2de4
Diagram SHA-256
884bb896386bb73f62bba41bd86e21bca1d53ba64305e9b73c9813cbd1be6e2f
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

About this model's family

RWKV, short for Receptance Weighted Key Value, is a language model that trains in parallel like a Transformer but runs like a recurrent network. The motivation is the usual trade: Transformers scale quadratically in memory and compute with sequence length, while RNNs scale linearly but have lagged in performance and parallelism. RWKV uses a linear attention mechanism that can be written either as a Transformer or as an RNN, so training is parallel and inference keeps constant compute and memory per token. The paper scales it to 14 billion parameters, which it calls by far the largest dense RNN ever trained, and finds it on par with similarly sized Transformers.

The name comes from the four elements inside every block: Receptance, Weight, Key and Value. The model is a stack of residual blocks, each with a time-mixing sub-block and a channel-mixing sub-block. A small quirk is the token shift: the projections for R, K and V are formed by linear interpolation between the current and previous timestep inputs. The design was inspired by the Attention Free Transformer, with the interaction weights changed so the whole thing can be transformed into an RNN. Each weight is a channelwise time decay multiplied by relative position and traced backward from the current time.

The README puts it plainly: RWKV is an RNN with Transformer-level LLM performance that can be trained like a GPT, and it is 100% attention-free. Parallel training works because the time-decay of each channel is data-independent and trainable. The traced members are the RWKV-4 causal language model from the transformers library at two small configurations. The repository says the name is pronounced RwaKuv.

Key idea. RWKV reformulates attention as a linear, channelwise time-decay recurrence so one model can be trained in parallel like a Transformer and run as an RNN with constant per-token cost, scaling to 14 billion parameters.

  • RWKV
  • RWKV-4
  • Receptance Weighted Key Value
  • RwkvForCausalLM
  • RWKV-LM
  • BlinkDL
  • linear attention RNN
  • attention-free language model
  • Pile

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{peng2023rwkvreinventingrnnstransformer,
      title={RWKV: Reinventing RNNs for the Transformer Era}, 
      author={Bo Peng and Eric Alcaide and Quentin Anthony and Alon Albalak and Samuel Arcadinho and Stella Biderman and Huanqi Cao and Xin Cheng and Michael Chung and Matteo Grella and Kranthi Kiran GV and Xuzheng He and Haowen Hou and Jiaju Lin and Przemyslaw Kazienko and Jan Kocon and Jiaming Kong and Bartlomiej Koptyra and Hayden Lau and Krishna Sri Ipsit Mantri and Ferdinand Mom and Atsushi Saito and Guangyu Song and Xiangru Tang and Bolun Wang and Johan S. Wind and Stanislaw Wozniak and Ruichong Zhang and Zhenyuan Zhang and Qihang Zhao and Peng Zhou and Qinghua Zhou and Jian Zhu and Rui-Jie Zhu},
      year={2023},
      eprint={2305.13048},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2305.13048}, 
}