GPT-NeoX-20B
EleutherAI · GPT-NeoX · open weights
- MHA
- RoPE
- Partial RoPE
- Parallel block
Facts and where they come from
| Released | 2022-04 | paperarXiv 2204.06745arXiv v1, April 2022 |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 20B | labmodel cardREADME: a 20 billion parameter autoregressive language model |
| Active parameters | not disclosed | not disclosed |
| Context length | 2K tokens | config.jsonconfig.jsonmax_position_embeddings |
| Norm placement | parallel | codemodelling codetransformers 5.18.0 gpt_neox: use_parallel_residual, separate input and post-attention norms |
| Norm type | LayerNorm | codemodelling codetransformers 5.18.0 gpt_neox: use_parallel_residual, separate input and post-attention norms |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | RoPE on 25% of each head | config.jsonconfig.jsonrotary_pct |
| Parallel attention and MLP | yes | codemodelling codetransformers 5.18.0 gpt_neox: use_parallel_residual, separate input and post-attention norms |
Architecture, drawn from the data
MHA 64q/64kv. 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) | 20.6B |
|---|---|
| Active per token (modelled) | 20.6B |
| Without embeddings and output head | 19.9B total, 19.9B active |
| Published weights (Hugging Face count) | 20.7B (packed low-bit tensors, so not comparable) |
| KV cache per token, BF16 (layers that grow with context) | 1.03 MiB |
| KV cache + state at 2K tokens, BF16 | 2.06 GiB |
| Decode FLOPs per token at 4K context | 44.9 GFLOP |
| Prefill FLOPs for a 4K prompt | 172 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 6,144 | config.jsonconfig.jsonhidden_size |
| vocab | 50,432 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | config.jsonconfig.jsontie_word_embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 64 | config.jsonconfig.jsonnum_attention_heads |
| mixers.full.kv_heads | 64 | config.jsonconfig.jsonnum_attention_heads |
| mixers.full.head_dim | 96 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / num_attention_heads |
| mixers.full.bias | true | codemodelling codeqkv biases |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 24,576 | config.jsonconfig.jsonintermediate_size |
| ffns.dense.gated | false | codemodelling codeMLP: two matrices, no gate |
| ffns.dense.bias | true | codemodelling codeMLP has biases |
| layout | 44× full/dense | config.jsonconfig.jsonnum_hidden_layers |
Sources
- config.json @ c292233
- model card
- arXiv 2204.06745
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision