RWKV-4 14B
RWKV · RWKV · open weights
- Linear attention
- Pre-norm
Facts and where they come from
| Released | 2023-05 | paperarXiv 2305.13048arXiv v1, May 2023 |
|---|---|---|
| Licence | not disclosed | not disclosed |
| Total parameters | 14B | labmodel cardmodel name rwkv-4-14b |
| Active parameters | not disclosed | not disclosed |
| Context length | 1K tokens | config.jsonconfig.jsoncontext_length |
| Norm placement | pre | codemodelling codetransformers 5.18.0 rwkv: ln1 before time mixing, ln2 before channel mixing |
| Norm type | LayerNorm | codemodelling codetransformers 5.18.0 rwkv: ln1 before time mixing, ln2 before channel mixing |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | none; all layers: the recurrence carries order | codemodelling codetransformers 5.18.0 rwkv: no positional encoding |
| Parallel attention and MLP | no | codemodelling codetransformers 5.18.0 rwkv: ln1 before time mixing, ln2 before channel mixing |
Architecture, drawn from the data
RWKV. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 14.1B |
|---|---|
| Active per token (modelled) | 14.1B |
| Without embeddings and output head | 13.6B total, 13.6B active |
| KV cache per token, BF16 (layers that grow with context) | 0 B |
| KV cache + state at 1K tokens, BF16 | 1.95 GiB |
| Decode FLOPs per token at 4K context | 32 GFLOP |
| Prefill FLOPs for a 4K prompt | 129 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 5,120 | config.jsonconfig.jsonhidden_size |
| vocab | 50,277 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | codemodelling codeRWKV: separate head |
| mixers.rwkv.type | rwkv | codemodelling codeRWKV time mixing |
| mixers.rwkv.head_dim | 5,120 | codemodelling codeRWKV-4: a single head of width hidden_size |
| mixers.rwkv.mats | 4 | codemodelling codetime mixing: receptance, key, value, output |
| ffns.dense.type | dense | codemodelling codechannel mixing |
| ffns.dense.d_ff | 20,480 | config.jsonconfig.jsonintermediate_size |
| ffns.dense.gated | false | codemodelling codechannel mixing: key and value matrices |
| ffns.dense.receptance | true | codemodelling codechannel mixing also has a d x d receptance matrix |
| layout | 40× rwkv/dense | config.jsonconfig.jsonnum_hidden_layers |
Sources
- config.json @ 4effb0f
- model card
- arXiv 2305.13048
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision