What problem does it solve?
RWKV provides a model architecture that removes quadratic attention memory growth by replacing KV caches with a fixed-size recurrent state, enabling efficient inference over arbitrarily long contexts without exploding memory use.
Core Features & Use Cases
- Linear-time inference: O(1) work per token during sequential inference for streaming and long-document generation.
- Infinite context via compact state: Constant-size recurrent state holds long-range context instead of storing full KV caches.
- Parallelizable training, sequential inference: Train with Transformer-style parallelism and infer with RNN-style stateful forward passes.
- State management & production workflows: Tools and best practices for serializing, sharing, and compressing state for multi-session deployments.
- Scales and multimodal support: Includes RWKV-7 advancements for numerical stability, multi-head time-mixing, RoPE, and vision-language integration.
Quick Start
Initialize the RWKV runtime with CUDA, load a trained checkpoint, and perform sequential forward calls while preserving the model state to generate tokens.