gpt-oss · OpenAI

gpt-oss-120b

gpt-oss-120b from OpenAI has 116,829,156,672 parameters, of which about 5.71B are used for each token (a mixture of experts). Its weights take 234 GB in BF16 and about 58.4 GB at 4-bit (as released, with MXFP4 experts: 65.2 GB), and each token of context adds 73.7 KB of KV cache (2.4 GB at 32K tokens).

117Bparameters
5.71Bactive per token
234 GBBF16 weights
58.4 GB4-bit weights
73.7 KBKV per token

Part of the gpt-oss family: 20.9B · 117B

Architecture · VRAM · KV cache · Tensor shapes · Parameter count · FLOPs

Architecture

ArchitectureGptOssForCausalLM
Layers (L)36
Hidden size (d)2,880
AttentionGQA (8 query heads share each KV head); a learned sink per head
Heads64 query, 8 key/value, 64 each
Feed-forward128 experts of 2,880, 4 per token (SwiGLU), with biases
Vocabulary (V)201,088
Tied embeddingsno: separate output head
Biaseson q, k, v and the output projection; on the router and every expert
Extra normspre-norm (RMSNorm before attention and FFN)
Max context131,072 tokens; 18 of 36 layers use a 128-token sliding window
Weights in the releaseMXFP4 experts (4.25 bits a weight), BF16 for the rest

How much memory the weights need

Each parameter takes 4 bytes in FP32, 2 in BF16, 1 at 8 bits and half a byte at 4 bits, so the weights alone need:

PrecisionBytes per parameterWeights
FP324467 GB435.22 GiB
BF16 / FP162234 GB217.61 GiB
INT8 / FP81117 GB108.81 GiB
INT40.558.4 GB54.40 GiB
As releasedmixed65.2 GB60.77 GiB

GB here is 109 bytes; GiB (230) is what tools like nvidia-smi show. Real 4-bit files are a little larger: they also store scales, and some layers are often kept at higher precision. Every expert has to be in memory, not just the active ones: the router picks different experts for each token. A running model also needs its KV cache, activations and the runtime's own buffers.

How the experts are stored: MXFP4

gpt-oss-120b is released with its expert weights already quantized to MXFP4: each run of 32 weights shares one 8-bit power-of-two scale, and each weight is a 4-bit float, two to a byte. In the files every expert matrix becomes two U8 tensors, e.g. gate_up_proj_blocks [128, 5,760, 90, 16] (16 bytes hold 32 weights) and gate_up_proj_scales [128, 5,760, 90].

The parameter count on this page is the logical one: 114,661,785,600 expert weights, whatever their storage. Stored, they take 114,661,785,600 ÷ 2 = 57,330,892,800 bytes of blocks plus 114,661,785,600 ÷ 32 = 3,583,180,800 bytes of scales: 4.25 bits a weight, 60.9 GB in all. Attention, the router, the embedding and the head (2,167,371,072 parameters) stay in BF16, 4.3 GB.

4.3 GB + 60.9 GB = 65.2 GB of weights as released

Memory calculator

On common GPUs

Whether the weights plus a 8K-token KV cache fit in 90% of the card (how this is worked out):

GPU memoryBF168-bit4-bit
8 GB–––
12 GB–––
16 GB–––
24 GB–––
48 GB–––
80 GB––✓

KV cache

Every layer keeps a key and a value vector for each of its 8 KV heads, for every token in the context:

2 × L × K × h × 2 bytes = 2 × 36 × 8 × 64 × 2 = 73,728 bytes per token

Grouped-query attention is why this is small: with a KV head for each of the 64 query heads it would be 8 times larger.

ContextKV cache, BF168-bit KVWith the sliding windowWeights + KV, BF16
4K302 MB151 MB156 MB234 GB
32K2.4 GB1.2 GB1.2 GB236 GB
128K (max)9.7 GB4.8 GB4.8 GB243 GB

In the config, 18 of 36 layers use a 128-token sliding window. Runtimes that honour it never cache more than 128 tokens for those layers; the column shows what that saves.

For one sequence. Batching multiplies the KV cache by the number of sequences, not the weights.

Every tensor shape

The names are those in the Hugging Face checkpoint; shapes are [out, in] for weight matrices, as PyTorch stores them. One block is shown: the model repeats it 36 times.

