rwkv-architecture

Model RWKV sequences with linear-time inference and constant per-token memory.

2|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-config --skill rwkv-architecture-clay-hhk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rwkv-architecture
Source: https://github.com/Clay-HHK/claude-config/tree/main/skills/AI-research-SKILLs/01-model-architecture/rwkv
Command: npx skills add https://github.com/Clay-HHK/claude-config --skill rwkv-architecture-clay-hhk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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.

Frequently Asked Questions about rwkv-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does RNN-style state management enable infinite context for large language model inference?

RNN-style state management replaces growing KV caches with a fixed-size recurrent state to enable infinite context, ensuring constant per-token memory during large language model inference without quadratic attention memory growth.

Can I use PyTorch and deepspeed for parallelizable training with RWKV models?

Yes, you can use PyTorch and deepspeed for parallelizable training. RWKV models support Transformer-style parallelism during training and RNN-style stateful forward passes for sequential inference.

What is the best way to process long documents without exploding memory use?

The best way to process long documents without exploding memory use is linear-time sequence modeling. It performs O(1) work per token using a compact recurrent state instead of storing full KV caches.

Does RWKV support multimodal vision-language tasks and streaming token generation?

Yes, RWKV supports multimodal vision-language integration and streaming token-by-token generation. RWKV-7 advancements include multi-head time-mixing and RoPE for numerical stability during these tasks.

How do I serialize and compress model state for multi-session deployments?

To serialize and compress model state for multi-session deployments, use state management tools for sharing and compressing recurrent states. This maintains constant-size context across multiple independent sessions.