llm-architectures-explained

/models

Nanbeige4.1 3B

BOSS Zhipin · Nanbeige · open weights

Facts and where they come from

Released2026-02config.jsonconfig.jsonHugging Face repository creation date (api.createdAt)
Licenceapache-2.0config.jsonconfig.jsonREADME metadata: license
Total parameters3Blabmodel cardmodel name Nanbeige4.1-3B
Active parametersnot disclosednot disclosed
Context length256K tokensconfig.jsonconfig.jsonmax_position_embeddings
Norm placementprecodemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP
Norm typeRMSNormcodemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP
QK-normnocodemodelling codeno q/k normalisation in the attention block
Positional encodingRoPEcodemodelling coderotary on the full head (default)
Parallel attention and MLPnocodemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP

Architecture, drawn from the data

GQA 20q/4kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.

Nanbeige4.1 3B: layer stack and blockslayers (32)mixer / FFNlayer 0: GQA: 20 query / 4 KV heads · head 128layer 0: Gated MLP: 10496layer 1: GQA: 20 query / 4 KV heads · head 128layer 1: Gated MLP: 10496layer 2: GQA: 20 query / 4 KV heads · head 128layer 2: Gated MLP: 10496layer 3: GQA: 20 query / 4 KV heads · head 128layer 3: Gated MLP: 10496layer 4: GQA: 20 query / 4 KV heads · head 128layer 4: Gated MLP: 10496layer 5: GQA: 20 query / 4 KV heads · head 128layer 5: Gated MLP: 10496layer 6: GQA: 20 query / 4 KV heads · head 128layer 6: Gated MLP: 10496layer 7: GQA: 20 query / 4 KV heads · head 128layer 7: Gated MLP: 10496layer 8: GQA: 20 query / 4 KV heads · head 128layer 8: Gated MLP: 10496layer 9: GQA: 20 query / 4 KV heads · head 128layer 9: Gated MLP: 10496layer 10: GQA: 20 query / 4 KV heads · head 128layer 10: Gated MLP: 10496layer 11: GQA: 20 query / 4 KV heads · head 128layer 11: Gated MLP: 10496layer 12: GQA: 20 query / 4 KV heads · head 128layer 12: Gated MLP: 10496layer 13: GQA: 20 query / 4 KV heads · head 128layer 13: Gated MLP: 10496layer 14: GQA: 20 query / 4 KV heads · head 128layer 14: Gated MLP: 10496layer 15: GQA: 20 query / 4 KV heads · head 128layer 15: Gated MLP: 10496layer 16: GQA: 20 query / 4 KV heads · head 128layer 16: Gated MLP: 10496layer 17: GQA: 20 query / 4 KV heads · head 128layer 17: Gated MLP: 10496layer 18: GQA: 20 query / 4 KV heads · head 128layer 18: Gated MLP: 10496layer 19: GQA: 20 query / 4 KV heads · head 128layer 19: Gated MLP: 10496layer 20: GQA: 20 query / 4 KV heads · head 128layer 20: Gated MLP: 10496layer 21: GQA: 20 query / 4 KV heads · head 128layer 21: Gated MLP: 10496layer 22: GQA: 20 query / 4 KV heads · head 128layer 22: Gated MLP: 10496layer 23: GQA: 20 query / 4 KV heads · head 128layer 23: Gated MLP: 10496layer 24: GQA: 20 query / 4 KV heads · head 128layer 24: Gated MLP: 10496layer 25: GQA: 20 query / 4 KV heads · head 128layer 25: Gated MLP: 10496layer 26: GQA: 20 query / 4 KV heads · head 128layer 26: Gated MLP: 10496layer 27: GQA: 20 query / 4 KV heads · head 128layer 27: Gated MLP: 10496layer 28: GQA: 20 query / 4 KV heads · head 128layer 28: Gated MLP: 10496layer 29: GQA: 20 query / 4 KV heads · head 128layer 29: Gated MLP: 10496layer 30: GQA: 20 query / 4 KV heads · head 128layer 30: Gated MLP: 10496layer 31: GQA: 20 query / 4 KV heads · head 128layer 31: Gated MLP: 1049601631× 32normGQA: 20 query / 4 KV heads · head 128+normGated MLP: 10496+full attentiondense FFN

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)3.93B
Active per token (modelled)3.93B
Without embeddings and output head3.08B total, 3.08B active
Published weights (Hugging Face count)3.93B
KV cache per token, BF16 (layers that grow with context)64 KiB
KV cache + state at 256K tokens, BF1616 GiB
Decode FLOPs per token at 4K context8.36 GFLOP
Prefill FLOPs for a 4K prompt28 TFLOP

KV cache against context

Nanbeige4.1 3B: KV cache bytes against context length101001,00010,000100,000980 KiB9.5 MiB95 MiB950 MiB9.3 GiBcontext (tokens)KV cache + state (BF16)Nanbeige4.1 3B

Compare with other models →

Every architecture field

FieldValueSource
d_model2,560config.jsonconfig.jsonhidden_size
vocab166,144config.jsonconfig.jsonvocab_size
tied_embeddingsfalseconfig.jsonconfig.jsontie_word_embeddings
mixers.full.typeattncodemodelling codeattention block
mixers.full.heads20config.jsonconfig.jsonnum_attention_heads
mixers.full.kv_heads4config.jsonconfig.jsonnum_key_value_heads
mixers.full.head_dim128config.jsonconfig.jsonhead_dim
ffns.dense.typedensecodemodelling codeMLP block
ffns.dense.d_ff10,496config.jsonconfig.jsonintermediate_size
ffns.dense.gatedtruecodemodelling codeMLP: gated (SwiGLU/GeGLU)
layout32× full/denseconfig.jsonconfig.jsonnum_hidden_layers

Sources

Listed in the LLM Architecture Gallery checklist as “Nanbeige 4.1 (3B)” (name only; see about).