Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

NVIDIA · Architecture map

Nemotron-4 340B

A big dense model with an ungated feed-forward network that uses squared ReLU in place of SwiGLU.

Nemotron-4-340B-Base, June 2024 · NVIDIA release timeline

Inside Nemotron-4 340B

Parameters
340B
Layers
96
Width
18,432
Mixer
Grouped-query
Select a component to explore it.
The complete Nemotron-4 340B architectureInput IDs select embeddings. Each layer adds its updates along the residual stream. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096. Keys and values for 8 heads of size 192, per token per layer. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup256,00018,432Input token vectorsCL18,432Transformer layers 1–96Transformer layers 1–96 · 96 repetitions96 layers · one layer shown96LayerNorm before this operation.LayerNormGrouped-query attention: A plain two-matrix feed-forward network (hidden size 73728, four times the width) with squared ReLU activation, with no gate.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. A plain two-matrix feed-forward network (hidden size 73728, four times the width) with squared ReLU activation, with no gate.RoPEAdd the branch output to the original stream. +LayerNorm before this operation.LayerNormSquared-ReLU: A plain two-matrix feed-forward network (hidden size 73728, four times the width) with squared ReLU activation, with no gate.Squared-ReLUAdd the branch output to the original stream. +Residual streamLast columnCL18,432Final LayerNormA separate learned vocabulary projection.Output weights18,432256,000Vocabulary scoresSoftmax256,000Next-token probabilities
Inside grouped-query attention · Transformer layers 1–96
12 query heads per group × 8 K/V groups.

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

Nemotron-4 340B: Transformer layers 1–96 · grouped-query attention96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096. Keys and values for 8 heads of size 192, per token per layer.8 KV groups; the front face shows one representative.8 KV groups12 heads / group; the front face shows one representative.12 heads / groupAttention input. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input18,432CLWq. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Wq18,432192Wk. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Wk18,432192Wv. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Wv18,432192RoPE 96. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.RoPE 96RoPE 96. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.RoPE 96K cache. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache192CLV cache. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache192CLQ context. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Earlier context is dimmed; outlined columns are current.Current token computation.Q context192CLScaled query–key scores, masking and softmax. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.CLCL×. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.×Joined heads. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.96Wo. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Wo18,43218,432Attention output. 96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output18,432CL
Model-specific details
Transformer layers 1–96 · 96 repetitions
A plain two-matrix feed-forward network (hidden size 73728, four times the width) with squared ReLU activation, with no gate.
Attention and positions
96 query heads share 8 key/value heads (head size 192). Rotary positions applied to half of each head (rotary percentage 0.5). Training sequence length 4096.
Memory
Keys and values for 8 heads of size 192, per token per layer.

A large dense transformer

The Base checkpoint trained on 4,096-token sequences. The Instruct and Reward checkpoints derive from this backbone.

Explore the components

Sources for this map