OpenAI · 2019-02 · Dense
GPT-2
GPT-2 is a multi-head attention (MHA) transformer released by OpenAI in 2019-02, with 12 layers, hidden size 768 and a context window of 1,024 tokens.
Layer stack
Attention ×12 · Layers 12
Key facts
| Family | OpenAI |
|---|---|
| Released | 2019-02 |
| Params | 1.24 B |
| Context | 1,024 tokens |
| Attention | MHA (12:12) |
| Layers | 12 |
| Hidden | 768 |
| Heads | 12 |
| Vocab | 50,257 |
| Position | learned-absolute |
| Norm | LayerNorm |
| Activation | — |
| Dtype | bf16 |
| Architecture class | GPT2LMHeadModel |
Architecture overview
Attention
multi-head attention (MHA) — 12 q-heads / 12 kv-heads.
Feed-forward / MoE
It is a dense model: all 1.24B parameters participate in computing every token.
Field-level comparison
Compared against the previous model of the same lab; where none exists, against the structurally closest model. The ratio column is this model divided by the comparison model.
Full-field comparison vs most-similar GPT-3 175B (paper)
| Model | GPT-2 | GPT-3 175B (paper) | Ratio |
|---|---|---|---|
| model_type | gpt2 | gpt3-paper | ≠ |
| architectures | GPT2LMHeadModel | — | |
| hidden_size | — | 12288 | |
| num_attention_heads | — | 96 | |
| max_position_embeddings | — | 2048 | |
| layer_norm_epsilon | 0.00001 | — | |
| vocab_size | 50257 | 50257 | ≈1 |
| activation_function | gelu_new | — | |
| attn_pdrop | 0.1 | — | |
| bos_token_id | 50256 | — | |
| embd_pdrop | 0.1 | — | |
| eos_token_id | 50256 | — | |
| initializer_range | 0.02 | — | |
| n_ctx | 1024 | — | |
| n_embd | 768 | — | |
| n_head | 12 | — | |
| n_layer | 12 | — | |
| n_positions | 1024 | — | |
| resid_pdrop | 0.1 | — | |
| summary_first_dropout | 0.1 | — | |
| summary_proj_to_labels | true | — | |
| summary_type | cls_index | — | |
| summary_use_proj | true | — |
Most similar architectures
- GPT-3 175B (paper) (OpenAI, 2020-05) 0.744
- LLaMA 1 7B (Meta, 2023-02) 0.629
- Step-3 (StepFun, 2025-07) 0.604
- Step-3.5-Flash (StepFun, 2026-03) 0.602
- Step-3.7-Flash (StepFun, 2026-05) 0.602
- Qwen1.5 7B (Qwen, 2024-02) 0.580
Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).
Raw config fields
20 fields
| activation_function | gelu_new |
|---|---|
| architectures | GPT2LMHeadModel |
| attn_pdrop | 0.1 |
| bos_token_id | 50256 |
| embd_pdrop | 0.1 |
| eos_token_id | 50256 |
| initializer_range | 0.02 |
| layer_norm_epsilon | 0.00001 |
| model_type | gpt2 |
| n_ctx | 1024 |
| n_embd | 768 |
| n_head | 12 |
| n_layer | 12 |
| n_positions | 1024 |
| resid_pdrop | 0.1 |
| summary_first_dropout | 0.1 |
| summary_proj_to_labels | true |
| summary_type | cls_index |
| summary_use_proj | true |
| vocab_size | 50257 |