openbmb/MiniCPM5-2B — model analysis

Summary

  • Size: The model consists of about 2.5 billion numbers (parameters). Its saved files total about 5.03GB.
  • Structure: A dense model that uses all of its parameters for every input. About 60% of the parameters are assigned to the part that holds knowledge (FFN), about 20% to the part that reads context (attention), about 10% to the output head, and about 10% to the vocabulary dictionary (embedding).
  • Japanese text: In Japanese, one token holds about 1.5 characters. In English, one token holds about 4.4 characters. For the same number of characters, Japanese needs about 2.9 times as many tokens as English. Of its 130,560 vocabulary entries, 27,885 contain kana or kanji.
  • Context length: The limit written in the config (max_position_embeddings) is 131,072 tokens, roughly 190,000 Japanese characters or 570,000 English characters at the same ratio as the fixed texts above.
  • Skew in values: Values inside the model flow in groups of 2,048. Position 1014 was among the positions where outliers (extremely large values) appear most often, in 41 of 42 layers. Position 1014 also appeared in the tally of positions where normalization-layer weights take extreme values (48 of 85 normalization layers). This kind of skew is generally considered a cause of accuracy loss when a model is compressed (quantized).
  • Nearly unused tokens: In the input embedding, 938 of 130,560 rows have a length of 1/1000 of the median or less (668 of them exactly 0). Feeding these tokens in gives an almost-zero embedding.

One line: Dense · llama · 42 layers · 2.52B params · GQA (8:1) · context 131,072 · vocab 130,560

Basic information

Architecture (stage 0)

Parameters by part

Counted from the tensor shapes in the safetensors headers (measured).

Parameters by part

Part Parameters Share
FFN (dense) 1,585,446,912 63.00%
Attention 396,361,728 15.75%
Output head 267,386,880 10.62%
Embedding 267,386,880 10.62%
Normalization 174,080 0.01%

Structure

Values from config.json.

Item Value
model_type / architectures llama / LlamaForCausalLM
Layers 42
Hidden size 2,048
FFN intermediate size (intermediate_size) 6,144
Attention type GQA (8:1)
Heads / KV heads / head dim 16 / 2 / 128
Sliding window — (use_sliding_window=—)
Layer types (layer_types) —
RoPE θ 5,000,000
RoPE scaling —
Partial rotary (partial_rotary_factor) —
Context length (max_position_embeddings) 131,072
Tied input/output embeddings No
Activation silu
Normalization ε 1.000e-06

MoE configuration

Not applicable (not an MoE model).

config vs. actual tensors

Values in config.json side by side with the actual tensor shapes (measured).

Item config Actual Match Source of actual
vocab_size 130,560 130,560 Yes model.embed_tokens.weight
hidden_size 2,048 2,048 Yes model.embed_tokens.weight
num_hidden_layers 42 42 Yes largest layer index + 1 (excluding MTP layers)
num_key_value_heads×head_dim 256 256 Yes model.layers.0.self_attn.k_proj.weight
num_attention_heads×head_dim 2,048 2,048 Yes model.layers.0.self_attn.q_proj.weight
intermediate_size 6,144 6,144 Yes model.layers.0.mlp.gate_proj.weight
tie_word_embeddings (no output-head tensor) No No Yes tensor list

Tokenizer

Results of tokenizing the fixed Japanese and English texts (see conditions) without special tokens (measured). "Tokens splitting a character" is the share of tokens that decode to a broken character (U+FFFD) on their own.

Text Characters Tokens Chars/token Bytes/token Tokens splitting a character Round-trips exactly
Japanese 449 302 1.487 4.454 6.6% Yes
English 1,201 274 4.383 4.485 0.0% Yes

Of 130,560 vocabulary entries, 27,885 (21.36%) contain at least one kana or kanji character and 21,768 contain two or more (loaded with tokenizers).

Special tokens and chat format

30 special tokens. BOS: <s>, EOS: </s>. Chat template: present (5435 characters, sha256 prefix bc1f78ef8a86). Thinking tags: Yes, tool calls: Yes, FIM: Yes, image tokens: No (found by searching special-token names and the template text).

List of special tokens

<s>, </s>, <tool_call>, </tool_call>, <|im_sep|>, <|fim_prefix|>, <|fim_middle|>, <|fim_suffix|>, <tool_response>, </tool_response>, <tools>, </tools>, <arguments>, </arguments>, <parameters>, </parameters>, <function, </function>, <param, </param>, <|im_start|>, <|im_end|>, <unk>, <|thought_begin|>, <|thought_end|>, <|tool_call|>, <|execute_start|>, <|execute_end|>, /think, /no_think

Weights (stage 1)

Analyzed 381 of 381 tensors (compute time 3 s). Each tensor was converted to fp32 for computation.

Trends across layers

RMS is the root mean square of the elements. max|w| ÷ RMS is how many times larger the largest element is than a typical one. Excess kurtosis measures tail heaviness and is 0 for a normal distribution (all measured). The figures use weights with 2 or more dimensions (matrices) only; 1-D biases and similar are left out.

RMS

max|w| ÷ RMS

Excess kurtosis

Matrices with the largest values (main-model weights with 2 or more dimensions): max|w| ÷ RMS 113.274 (model.layers.40.mlp.gate_proj.weight), excess kurtosis 195.498 (model.layers.0.self_attn.k_proj.weight), outlier share 0.380% (model.layers.0.self_attn.k_proj.weight).

Outliers and outlier channels

An outlier is an element exceeding 6 times the standard deviation of its matrix. For each matrix that takes the hidden dimension as input, the columns with the most outliers (top 16) were collected, and the number of layers in which each column appeared was counted (measured).

Hidden-dimension column Layers it appeared in (of 42)
1014 41
570 40
1592 40
871 39
1830 39
106 36
449 32
1334 32
1752 31
236 30

Normalization-layer weights

For each of the 85 normalization layers whose length equals the hidden size (2,048), the dimensions farthest from the median (top 16) were collected, and the number of normalization layers in which each dimension appeared was counted (measured).

Dimension Normalization layers it appeared in
106 64
1592 53
871 50
1014 48
570 45
1830 44
1334 37
1625 37
1662 35
1108 33

Dimensions shared with the top 10 outlier channels above: 106, 570, 871, 1014, 1334, 1592, 1830.

Effective rank

Stable rank = (Frobenius norm)² ÷ (largest singular value)², divided by the matrix's shorter side to scale it to 0–1. The largest singular value is approximated by power iteration (30 steps) (estimated).

Effective rank

Stable rank ÷ shorter side by part:

Part Matrices Min Median Max Matrix with the minimum
Attention 168 0.004 0.1485 0.6382 model.layers.0.self_attn.q_proj.weight
FFN (dense) 126 0.0344 0.123 0.2846 model.layers.17.mlp.down_proj.weight
Output head 1 0.0051 0.0051 0.0051 lm_head.weight
Embedding 1 0.0363 0.0363 0.0363 model.embed_tokens.weight

Embedding rows

Distribution of the length (norm) of each vocabulary entry's embedding row, and the rows with the smallest norms (bottom 0.1%) (measured).

lm_head.weight (130,560 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
0.378 0.3846 0.3894 0.6871 0.9336 1.2743

Rows with small norms (131 rows in the bottom 0.1%, the 20 smallest): 94143:'MDAwMDAwMS'(0.378), 109868:'NjEyMzU'(0.3794), 65560:'CgogICAgICAgICAgICB'(0.3797), 115969:'MDAwMDAwMi'(0.38), 119944:'LCAyOS'(0.3802), 100873:'LCAzOC'(0.3806), 95118:'ICQoYD'(0.3807), 95628:'BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED'(0.3808), 12779:'sIFst'(0.3808), 128387:'ICAgICAgICAKICAgICAgICAgICAg'(0.3809), 84852:'sIFstOD'(0.381), 104748:'LCAzNi'(0.3811), 110596:'LCAtNi'(0.3812), 48952:'VdLCBbLT'(0.3813), 48062:'RdLCBbLT'(0.3814), 55605:')"],[.'(0.3815), 48824:'ZdLCBbLT'(0.3816), 78282:'CiAgICAgICAgICAgICAgICBwb'(0.3816), 56543:'BgwYMGDAgAEDBgwYMGDAgAED'(0.3816), 62803:'ddLCBbLT'(0.3816)

model.embed_tokens.weight (130,560 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
0 0 0.061 0.8139 0.8974 1.0925

Rows of length exactly 0: 668. Rows of length 1/1000 of the median or less (including the zero rows): 938.

Rows with small norms (131 rows in the bottom 0.1%, the 20 smallest): 46173:'ICApLmFkZFRvKG'(0), 50498:'PSBMLmNpcmNs'(0), 56882:'aDogMTAwLjAlOy'(0), 66516:'dLCBbNDAu'(0), 61398:'sIFstNzAu'(0), 72646:'RkIiwKICA'(0), 51209:' ImgsSat'(0), 72578:'WAEBMYAEAxAQWAEBMYAEAxAQ'(0), 57659:'sIFsxMj'(0), 75049:'YAAAxg'(0), 49895:'ZpbGxSdWxlIjogImV'(0), 67098:'BBYAQExgAQDEBBYAQExgAQDE'(0), 70886:'wKICAiZmlsbCI'(0), 56297:'YmluZFBvcHVwKHBvcHV'(0), 76311:'CiAgImZpbGxSdWxlIjogImV'(0), 55930:'ogMTAwLjAlOyI'(0), 73132:'hPZmZzZXQiOiBudWxsLAogICJmaWxs'(0), 56181:'PSBMLnBvcHVwK'(0), 73206:'IDMKfQogICAgICAgICAgICAgICAg'(0), 33399:'LCAiZmlsb'(0)

Rows of length 0 or nearly 0 hold almost no values for their token. They are likely tokens that were barely used in training or rows that were set to 0 on purpose, but this analysis cannot tell which. For longer rows, a small norm does not mean that the token is unimportant or untrained.

Similarity between experts

Not applicable (not an MoE model).

Measurement conditions

  • mbscope 0.2.15 (result schema v1), Python 3.14.4, torch 2.13.0+cu130, safetensors 0.8.0, huggingface_hub 0.36.2, tokenizers 0.21.4, transformers 4.49.0
  • Estimation criteria: outlier_sigma=6.0, embed_low_pct=0.1, power_iters=30, sketch_dim=32, top_channels=16, seed=20261002
  • Input texts: ja: Natsume Sōseki, I Am a Cat, opening (Aozora Bunko 789_ruby_5639; source: Natsume Sōseki Zenshū 1, Chikuma Bunko), sha256 prefix 5d6b40f79b6a / en: Jane Austen, Pride and Prejudice, opening of Chapter 1 (Project Gutenberg eBook #1342), sha256 prefix 0a714a270435
  • Computed on GPU NVIDIA GeForce RTX 3090 (CUDA 13.0, TF32 off) in fp32
  • Measured with mbscope 0.2.13. The measurements were re-aggregated with mbscope 0.2.15 without re-measuring

Comments

…

Comments are public. Please don't include personal information. Inappropriate comments may be removed.

← All notes