Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Hugging Face · Architecture map

SmolLM3 3B

A small dense model that omits explicit rotary positions from every fourth layer. Causal masks and earlier layers still carry order information.

SmolLM3-3B, July 2025 · SmolLM release timeline

Inside SmolLM3 3B

Parameters
3B
Layers
36
Width
2,048
Mixer
Grouped-query
Select a component to explore it. Layer colours match the execution-order strip.
The complete SmolLM3 3B architectureInput IDs select embeddings. Layer types execute in the order strip; dotted lines connect the type examples below. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding. Keys and values for 4 heads, per token per layer, in all 36 layers. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup128,2562,048Input token vectorsCL2,048Execution order · 36 layersLayer 1: RoPE layersLayer 2: RoPE layersLayer 3: RoPE layersLayer 4: NoPE layersLayer 5: RoPE layersLayer 6: RoPE layersLayer 7: RoPE layersLayer 8: NoPE layersLayer 9: RoPE layersLayer 10: RoPE layersLayer 11: RoPE layersLayer 12: NoPE layersLayer 13: RoPE layersLayer 14: RoPE layersLayer 15: RoPE layersLayer 16: NoPE layersLayer 17: RoPE layersLayer 18: RoPE layersLayer 19: RoPE layersLayer 20: NoPE layersLayer 21: RoPE layersLayer 22: RoPE layersLayer 23: RoPE layersLayer 24: NoPE layersLayer 25: RoPE layersLayer 26: RoPE layersLayer 27: RoPE layersLayer 28: NoPE layersLayer 29: RoPE layersLayer 30: RoPE layersLayer 31: RoPE layersLayer 32: NoPE layersLayer 33: RoPE layersLayer 34: RoPE layersLayer 35: RoPE layersLayer 36: NoPE layersRoPE layers · matches this colour in the execution-order barRoPE layersRoPE layers · 27 repetitions27 layers · one layer shown27RMSNorm before this operation.RMSNormGrouped-query attention: Dense SwiGLU network (hidden size 11008). Attention uses rotary positions.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. Dense SwiGLU network (hidden size 11008). Attention uses rotary positions.RoPEAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormSwiGLU: Dense SwiGLU network (hidden size 11008). Attention uses rotary positions.SwiGLUAdd the branch output to the original stream. +Layer type · execution order aboveNoPE layers · matches this colour in the execution-order barNoPE layersNoPE layers · 9 repetitions9 layers · one layer shown9RMSNorm before this operation.RMSNormGrouped-query attention: Every fourth layer. Same shape, but attention applies no rotary positions.Grouped-queryattentionNo explicit positional embedding in this attention layer. Causal masking still restricts which tokens it can read.NoPEAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormSwiGLU: Every fourth layer. Same shape, but attention applies no rotary positions.SwiGLUAdd the branch output to the original stream. +Layer type · execution order aboveAfter all 36 layer executionsResidual streamLast columnCL2,048Final RMSNormReuses the embedding table, transposed.Tied output weights2,048128,256Vocabulary scoresSoftmax128,256Next-token probabilities
Inside grouped-query attention · RoPE layers
4 query heads per group × 4 K/V groups.

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

SmolLM3 3B: RoPE layers · grouped-query attention16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding. Keys and values for 4 heads, per token per layer, in all 36 layers.4 KV groups; the front face shows one representative.4 KV groups4 heads / group; the front face shows one representative.4 heads / groupAttention input. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input2,048CLWq. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wq2,048128Wk. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wk2,048128Wv. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wv2,048128RoPE. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.RoPERoPE. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.RoPEK cache. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache128CLV cache. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache128CLQ context. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Q context128CLScaled query–key scores, masking and softmax. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.CLCL×. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.×Joined heads. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.16Wo. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wo2,0482,048Attention output. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output2,048CL
Inside grouped-query attention · NoPE layers
4 query heads per group × 4 K/V groups.

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

SmolLM3 3B: NoPE layers · grouped-query attention16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding. Keys and values for 4 heads, per token per layer, in all 36 layers.4 KV groups; the front face shows one representative.4 KV groups4 heads / group; the front face shows one representative.4 heads / groupAttention input. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input2,048CLWq. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wq2,048128Wk. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wk2,048128Wv. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wv2,048128K cache. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache128CLV cache. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache128CLQ context. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Q context128CLScaled query–key scores, masking and softmax. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.NoPECLCL×. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.×Joined heads. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.16Wo. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Wo2,0482,048Attention output. 16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output2,048CL
Model-specific details
RoPE layers · 27 repetitions
Dense SwiGLU network (hidden size 11008). Attention uses rotary positions.
NoPE layers · 9 repetitions
Every fourth layer. Same shape, but attention applies no rotary positions.
Attention and positions
16 query heads share 4 key/value heads. Full attention in every layer. Rotary positions (theta 5,000,000) in most layers; every fourth layer has no position encoding.
Memory
Keys and values for 4 heads, per token per layer, in all 36 layers.

NoPE every fourth layer

Three rotary-attention layers precede each global NoPE layer. Sixteen query heads share four key/value heads, and the tied embedding table contains 128,256 tokens.

Long-context training extends 4K to 32K and then 65,536 tokens. The 131,072-token YaRN setting is an extrapolated window rather than the training length shown in the diagram.

Explore the components

Sources for this map