Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

OpenAI · Architecture map

GPT-3 175B

GPT-2's block at 96 layers, with attention layers that alternate between dense and locally banded sparse patterns.

GPT-3 175B, as described in the May 2020 paper · GPT release timeline

Inside GPT-3 175B

Parameters
175B
Layers
96
Width
12,288
Mixer
Multi-head
Select a component to explore it.
The complete GPT-3 175B architectureInput IDs select embeddings. Each layer adds its updates along the residual stream. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer. Keys and values for all 96 heads, 128 values each, per token per layer (dense layers). Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup50,25712,288Token + learned position vectorsCL12,288Transformer layers 1–96Transformer layers 1–96 · 96 repetitions96 layers · one layer shown96LayerNorm before this operation.LayerNormDense / banded attention: Dense feed-forward networks. Attention alternates between dense and locally banded sparse patterns across layers; the paper does not give the order or the band width.Dense / bandedattentionAdd the branch output to the original stream. +LayerNorm before this operation.LayerNormDense feed-forward: Dense feed-forward networks. Attention alternates between dense and locally banded sparse patterns across layers; the paper does not give the order or the band width.Densefeed-forwardAdd the branch output to the original stream. +Residual streamLast columnCL12,288Final LayerNormA separate learned vocabulary projection.Output weights12,28850,257Vocabulary scoresSoftmax50,257Next-token probabilities
Inside multi-head attention · Transformer layers 1–96
96 heads.

Earlier context dimmed · current token bright · dashed regions contain cached entries.

GPT-3 175B: Transformer layers 1–96 · multi-head attention96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer. Keys and values for all 96 heads, 128 values each, per token per layer (dense layers).96 heads; the front face shows one representative.96 headsAttention input. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input12,288CLWq. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Wq12,288128Wk. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Wk12,288128Wv. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Wv12,288128K cache. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache128CLV cache. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache128CLQ context. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Earlier context is dimmed; outlined columns are current.Current token computation.Q context128CLScaled query–key scores, masking and softmax. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.CLCL×. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.×Joined heads. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.96Wo. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Wo12,28812,288Attention output. 96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output12,288CL
Model-specific details
Transformer layers 1–96 · 96 repetitions
Dense feed-forward networks. Attention alternates between dense and locally banded sparse patterns across layers; the paper does not give the order or the band width.
Attention and positions
96 heads of 128 values, each with its own keys and values; context of 2,048 tokens. Layers alternate between dense and locally banded sparse attention, similar to the Sparse Transformer.
Memory
Keys and values for all 96 heads, 128 values each, per token per layer (dense layers).

The 175B stack

GPT-3 retains GPT-2’s pre-normalised dense transformer layout but alternates dense and locally banded sparse attention.

The attention box identifies the mixed mask pattern; the paper does not give a numerical local-window width.

Explore the components

Sources for this map