The Rabbit Hole / AI / Model architectures
AI21 Labs · Architecture mapJamba v0.1
One attention layer for every eight, the rest Mamba, with a mixture-of-experts feed-forward in every other layer.
Jamba v0.1, March 2024 · Jamba release timeline
Inside Jamba v0.1
Inside grouped-query attention · Attention layers with a dense feed-forward
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Model-specific details
- Mamba layers with a dense feed-forward · 12 repetitions
- Even-numbered layers (counting from 0) that are not attention. Mamba mixer, then a dense network (hidden size 14336).
- Mamba layers with experts · 16 repetitions
- Odd-numbered layers (counting from 0). Mamba mixer, then 16 experts with 2 chosen per token (hidden size 14336).
- Attention layers with a dense feed-forward · 4 repetitions
- Layers 4, 12, 20 and 28 (counting from 0), one in every 8. Attention, then a dense network.
- Attention and positions
- Attention in 4 of 32 layers (32 query heads, 8 key/value heads). The other 28 layers are Mamba state-space layers. The config has no rotary or position settings.
- Memory
- Keys and values for 8 heads of size 128 in the 4 attention layers only. The 28 Mamba layers keep a fixed-size state (state size 16).
Two overlapping layer patterns
Attention appears at layers 5, 13, 21 and 29; the other 28 layers use Mamba. Expert networks occupy every second layer, selecting two of 16 experts, while the remaining layers use dense networks.
The Mamba blocks use state size 16, expansion factor two and convolution width four. No explicit positional embeddings are applied.
This is the March 2024 v0.1 base checkpoint, with a supported context of 262,144 tokens.
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
- Mamba: letting each token control what the state keeps
- Hybrid attention and SSM models: different kinds of memory
- Mixture of experts (MoE): a big model that uses only part of itself
- Grouped-query attention (GQA): sharing keys and values in groups
- NoPE: attention with no position information at all
- Neural network layers: more inputs, more neurons
- Routing: selecting experts and weighting their work
- Attention, from scratch
- The KV cache: why LLMs remember every key and value