The Rabbit Hole / AI / Model architectures
xAI · Architecture mapGrok-2.5
A larger Grok-1 style stack where every MoE layer also has a dense branch, and attention, router and output logits are all soft-capped.
Grok 2 weights on Hugging Face (called Grok 2.5), August 2025 · Grok release timeline
Inside Grok-2.5
Inside grouped-query attention · Transformer layers 1–64
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Model-specific details
- Transformer layers 1–64 · 64 repetitions
- 8 experts of 16,384 wide with a GELU gate, 2 selected per token, beside a dense network of 32,768 (`residual_moe` is true). Both read the same normalised input; their outputs are added and divided by the square root of 2. Attention is global in every layer.
- Attention and positions
- 64 query heads share 8 key/value heads, each 128 wide. Attention logits are soft-capped at 30. The config shows a context of 131,072 positions with rope scaling from an original 8,192 (factor 16).
- Memory
- 8 keys and 8 values of 128 values per token per layer.
Dense and expert paths together
Each layer combines a dense network of width 32,768 with two selected experts out of eight, each of width 16,384. Their outputs are added, divided by the square root of two and normalised before the residual update.
- RMSNorm acts before and after both sublayers.
- Soft-caps: attention 30, router 30, output logits 50.
- Rotary scaling extends 8,192 positions by a factor of 16 to 131,072.
These are the Grok 2 weights released as Grok 2.5 in August 2025.
Explore the components
- Embeddings: giving every token a meaning
- Residual connections: when more layers made things worse
- A whole LLM, layer by layer
- RMSNorm: keeping a token's scale under control
- Mixture of experts (MoE): a big model that uses only part of itself
- Routing: selecting experts and weighting their work
- Grouped-query attention (GQA): sharing keys and values in groups
- QK normalisation (QK-Norm) and soft-capping
- RoPE scaling: stretching context beyond the training length
- RoPE: position as a rotation
- Scaling multipliers: fixed constants on embeddings, branches and logitscoming soonFixed constants multiplying embeddings, branches and outputs, chosen so training settings carry over between sizes.
- Attention, from scratch
- The KV cache: why LLMs remember every key and value