Jamba v0.1
AI21 Labs · Jamba · open weights
- GQA
- Mamba (SSM)
- Hybrid
- NoPE layers
- Pre-norm
- MoE
Facts and where they come from
| Released | 2024-03 | config.jsonconfig.jsonHugging Face repository creation date (api.createdAt) |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 52B | labmodel cardREADME: 12B active parameters and a total of 52B parameters |
| Active parameters | 12B | labmodel cardREADME: 12B active |
| Context length | 256K tokens | config.jsonconfig.jsonmax_position_embeddings |
| Norm placement | pre | codemodelling codetransformers 5.18.0 / repo modelling code for jamba: input_layernorm before attention, post_attention_layernorm before the MLP |
| Norm type | RMSNorm | codemodelling codetransformers 5.18.0 / repo modelling code for jamba: input_layernorm before attention, post_attention_layernorm before the MLP |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | none; attention layers have no positional encoding; the Mamba layers carry order | paperarXiv 2403.19887Jamba paper (arXiv 2403.19887) §2: no explicit positional information |
| Parallel attention and MLP | no | codemodelling codetransformers 5.18.0 / repo modelling code for jamba: input_layernorm before attention, post_attention_layernorm before the MLP |
Architecture, drawn from the data
28× Mamba + 4× GQA 32q/8kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 51.6B |
|---|---|
| Active per token (modelled) | 12.1B |
| Without embeddings and output head | 51B total, 11.6B active |
| Published weights (Hugging Face count) | 51.6B |
| KV cache per token, BF16 (layers that grow with context) | 16 KiB |
| KV cache + state at 256K tokens, BF16 | 4.01 GiB |
| Decode FLOPs per token at 4K context | 24 GFLOP |
| Prefill FLOPs for a 4K prompt | 95.4 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 4,096 | config.jsonconfig.jsonhidden_size |
| vocab | 65,536 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | config.jsonconfig.jsontie_word_embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 32 | config.jsonconfig.jsonnum_attention_heads |
| mixers.full.kv_heads | 8 | config.jsonconfig.jsonnum_key_value_heads |
| mixers.full.head_dim | 128 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / num_attention_heads |
| mixers.mamba.type | mamba1 | codemodelling codeMamba (selective SSM) |
| mixers.mamba.d_inner | 8,192 | codemodelling codemamba_expand x hidden_size |
| mixers.mamba.state | 16 | config.jsonconfig.jsonmamba_d_state |
| mixers.mamba.conv_kernel | 4 | config.jsonconfig.jsonmamba_d_conv |
| mixers.mamba.dt_rank | 256 | codemodelling codemamba_dt_rank: auto = ceil(hidden_size / 16) |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 14,336 | config.jsonconfig.jsonintermediate_size |
| ffns.dense.gated | true | codemodelling codeMLP: gated (SwiGLU/GeGLU) |
| ffns.moe.type | moe | codemodelling codeMoE block |
| ffns.moe.experts | 16 | config.jsonconfig.jsonnum_experts |
| ffns.moe.active | 2 | config.jsonconfig.jsonnum_experts_per_tok |
| ffns.moe.d_expert | 14,336 | config.jsonconfig.jsonintermediate_size |
| ffns.moe.gated | true | codemodelling codeexperts are gated MLPs |
| layout | 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× full/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× full/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× full/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe · 1× full/dense · 1× mamba/moe · 1× mamba/dense · 1× mamba/moe | config.jsonconfig.jsonattn_layer_period/offset, expert_layer_period/offset |
Sources
- config.json @ 9efd115
- model card
- arXiv 2403.19887
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision