Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

IBM · Architecture map

Granite-SWASH 3B-A600M

A small mixture of experts where 20 of 28 layers see only the last 128 tokens, and every attention head has a learnable sink.

Granite-SWASH-3B-a600M (base model), July 2026 · Granite release timeline

Inside Granite-SWASH 3B-A600M

Parameters
3.02B · 0.6B active
Layers
28
Width
1,280
Mixer
Grouped-query
Select a component to explore it. Layer colours match the execution-order strip.
The complete Granite-SWASH 3B-A600M architectureInput IDs select embeddings. Layer types execute in the order strip; dotted lines connect the type examples below. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value. Full layers store keys and values for 4 heads of size 64 per token. Sliding-window layers store only the last 128 tokens. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup100,3521,280Input token vectorsCL1,280Execution order · 28 layersLayer 1: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 2: Sliding-window layers (the other 20)Layer 3: Sliding-window layers (the other 20)Layer 4: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 5: Sliding-window layers (the other 20)Layer 6: Sliding-window layers (the other 20)Layer 7: Sliding-window layers (the other 20)Layer 8: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 9: Sliding-window layers (the other 20)Layer 10: Sliding-window layers (the other 20)Layer 11: Sliding-window layers (the other 20)Layer 12: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 13: Sliding-window layers (the other 20)Layer 14: Sliding-window layers (the other 20)Layer 15: Sliding-window layers (the other 20)Layer 16: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 17: Sliding-window layers (the other 20)Layer 18: Sliding-window layers (the other 20)Layer 19: Sliding-window layers (the other 20)Layer 20: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 21: Sliding-window layers (the other 20)Layer 22: Sliding-window layers (the other 20)Layer 23: Sliding-window layers (the other 20)Layer 24: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Layer 25: Sliding-window layers (the other 20)Layer 26: Sliding-window layers (the other 20)Layer 27: Sliding-window layers (the other 20)Layer 28: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28 · matches this colour in the execution-order barFull-attention layers 1, 4, 8, 12, …Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28 · 8 repetitions8 layers · one layer shown8RMSNorm before this operation.RMSNormGrouped-query attention: Attention over the whole sequence, then 48 routed experts (size 512), 4 chosen per token, plus a shared expert of size 1280.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. Attention over the whole sequence, then 48 routed experts (size 512), 4 chosen per token, plus a shared expert of size 1280.RoPE20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Attention sinkAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormMoE: Attention over the whole sequence, then 48 routed experts (size 512), 4 chosen per token, plus a shared expert of size 1280.MoE4 of 48 routed experts selected per token. Highlighted boxes are schematic; boxes do not correspond one-to-one to experts. 1 shared experts run for every token.Add the branch output to the original stream. +4 of 48 experts + 1sharedLayer type · execution order aboveSliding-window layers (the other 20) · matches this colour in the execution-order barSliding-window layers (the other 20)Sliding-window layers (the other 20) · 20 repetitions20 layers · one layer shown20RMSNorm before this operation.RMSNormSliding-window attention: Attention over the last 128 tokens, then the same expert block.Sliding-windowattentionRotate query and key position components before attention scores; values are unchanged. Attention over the last 128 tokens, then the same expert block.RoPESliding-window attention over 128 tokens.12820 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Attention sinkAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormMoE: Attention over the last 128 tokens, then the same expert block.MoE4 of 48 routed experts selected per token. Highlighted boxes are schematic; boxes do not correspond one-to-one to experts. 1 shared experts run for every token.Add the branch output to the original stream. +4 of 48 experts + 1sharedLayer type · execution order aboveAfter all 28 layer executionsResidual streamLast columnCL1,280Final RMSNormReuses the embedding table, transposed.Tied output weights1,280100,352Vocabulary scoresSoftmax100,352Next-token probabilities
Inside grouped-query attention · Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28
5 query heads per group × 4 K/V groups.

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

Granite-SWASH 3B-A600M: Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28 · grouped-query attention20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value. Full layers store keys and values for 4 heads of size 64 per token. Sliding-window layers store only the last 128 tokens.4 KV groups; the front face shows one representative.4 KV groups5 heads / group; the front face shows one representative.5 heads / groupAttention input. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,280CLWq. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wq1,28064Wk. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wk1,28064Wv. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wv1,28064RoPE. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.RoPERoPE. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.RoPEK cache. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache64CLV cache. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache64CLQ context. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Q context64CLScaled query–key scores, masking and softmax. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.SinkCLCL×. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.×Joined heads. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.20Wo. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wo1,2801,280Attention output. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,280CL
Inside grouped-query attention · Sliding-window layers (the other 20)
5 query heads per group × 4 K/V groups.

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

Granite-SWASH 3B-A600M: Sliding-window layers (the other 20) · grouped-query attention20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value. Full layers store keys and values for 4 heads of size 64 per token. Sliding-window layers store only the last 128 tokens.4 KV groups; the front face shows one representative.4 KV groups5 heads / group; the front face shows one representative.5 heads / groupAttention input. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input1,280CLWq. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wq1,28064Wk. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wk1,28064Wv. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wv1,28064RoPE. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.RoPERoPE. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.RoPEK cache. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache64≤ 128V cache. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache64≤ 128Q context. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Q context64CLScaled query–key scores, masking and softmax. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Window 12820 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.SinkCLCL×. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.×Joined heads. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.20Wo. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Wo1,2801,280Attention output. 20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output1,280CL
Model-specific details
Full-attention layers 1, 4, 8, 12, 16, 20, 24 and 28 · 8 repetitions
Attention over the whole sequence, then 48 routed experts (size 512), 4 chosen per token, plus a shared expert of size 1280.
Sliding-window layers (the other 20) · 20 repetitions
Attention over the last 128 tokens, then the same expert block.
Attention and positions
20 query heads share 4 key/value heads of size 64. 20 layers use sliding-window attention over the last 128 tokens; 8 layers (1, 4, 8, 12, 16, 20, 24 and 28) attend to the whole sequence. Every head in every layer has one learnable sink value.
Memory
Full layers store keys and values for 4 heads of size 64 per token. Sliding-window layers store only the last 128 tokens.

Short windows and small experts

This is the July 2026 3B-A600M base checkpoint. The dense 2B SWASH model uses a different feed-forward layout.

Explore the components

Sources for this map