llm-architectures-explained

/models

gpt-oss-20b

OpenAI · gpt-oss · open weights

Facts and where they come from

Released2025-08config.jsonconfig.jsonHugging Face repository creation date (api.createdAt)
Licenceapache-2.0config.jsonconfig.jsonREADME metadata: license
Total parameters21Blabmodel cardREADME: 21B parameters with 3.6B active
Active parameters3.6Blabmodel cardREADME: 3.6B active
Context length128K tokensconfig.jsonconfig.jsonmax_position_embeddings
Norm placementprecodemodelling codetransformers 5.18.0 / repo modelling code for gpt_oss: input_layernorm before attention, post_attention_layernorm before the MLP
Norm typeRMSNormcodemodelling codetransformers 5.18.0 / repo modelling code for gpt_oss: input_layernorm before attention, post_attention_layernorm before the MLP
QK-normnocodemodelling codeno q/k normalisation in the attention block
Positional encodingRoPEcodemodelling coderotary on the full head (default)
Parallel attention and MLPnocodemodelling codetransformers 5.18.0 / repo modelling code for gpt_oss: input_layernorm before attention, post_attention_layernorm before the MLP

Architecture, drawn from the data

12× GQA 64q/8kv, window 128 + 12× GQA 64q/8kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.

gpt-oss-20b: layer stack and blockslayers (24)mixer / FFNlayer 0: GQA: 64 query / 8 KV heads · head 64 · window 128layer 0: MoE: 32 experts, 4 active · expert 2880layer 1: GQA: 64 query / 8 KV heads · head 64layer 1: MoE: 32 experts, 4 active · expert 2880layer 2: GQA: 64 query / 8 KV heads · head 64 · window 128layer 2: MoE: 32 experts, 4 active · expert 2880layer 3: GQA: 64 query / 8 KV heads · head 64layer 3: MoE: 32 experts, 4 active · expert 2880layer 4: GQA: 64 query / 8 KV heads · head 64 · window 128layer 4: MoE: 32 experts, 4 active · expert 2880layer 5: GQA: 64 query / 8 KV heads · head 64layer 5: MoE: 32 experts, 4 active · expert 2880layer 6: GQA: 64 query / 8 KV heads · head 64 · window 128layer 6: MoE: 32 experts, 4 active · expert 2880layer 7: GQA: 64 query / 8 KV heads · head 64layer 7: MoE: 32 experts, 4 active · expert 2880layer 8: GQA: 64 query / 8 KV heads · head 64 · window 128layer 8: MoE: 32 experts, 4 active · expert 2880layer 9: GQA: 64 query / 8 KV heads · head 64layer 9: MoE: 32 experts, 4 active · expert 2880layer 10: GQA: 64 query / 8 KV heads · head 64 · window 128layer 10: MoE: 32 experts, 4 active · expert 2880layer 11: GQA: 64 query / 8 KV heads · head 64layer 11: MoE: 32 experts, 4 active · expert 2880layer 12: GQA: 64 query / 8 KV heads · head 64 · window 128layer 12: MoE: 32 experts, 4 active · expert 2880layer 13: GQA: 64 query / 8 KV heads · head 64layer 13: MoE: 32 experts, 4 active · expert 2880layer 14: GQA: 64 query / 8 KV heads · head 64 · window 128layer 14: MoE: 32 experts, 4 active · expert 2880layer 15: GQA: 64 query / 8 KV heads · head 64layer 15: MoE: 32 experts, 4 active · expert 2880layer 16: GQA: 64 query / 8 KV heads · head 64 · window 128layer 16: MoE: 32 experts, 4 active · expert 2880layer 17: GQA: 64 query / 8 KV heads · head 64layer 17: MoE: 32 experts, 4 active · expert 2880layer 18: GQA: 64 query / 8 KV heads · head 64 · window 128layer 18: MoE: 32 experts, 4 active · expert 2880layer 19: GQA: 64 query / 8 KV heads · head 64layer 19: MoE: 32 experts, 4 active · expert 2880layer 20: GQA: 64 query / 8 KV heads · head 64 · window 128layer 20: MoE: 32 experts, 4 active · expert 2880layer 21: GQA: 64 query / 8 KV heads · head 64layer 21: MoE: 32 experts, 4 active · expert 2880layer 22: GQA: 64 query / 8 KV heads · head 64 · window 128layer 22: MoE: 32 experts, 4 active · expert 2880layer 23: GQA: 64 query / 8 KV heads · head 64layer 23: MoE: 32 experts, 4 active · expert 288001223× 12normGQA: 64 query / 8 KV heads · head 64 · window 128+normMoE: 32 experts, 4 active · expert 2880+× 12normGQA: 64 query / 8 KV heads · head 64+normMoE: 32 experts, 4 active · expert 2880+sliding windowfull attentionMoE FFN

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.9B
Active per token (modelled)4.19B
Without embeddings and output head19.7B total, 3.03B active
Published weights (Hugging Face count)20.9B (packed low-bit tensors, so not comparable)
KV cache per token, BF16 (layers that grow with context)24 KiB
KV cache + state at 128K tokens, BF163 GiB
Decode FLOPs per token at 4K context8.05 GFLOP
Prefill FLOPs for a 4K prompt26.6 TFLOP

KV cache against context

gpt-oss-20b: KV cache bytes against context length101001,00010,000100,00098 KiB980 KiB9.5 MiB95 MiB950 MiBcontext (tokens)KV cache + state (BF16)gpt-oss-20b

Compare with other models →

Every architecture field

FieldValueSource
d_model2,880config.jsonconfig.jsonhidden_size
vocab201,088config.jsonconfig.jsonvocab_size
tied_embeddingsfalseconfig.jsonconfig.jsontie_word_embeddings
mixers.full.typeattncodemodelling codeattention block
mixers.full.heads64config.jsonconfig.jsonnum_attention_heads
mixers.full.kv_heads8config.jsonconfig.jsonnum_key_value_heads
mixers.full.head_dim64config.jsonconfig.jsonhead_dim
mixers.full.biastruecodemodelling codeattention_bias: true
mixers.sliding.typeattncodemodelling codeattention block
mixers.sliding.heads64config.jsonconfig.jsonnum_attention_heads
mixers.sliding.kv_heads8config.jsonconfig.jsonnum_key_value_heads
mixers.sliding.head_dim64config.jsonconfig.jsonhead_dim
mixers.sliding.window128config.jsonconfig.jsonsliding_window
mixers.sliding.biastruecodemodelling codeattention_bias: true
ffns.moe.typemoecodemodelling codeMoE block
ffns.moe.experts32config.jsonconfig.jsonnum_local_experts
ffns.moe.active4config.jsonconfig.jsonnum_experts_per_tok
ffns.moe.d_expert2,880config.jsonconfig.jsonintermediate_size
ffns.moe.gatedtruecodemodelling codeexperts are gated MLPs
layout1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moe · 1× sliding/moe · 1× full/moeconfig.jsonconfig.jsonlayer_types

Sources

Listed in the LLM Architecture Gallery checklist as “GPT-OSS (20B)” (name only; see about).