ibm-granite/granite-switch-4.1-8b — model analysis

Summary

  • Size: The model consists of about 8.8 billion numbers (parameters). Its saved files total about 17.6GB.
  • Structure: A dense model that uses all of its parameters except the adapters (below) for every input. About 70% of the parameters are assigned to the part that holds knowledge (FFN), about 20% to the part that reads context (attention), and about 5% to the vocabulary dictionary (embedding). In addition, extra weights that are switched in only when needed (2 LoRA adapters) account for about 396 million (4.5% of the total) and are included in the total above.
  • Japanese text: Japanese is split into about 1.1 units (tokens) per character. In English, one token holds about 4.3 characters. For the same number of characters, Japanese needs about 4.7 times as many tokens as English. Of its 100,355 vocabulary entries, 1,035 contain kana or kanji.
  • Context length: The limit written in the config (max_position_embeddings) is 131,072 tokens, roughly 120,000 Japanese characters or 560,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. Position 1338 was among the positions where outliers (extremely large values) appear most often, in 29 of 40 layers. Position 1338 also appeared in the tally of positions where normalization-layer weights take extreme values (57 of 81 normalization layers). This kind of skew is generally considered a cause of accuracy loss when a model is compressed (quantized).

One line: Dense · granite_switch · 42 layers (40 in the weights) · 8.78B params · GQA (4:1) · context 131,072 · vocab 100,355

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) 6,291,456,000 71.68%
Attention 1,677,721,600 19.12%
Embedding 411,054,080 4.68%
Adapters (LoRA) 395,837,440 4.51%
Normalization 331,776 0.00%
Other 231,427 0.00%

Structure

Values from config.json.

Item Value
model_type / architectures granite_switch / GraniteSwitchForCausalLM
Layers 42
Hidden size 4,096
FFN intermediate size (intermediate_size) 12,800
Attention type GQA (4:1)
Heads / KV heads / head dim 32 / 8 / 128
Adapters (adapter_names / adapter_ranks) guardian-core, decision / 16, 64
Sliding window — (use_sliding_window=—)
Layer types (layer_types) full_attention×42
RoPE θ 10,000,000
RoPE scaling {'rope_theta': 10000000, 'rope_type': 'default'}
Partial rotary (partial_rotary_factor) —
Context length (max_position_embeddings) 131,072
Tied input/output embeddings Yes
Activation silu
Normalization ε 1.000e-05

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 100,355 100,355 Yes model.embed_tokens.weight
hidden_size 4,096 4,096 Yes model.embed_tokens.weight
num_hidden_layers 42 40 No largest layer index + 1 (excluding MTP layers)
(num_attention_heads + num_key_value_heads) × head_dim + num_key_value_heads × v_head_dim 6,144 6,144 Yes model.layers.0.self_attn.qkv_proj.base_layer.weight
intermediate_size×2 (input_linear combines gate and up) 25,600 25,600 Yes model.layers.0.shared_mlp.input_linear.base_layer.weight
tie_word_embeddings (no output-head tensor) Yes Yes Yes tensor list

The layer count in the config (42) differs from the number of layers in the weights (40). The reason cannot be told from the config and the weights. The per-layer figures below count the 40 layers in the weights.

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 496 0.905 2.712 30.0% Yes
English 1,201 282 4.259 4.358 0.0% Yes

Of 100,355 vocabulary entries, 1,035 (1.03%) contain at least one kana or kanji character and 298 contain two or more (loaded with tokenizers).

Special tokens and chat format

87 special tokens. BOS: <|end_of_text|>, EOS: <|end_of_text|>. Chat template: present (10594 characters, sha256 prefix b6c13a0fa8fb). Thinking tags: No, tool calls: Yes, FIM: No, image tokens: No (found by searching special-token names and the template text).

List of special tokens

<|pad|>, <|end_of_text|>, <|start_of_role|>, <|end_of_role|>, <|unused_1|>, <|start_of_plugin|>, <|end_of_plugin|>, <|unk|>, <think_on>, <think_off>, <schema>, </schema>, <tools>, </tools>, <documents>, </documents>, <|unused_15|>, <|unused_16|>, <|unused_17|>, <|unused_18|>, <|unused_19|>, <|unused_20|>, <|unused_21|>, <|unused_22|>, <|unused_23|>, <|unused_24|>, <|unused_25|>, <|unused_26|>, <|unused_27|>, <|unused_28|>, <|unused_29|>, <|unused_30|>, <|unused_31|>, <|unused_32|>, <|unused_33|>, <|unused_34|>, <|unused_35|>, <|unused_36|>, <|unused_37|>, <|unused_38|>, <|unused_39|>, <|unused_40|>, <|unused_41|>, <|unused_42|>, <|unused_43|>, <|unused_44|>, <|unused_45|>, <|unused_46|>, <|unused_47|>, <|unused_48|>, <|unused_49|>, <|unused_50|>, <|unused_51|>, <|unused_52|>, <|unused_53|>, <|unused_54|>, <|unused_55|>, <|unused_56|>, <|unused_57|>, <|unused_58|> …

Weights (stage 1)

Analyzed 803 of 804 tensors (compute time 9 s). Each tensor was converted to fp32 for computation. Tensors excluded from analysis: not floating point (1). The 560 LoRA adapter tensors were analyzed but are not main-model weights (they are extra weights switched in when needed), so they were kept out of the per-layer trends, outlier channels and extremes below.

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 77.662 (model.layers.5.self_attn.qkv_proj.base_layer.weight), excess kurtosis 8.309 (model.layers.10.self_attn.o_proj.base_layer.weight), outlier share 0.095% (model.layers.0.self_attn.qkv_proj.base_layer.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 40)
1338 29
298 28
3899 28
1891 27
3811 25
2720 24
1677 23
1158 21
1634 21
2632 21

Normalization-layer weights

For each of the 81 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).

Dimension Normalization layers it appeared in
1338 57
298 51
4089 48
1432 44
3300 42
990 39
3982 38
1742 34
2609 34
873 33

Dimensions shared with the top 10 outlier channels above: 298, 1338.

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 80 0.0015 0.044 0.0808 model.layers.0.self_attn.qkv_proj.base_layer.weight
FFN (dense) 80 0.0112 0.0723 0.2181 model.layers.3.shared_mlp.input_linear.base_layer.weight
Embedding 1 0.0068 0.0068 0.0068 model.embed_tokens.weight
Other 1 1 1 1 model.switch.codebook

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.embed_tokens.weight (100,355 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
1.435 1.4525 2.1704 2.7826 3.2461 4.6288

Rows with small norms (101 rows in the bottom 0.1%, the 20 smallest): 48077:'.dataGridViewTextBoxColumn'(1.435), 81325:'.bindingNavigatorMove'(1.4429), 81259:'artisanlib'(1.4466), 47073:'webElementXpaths'(1.4488), 96334:'.bunifuFlatButton'(1.4514), 93905:' QtAws'(1.4517), 46705:'.bindingNavigator'(1.452), 178:'�'(1.452), 80369:' ForCanBeConverted'(1.4521), 83315:'richTextPanel'(1.4521), 187:'�'(1.4521), 100349:'<|unused_80|>'(1.4522), 100296:'<|unused_27|>'(1.4522), 100304:'<|unused_35|>'(1.4522), 100330:'<|unused_61|>'(1.4522), 185:'�'(1.4522), 100346:'<|unused_77|>'(1.4522), 89472:'useRalative'(1.4522), 100335:'<|unused_66|>'(1.4522), 100268:'<|end_of_plugin|>'(1.4522)

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