ibm-granite/granite-switch-4.1-30b — model analysis
Summary
- Size: The model consists of about 30 billion numbers (parameters). Its saved files total about 60GB.
- Structure: A dense model that uses all of its parameters except the adapters (below) for every input. About 90% of the parameters are assigned to the part that holds knowledge (FFN), about 9% to the part that reads context (attention), and about 1% to the vocabulary dictionary (embedding). In addition, extra weights that are switched in only when needed (2 LoRA adapters) account for about 1.1 billion (3.7% 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 2692 was among the positions where outliers (extremely large values) appear most often, in 57 of 64 layers. Position 2692 also appeared in the tally of positions where normalization-layer weights take extreme values (71 of 129 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 · 66 layers (64 in the weights) · 29.99B params · GQA (4:1) · context 131,072 · vocab 100,355
Basic information
- Model: ibm-granite/granite-switch-4.1-30b (revision
70b75c6fd254, config.json) - License: apache-2.0
- Declared base_model: none
- Storage dtypes: BF16 29.99B, F32 131.07K, I64 100.36K
Architecture (stage 0)
Parameters by part
Counted from the tensor shapes in the safetensors headers (measured).
| Part | Parameters | Share |
|---|---|---|
| FFN (dense) | 25,769,803,776 | 85.93% |
| Attention | 2,684,354,560 | 8.95% |
| Adapters (LoRA) | 1,124,073,472 | 3.75% |
| Embedding | 411,054,080 | 1.37% |
| Normalization | 528,384 | 0.00% |
| Other | 231,427 | 0.00% |
Structure
Values from config.json.
| Item | Value |
|---|---|
| model_type / architectures | granite_switch / GraniteSwitchForCausalLM |
| Layers | 66 |
| Hidden size | 4,096 |
| FFN intermediate size (intermediate_size) | 32,768 |
| 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×66 |
| RoPE θ | 50,000,000 |
| RoPE scaling | {'rope_theta': 50000000, '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 | 66 | 64 | 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) | 65,536 | 65,536 | 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 (66) differs from the number of layers in the weights (64). The reason cannot be told from the config and the weights. The per-layer figures below count the 64 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 1,283 of 1,284 tensors (compute time 28 s). Each tensor was converted to fp32 for computation. Tensors excluded from analysis: not floating point (1). The 896 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.
Matrices with the largest values (main-model weights with 2 or more dimensions): max|w| ÷ RMS 132.15 (model.layers.1.shared_mlp.output_linear.base_layer.weight), excess kurtosis 48.794 (model.layers.1.shared_mlp.output_linear.base_layer.weight), outlier share 0.262% (model.layers.4.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 64) |
|---|---|
| 2692 | 57 |
| 1828 | 52 |
| 101 | 49 |
| 82 | 47 |
| 781 | 45 |
| 3156 | 38 |
| 2954 | 37 |
| 130 | 29 |
| 136 | 28 |
| 1061 | 27 |
Normalization-layer weights
For each of the 129 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 |
|---|---|
| 2692 | 71 |
| 1828 | 69 |
| 3214 | 69 |
| 63 | 62 |
| 82 | 61 |
| 101 | 57 |
| 1061 | 53 |
| 310 | 49 |
| 781 | 48 |
| 3156 | 46 |
Dimensions shared with the top 10 outlier channels above: 82, 101, 781, 1061, 1828, 2692, 3156.
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).
Stable rank ÷ shorter side by part:
| Part | Matrices | Min | Median | Max | Matrix with the minimum |
|---|---|---|---|---|---|
| Attention | 128 | 0.0013 | 0.0319 | 0.0736 | model.layers.0.self_attn.qkv_proj.base_layer.weight |
| FFN (dense) | 128 | 7.6932e-04 | 0.0522 | 0.3438 | model.layers.3.shared_mlp.output_linear.base_layer.weight |
| Embedding | 1 | 0.0144 | 0.0144 | 0.0144 | 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.087 | 1.1059 | 2.4947 | 3.1567 | 3.6594 | 4.4595 |
Rows with small norms (101 rows in the bottom 0.1%, the 20 smallest): 48077:'.dataGridViewTextBoxColumn'(1.087), 100308:'<|unused_39|>'(1.1048), 100328:'<|unused_59|>'(1.1049), 100312:'<|unused_43|>'(1.1049), 100341:'<|unused_72|>'(1.105), 100346:'<|unused_77|>'(1.105), 100290:'<|unused_21|>'(1.105), 100289:'<|unused_20|>'(1.105), 100343:'<|unused_74|>'(1.105), 100342:'<|unused_73|>'(1.1051), 100315:'<|unused_46|>'(1.1051), 100335:'<|unused_66|>'(1.1051), 89472:'useRalative'(1.1051), 100313:'<|unused_44|>'(1.1051), 100337:'<|unused_68|>'(1.1051), 181:'�'(1.1052), 100348:'<|unused_79|>'(1.1052), 186:'�'(1.1052), 47072:'webElementX'(1.1052), 185:'�'(1.1052)
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 prefix0a714a270435 - 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
…