TensorShapeParameters
Embedding
model.embed_tokens.weight[201,088, 2,880]579,133,440
Every block: model.layers.N.…
self_attn.q_proj.weight[4,096, 2,880]11,796,480
self_attn.q_proj.bias[4,096]4,096
self_attn.k_proj.weight[512, 2,880]1,474,560
self_attn.k_proj.bias[512]512
self_attn.v_proj.weight[512, 2,880]1,474,560
self_attn.v_proj.bias[512]512
self_attn.o_proj.weight[2,880, 4,096]11,796,480
self_attn.o_proj.bias[2,880]2,880
self_attn.sinksone learned "sink" score per head, so a head can attend to nothing[64]64
mlp.router.weightthe router: one score per expert[128, 2,880]368,640
mlp.router.bias[128]128
mlp.experts.gate_up_projstored as MXFP4: _blocks (two 4-bit values per byte) and _scales (one per 32 values)128 × [5,760, 2,880]2,123,366,400
mlp.experts.gate_up_proj_biasbiases stay in BF16128 × [5,760]737,280
mlp.experts.down_proj128 × [2,880, 2,880]1,061,683,200
mlp.experts.down_proj_bias128 × [2,880]368,640
input_layernorm.weight[2,880]2,880
post_attention_layernorm.weight[2,880]2,880
After the last block
model.norm.weightfinal norm[2,880]2,880
lm_head.weightscores every token in the vocabulary[201,088, 2,880]579,133,440

The parameter count, step by step

Each line gives the formula, the numbers from config.json, and the subtotal. The symbols:

V
vocabulary 201,088
d
hidden size 2,880
L
layers 36
H
query heads 64
K
key/value heads 8
h
head size 64
E
routed experts 128
k
experts per token 4
f_e
expert FFN size 2,880

1. Embedding

One row of d numbers for each of the V tokens in the vocabulary.

Embedding
V × d
201,088 × 2,880
= 579,133,440

2. Every block, ×36

Attention
H·h × d + H·h + 2 × (K·h × d) + 2 × K·h + d × H·h + d + H
4,096 × 2,880 + 4,096 + 2 × (512 × 2,880) + 2 × 512 + 2,880 × 4,096 + 2,880 + 64
= 26,550,144
Mixture of experts (128 experts, 4 per token)
E × d + E + E × (2f_e × d) + E × (2f_e) + E × (d × f_e) + E × (d)
128 × 2,880 + 128 + 128 × (5,760 × 2,880) + 128 × (5,760) + 128 × (2,880 × 2,880) + 128 × (2,880)
= 3,186,524,288
Norms
2 × d
2 × 2,880
= 5,760
One block
attention + mixture of experts + norms
26,550,144 + 3,186,524,288 + 5,760
= 3,213,080,192
36 blocks
L × block
36 × 3,213,080,192
= 115,670,886,912

3. Final norm and output head

Final norm + head
d + V × d
2,880 + 201,088 × 2,880
= 579,136,320

4. Total

Total
embedding + blocks + final
579,133,440 + 115,670,886,912 + 579,136,320
= 116,829,156,672

5. Active parameters per token

The router sends each token to 4 of the 128 experts in each MoE block, so only those experts' weights are used. One routed expert is 24,891,840 parameters.

Active
total − MoE blocks × (E − k) × expert
116,829,156,672 − 36 × 124 × 24,891,840
= 5,711,982,912

OpenAI's model card gives 5.13B active: the same count without the 579M embedding table, which is a lookup rather than a multiply.

Hugging Face counts 116,829,156,672 parameters in the openai/gpt-oss-120b safetensors files (it counts the MXFP4 experts as logical weights, two per stored byte, and leaves the scales out). The arithmetic above matches exactly.

FLOPs per token

A forward pass costs about two floating-point operations (a multiply and an add) for every weight a token passes through: 2 × N, with N the active weights used in matrix multiplies (the embedding lookup is a read, not a multiply; the output head is a multiply). Here that is 2 × 5,711,982,912 = 11.4 GFLOPs per token.

Attention adds the work of comparing the token with every earlier one: 2 × L × T × H × (hqk + hv) for T tokens of context, which grows with the context while 2N does not. Layers with a window see at most 128 tokens, which the table allows for.

That is for one new token at position T, as when generating. Averaged over a whole training sequence of length T, each token sees T/2 earlier ones on average, which halves it.

Context T2NAttentionTotal per token
4K11.4 GFLOPs1.2 GFLOPs12.7 GFLOPs
32K11.4 GFLOPs9.7 GFLOPs21.1 GFLOPs
128K11.4 GFLOPs38.7 GFLOPs50.1 GFLOPs

Training costs about three times the forward pass per token (6N): the backward pass does roughly twice the forward work.

Compare

gpt-oss-120b vs Llama 4 Scout (17B-16E) · Compare with any model →

Close in size: Llama 4 Scout (17B-16E) 108B · Mixtral 8x22B 141B · Qwen2.5 72B 72.7B · Llama 3.1 70B 70.6B · Llama 3.3 70B 70.6B

Source

Read from openai/gpt-oss-120b, fetched 2026-12-02.