GPT-J 6B
EleutherAI · GPT-J · open weights
- MHA
- RoPE
- Parallel block
Facts and where they come from
| Released | 2021-06 | labmodel cardREADME citation: GPT-J-6B, June 2021 |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 6B | labmodel cardREADME: GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model |
| Active parameters | not disclosed | not disclosed |
| Context length | 2K tokens | config.jsonconfig.jsonn_positions |
| Norm placement | parallel | codemodelling codetransformers 5.18.0 gptj: one ln_1 feeds attention and the MLP in parallel |
| Norm type | LayerNorm | codemodelling codetransformers 5.18.0 gptj: one ln_1 feeds attention and the MLP in parallel |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | RoPE | codemodelling coderotary on the full head (default) |
| Parallel attention and MLP | yes | codemodelling codetransformers 5.18.0 gptj: one ln_1 feeds attention and the MLP in parallel |
Architecture, drawn from the data
MHA 16q/16kv. 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) | 6.05B |
|---|---|
| Active per token (modelled) | 6.05B |
| Without embeddings and output head | 5.64B total, 5.64B active |
| KV cache per token, BF16 (layers that grow with context) | 448 KiB |
| KV cache + state at 2K tokens, BF16 | 896 MiB |
| Decode FLOPs per token at 4K context | 13.6 GFLOP |
| Prefill FLOPs for a 4K prompt | 50 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 4,096 | config.jsonconfig.jsonn_embd |
| vocab | 50,400 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | config.jsonconfig.jsontie_word_embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 16 | config.jsonconfig.jsonn_head |
| mixers.full.kv_heads | 16 | config.jsonconfig.jsonn_head |
| mixers.full.head_dim | 256 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / n_head |
| ffns.dense.type | dense | codemodelling codeMLP |
| ffns.dense.d_ff | 16,384 | codemodelling codetransformers 5.18.0 gptj: n_inner defaults to 4 * n_embd |
| ffns.dense.gated | false | codemodelling codeGELU MLP |
| ffns.dense.bias | true | codemodelling codeMLP biases |
| layout | 28× full/dense | config.jsonconfig.jsonn_layer |
| norms_per_layer | 1 | codemodelling codeparallel attention and MLP share one LayerNorm |
Sources
- config.json @ 47e1693
- model card
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision