inclusionAI/Ling-3.1-flash-1019 — model analysis

Summary

  • Size: The model consists of about 572 billion numbers (parameters). Its saved files total about 574GB.
  • Structure: A mixture-of-experts (MoE) model that, for each input, selects only 8 of its 512 experts. Of about 572 billion parameters in total, about 24.9 billion are used per computation step. About 96% of the parameters are assigned to the experts, about 2% to the part that reads context (attention), and about 1% to the multi-token prediction part (MTP).
  • Japanese text: In Japanese, one token holds about 1.4 characters. In English, one token holds about 4.2 characters. For the same number of characters, Japanese needs about 3.0 times as many tokens as English. Of its 157,153 vocabulary entries, 51,946 contain kana or kanji.
  • Context length: The limit written in the config (max_position_embeddings) is 262,144 tokens, roughly 360,000 Japanese characters or 1,100,000 English characters at the same ratio as the fixed texts above.
  • Skew in values: Values inside the model flow in groups of 4,096. Positions 433, 472, 1714, 2654, and 3831 were among the positions where outliers (extremely large values) appear most often, in all 72 layers. Positions 433, 472, 1714, 2654, and 3831 also appeared in the tally of positions where normalization-layer weights take extreme values (433: 140, 472: 130, 1714: 145, 2654: 115, 3831: 133 of 145 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, 1,231 of 157,184 rows have a length of 1/1000 of the median or less. Feeding these tokens in gives an almost-zero embedding.

One line: MoE (8 of 512 experts active) · bailing_hybrid · 72 layers · 572.12B params · 24.89B active · mixed (with short convolutions ×63, MLA ×9) · context 262,144 · vocab 157,184

Basic information

Architecture (stage 0)

Parameters by part

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

Parameters by part

Part Parameters Share
Experts 547,608,330,240 95.72%
Attention 13,334,376,384 2.33%
MTP (multi-token prediction) 8,174,197,248 1.43%
Shared experts 1,069,547,520 0.19%
Output head 643,825,664 0.11%
Embedding 643,825,664 0.11%
FFN (dense) 503,316,480 0.09%
Router 142,641,152 0.02%
Normalization 620,416 0.00%

Structure

Values from config.json.

Item Value
model_type / architectures bailing_hybrid / BailingMoeV3ForCausalLM
Layers 72
Hidden size 4,096
FFN intermediate size (intermediate_size) 10,240
Attention type mixed (with short convolutions ×63, MLA ×9)
Heads / KV heads / head dim 64 / 64 / 128
MLA settings q_lora_rank=1536, kv_lora_rank=512, qk_rope_head_dim=64, qk_nope_head_dim=128, v_head_dim=128
Layers by attention build (from tensor names) with short convolutions: 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 70; MLA: 7, 15, 23, 31, 39, 47, 55, 63, 71
Sliding window — (use_sliding_window=—)
Layer types (layer_types) —
RoPE θ 6,000,000
RoPE scaling —
Partial rotary (partial_rotary_factor) 0.5
Context length (max_position_embeddings) 262,144
Tied input/output embeddings No
Activation silu
Normalization ε 1.000e-06

MoE configuration

Expert counts come from both config and tensor names (MTP layers excluded). Active parameters = total − MTP − expert part + expert part × active ÷ experts (computed).

Item Value
Experts (config) 512
Experts counted from tensor names (count: layers) 512:68 layers
Active experts per token 8
Expert intermediate size (moe_intermediate_size) 1,280
Shared experts 1
MoE layers 68
Leading dense layers (first_k_dense_replace) 4
Expert parameters 547.61B
Active parameters 24.89B
MTP parameters (excluded from active) 8.17B

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 157,184 157,184 Yes model.word_embeddings.weight
hidden_size 4,096 4,096 Yes model.word_embeddings.weight
num_hidden_layers 72 72 Yes largest layer index + 1 (excluding MTP layers)
num_key_value_heads×head_dim 8,192 8,192 Yes model.layers.0.attention.k_proj.weight
num_attention_heads×head_dim 8,192 8,192 Yes model.layers.0.attention.q_proj.weight
intermediate_size 10,240 10,240 Yes model.layers.0.mlp.gate_proj.weight
moe_intermediate_size 1,280 1,280 Yes model.layers.4.mlp.experts.0.gate_proj.weight
tie_word_embeddings (no output-head tensor) No No Yes tensor list
num_experts 512 512 Yes tensor names

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 329 1.365 4.088 6.7% Yes
English 1,201 289 4.156 4.253 0.0% Yes

Of 157,153 vocabulary entries, 51,946 (33.05%) contain at least one kana or kanji character and 43,771 contain two or more (loaded with tokenizers).

Special tokens and chat format

252 special tokens. BOS: <|startoftext|>, EOS: <|role_end|>. Chat template: present (6042 characters, sha256 prefix f9beb6cdd406). 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

<|startoftext|>, <|endoftext|>, [CLS], [gMASK], <|role_end|>, <|fim_start|>, <|fim_hole|>, <|fim_end|>, <|reserved_token_14|>, <|reserved_token_15|>, <|reserved_token_16|>, <|reserved_token_17|>, <|reserved_token_18|>, <|reserved_token_19|>, <|reserved_token_20|>, <|reserved_token_21|>, <|reserved_token_22|>, <|reserved_token_23|>, <|reserved_token_24|>, <|reserved_token_25|>, <|reserved_token_26|>, <|reserved_token_27|>, <|reserved_token_28|>, <|reserved_token_29|>, <|reserved_token_30|>, <|reserved_token_31|>, <|reserved_token_32|>, <|reserved_token_33|>, <|reserved_token_34|>, <|reserved_token_35|>, <|reserved_token_36|>, <|reserved_token_37|>, <|reserved_token_38|>, <|reserved_token_39|>, <|reserved_token_40|>, <|reserved_token_41|>, <|reserved_token_42|>, <|reserved_token_43|>, <|reserved_token_44|>, <|reserved_token_45|>, <|reserved_token_46|>, <|reserved_token_47|>, <|reserved_token_48|>, <|reserved_token_49|>, <|reserved_token_50|>, <|reserved_token_51|>, <|reserved_token_52|>, <|reserved_token_53|>, <|reserved_token_54|>, <|reserved_token_55|>, <|reserved_token_56|>, <|reserved_token_57|>, <|reserved_token_58|>, <|reserved_token_59|>, <|reserved_token_60|>, <|reserved_token_61|>, <|reserved_token_62|>, <|reserved_token_63|>, <|reserved_token_64|>, <|reserved_token_65|> …

Weights (stage 1)

Analyzed 107,393 of 214,025 tensors (compute time 11.6 min). Each tensor was converted to fp32 for computation. Tensors excluded from analysis: FP8 scale (not a weight) (106632). The 1,555 tensors of the MTP (multi-token prediction) part (layer 72) were analyzed but kept out of the per-layer trends, outlier channels, normalization-layer dimensions, embedding rows, expert similarity and extremes below, so that only the main layers are counted. Weights stored in FP8 (106,632) were restored to fp32 by multiplying by their 128×128 block scales before 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 545 (model.layers.69.mlp.shared_experts.up_proj.weight), excess kurtosis 21140.553 (model.layers.69.mlp.shared_experts.up_proj.weight), outlier share 0.995% (model.layers.67.attention.v_conv1d.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 72)
433 72
472 72
1714 72
2654 72
3831 72
741 71
3850 71
1823 68
3833 62
1693 48

Normalization-layer weights

For each of the 145 normalization layers whose length equals the hidden size (4,096), the dimensions farthest from the median (top 16) were collected, and the number of normalization layers in which each dimension appeared was counted (measured). The 81 normalization layers of other lengths, such as per-head normalization, were left out because their dimension numbers mean something different.

Dimension Normalization layers it appeared in
1714 145
433 140
741 134
3831 133
472 130
2654 115
3850 110
1823 109
3833 56
3729 55

Dimensions shared with the top 10 outlier channels above: 433, 472, 741, 1714, 1823, 2654, 3831, 3833, 3850.

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
Experts 104448 0.0036 0.2552 0.4198 model.layers.64.mlp.experts.210.up_proj.weight
MTP (multi-token prediction) 1547 0.003 0.0915 0.3203 model.layers.72.mlp.experts.282.down_proj.weight
Attention 495 0.0037 0.0316 0.4086 model.layers.4.attention.f_proj.weight
Shared experts 204 0.0035 0.0728 0.2677 model.layers.69.mlp.shared_experts.down_proj.weight
Router 68 0.0113 0.0128 0.0155 model.layers.36.mlp.gate.weight
FFN (dense) 12 0.0946 0.1071 0.1444 model.layers.0.mlp.gate_proj.weight
Embedding 1 0.0323 0.0323 0.0323 model.word_embeddings.weight
Output head 1 0.0035 0.0035 0.0035 lm_head.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).

model.word_embeddings.weight (157,184 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
8.1801e-06 8.4032e-06 0.1251 0.9371 1.3628 1.499

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

Rows with small norms (158 rows in the bottom 0.1%, the 20 smallest): 126593:'ние'(8.1801e-06), 139755:' וע�'(8.2164e-06), 129351:'�כ�'(8.2182e-06), 153495:'�דה'(8.2288e-06), 129613:' וא�'(8.2299e-06), 142620:' �'(8.2590e-06), 155603:' מגי�'(8.2625e-06), 132941:'liz'(8.2657e-06), 134288:' anno'(8.2829e-06), 150417:' בגי�'(8.2884e-06), 144320:'�נ�'(8.2888e-06), 144360:' שלו�'(8.2917e-06), 163:'�'(8.2920e-06), 149242:'�לו'(8.2939e-06), 127889:'gende'(8.2950e-06), 153378:' למו�'(8.2987e-06), 142926:' יש�'(8.3005e-06), 128962:' lec'(8.3050e-06), 149306:'�ד�'(8.3069e-06), 130731:' הס�'(8.3129e-06)

lm_head.weight (157,184 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
0.5322 0.5332 0.5767 1.6376 2.0138 2.5687

Rows with small norms (158 rows in the bottom 0.1%, the 20 smallest): 156911:'<|reserved_token_16|>'(0.5322), 156912:'<|reserved_token_17|>'(0.5322), 157150:'<|reserved_token_255|>'(0.5323), 156915:'<|reserved_token_20|>'(0.5325), 156916:'<|reserved_token_21|>'(0.5327), 156923:'<|reserved_token_28|>'(0.5327), 156922:'<|reserved_token_27|>'(0.5328), 156941:'<|reserved_token_46|>'(0.5328), 156910:'<|reserved_token_15|>'(0.5328), 156924:'<|reserved_token_29|>'(0.5328), 156921:'<|reserved_token_26|>'(0.5328), 157094:'<|reserved_token_199|>'(0.5328), 156939:'<|reserved_token_44|>'(0.5329), 156929:'<|reserved_token_34|>'(0.5329), 156918:'<|reserved_token_23|>'(0.5329), 156940:'<|reserved_token_45|>'(0.5329), 156934:'<|reserved_token_39|>'(0.5329), 157089:'<|reserved_token_194|>'(0.5329), 157110:'<|reserved_token_215|>'(0.5329), 156993:'<|reserved_token_98|>'(0.5329)

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

For matrices of the same kind in the same layer, the cosine similarity between experts was estimated with a 32×32 random projection (estimated). Mean over all layers: 1.6237e-04.

Expert similarity

Measurement conditions

  • mbscope 0.2.17 (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
  • FP8 (F8_E4M3) weights were restored to fp32 by multiplying by the matching _scale_inv (block scales) before computation
  • 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

Comments

…

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

← All notes