Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Allen Institute for AI · Architecture map

OLMoE 1B-7B

A small, fully open mixture-of-experts model: 64 experts per layer, 8 chosen per token, and ordinary multi-head attention.

OLMoE-1B-7B-0924, September 2024 · OLMo release timeline

Inside OLMoE 1B-7B

Parameters
7B · 1B active
Layers
16
Width
2,048
Mixer
Multi-head
Select a component to explore it.
The complete OLMoE 1B-7B architectureInput IDs select embeddings. Each layer adds its updates along the residual stream. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores. Keys and values for all 16 heads, per token per layer. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup50,3042,048Input token vectorsCL2,048Transformer layers 1–16Transformer layers 1–16 · 16 repetitions16 layers · one layer shown16RMSNorm before this operation.RMSNormMulti-head attention: 64 experts per layer, 8 selected per token, each expert with a hidden size of 1024. No dense layers and no shared expert in the config.Multi-headattentionRotate query and key position components before attention scores; values are unchanged. 64 experts per layer, 8 selected per token, each expert with a hidden size of 1024. No dense layers and no shared expert in the config.RoPENormalise queries and keys before attention scores. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.QK-normAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormMoE: 64 experts per layer, 8 selected per token, each expert with a hidden size of 1024. No dense layers and no shared expert in the config.MoE8 of 64 routed experts selected per token. Highlighted boxes are schematic; boxes do not correspond one-to-one to experts.Add the branch output to the original stream. +8 of 64 expertsResidual streamLast columnCL2,048Final RMSNormA separate learned vocabulary projection.Output weights2,04850,304Vocabulary scoresSoftmax50,304Next-token probabilities
Inside multi-head attention · Transformer layers 1–16
16 heads.

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

OLMoE 1B-7B: Transformer layers 1–16 · multi-head attention16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores. Keys and values for all 16 heads, per token per layer.16 heads; the front face shows one representative.16 headsAttention input. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input2,048CLWq. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Wq2,0482,048Wk. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Wk2,0482,048Wv. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Wv2,0482,048RMSNorm. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.RMSNorm2,048RoPE. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.RoPERMSNorm. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.RMSNorm2,048RoPE. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.RoPEK cache. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache128CLV cache. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache128CLQ context. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Earlier context is dimmed; outlined columns are current.Current token computation.Q context128CLScaled query–key scores, masking and softmax. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.CLCL×. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.×Joined heads. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.16Wo. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Wo2,0482,048Attention output. 16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output2,048CL
Model-specific details
Transformer layers 1–16 · 16 repetitions
64 experts per layer, 8 selected per token, each expert with a hidden size of 1024. No dense layers and no shared expert in the config.
Attention and positions
16 query heads and 16 key/value heads, so no sharing. Causal attention with rotary positions (theta 10,000). Queries and keys are normalised over their full width before the attention scores.
Memory
Keys and values for all 16 heads, per token per layer.

Small experts in every layer

All 16 layers select eight of 64 experts, each of intermediate width 1,024, with no shared expert. About 1B of the 7B parameters are active per token.

Attention is full multi-head with 16 key/value heads and whole-vector QK-norm. Router weights use softmax over all experts without renormalising the selected eight.

The September 2024 checkpoint uses a 4,096-token context.

Explore the components

Sources for this map