Nanbeige4.2 3B
BOSS Zhipin · Nanbeige · open weights
- GQA
- RoPE
- Pre-norm
- QK-norm
- Looped
Facts and where they come from
| Released | 2026-07 | config.jsonconfig.jsonHugging Face repository creation date (api.createdAt) |
|---|---|---|
| Licence | apache-2.0 | config.jsonconfig.jsonREADME metadata: license |
| Total parameters | 4B | labmodel cardREADME comparison table: Total Params 4B |
| Active parameters | not disclosed | not disclosed |
| Context length | 256K tokens | labmodel cardREADME: up to 262,144 tokens |
| Norm placement | pre | codemodelling codetransformers 5.18.0 / repo modelling code for nanbeige: input_layernorm before attention, post_attention_layernorm before the MLP |
| Norm type | RMSNorm | codemodelling codetransformers 5.18.0 / repo modelling code for nanbeige: input_layernorm before attention, post_attention_layernorm before the MLP |
| QK-norm | yes | codemodelling coderepo modeling_nanbeige.py: q_norm and k_norm |
| Positional encoding | RoPE | codemodelling coderotary on the full head (default) |
| Parallel attention and MLP | no | codemodelling codetransformers 5.18.0 / repo modelling code for nanbeige: input_layernorm before attention, post_attention_layernorm before the MLP |
Architecture, drawn from the data
GQA 48q/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) | 4.17B |
|---|---|
| Active per token (modelled) | 4.17B |
| Without embeddings and output head | 3.15B total, 3.15B active |
| Published weights (Hugging Face count) | 4.17B |
| KV cache per token, BF16 (layers that grow with context) | 88 KiB |
| KV cache + state at 256K tokens, BF16 | 22 GiB |
| Decode FLOPs per token at 4K context | 18 GFLOP |
| Prefill FLOPs for a 4K prompt | 60.7 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 3,072 | config.jsonconfig.jsonhidden_size |
| vocab | 166,144 | config.jsonconfig.jsonvocab_size |
| tied_embeddings | false | config.jsonconfig.jsontie_word_embeddings |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 48 | config.jsonconfig.jsonnum_attention_heads |
| mixers.full.kv_heads | 8 | config.jsonconfig.jsonnum_key_value_heads |
| mixers.full.head_dim | 128 | config.jsonconfig.jsonhead_dim |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 10,752 | config.jsonconfig.jsonintermediate_size |
| ffns.dense.gated | true | codemodelling codeMLP: gated (SwiGLU/GeGLU) |
| layout | 22× full/dense | config.jsonconfig.jsonnum_hidden_layers |
| loops | 2 | config.jsonconfig.jsonnum_loops |
Sources
- config.json @ b82e54b
- model card
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision
Listed in the LLM Architecture Gallery checklist as “Nanbeige 4.2 (3B)” (name only; see about).