MinimaLabs/KLM-1.5 — model analysis

Summary

  • Size: The model consists of about 98.8 million numbers (parameters). Its saved files total about 400MB.
  • Structure: A dense model (it does not switch between experts). About 50% of the parameters are assigned to the part that holds knowledge (FFN), about 40% to the part that reads context (attention), about 5% to memory tables (n-gram / engram), and about 2% to the vocabulary dictionary (embedding).
  • Memory tables: The weights whose names contain memory.bigram / memory.trigram (tables: model.memory.bigram.weight (125,001 × 32), model.memory.trigram.weight (38,001 × 32), plus the matrices that project their output) total about 5.2 million (5.3% of the total). The config has n_bigrams=125,000, n_trigrams=38,000, ngram_dim=32.
  • Japanese text: Japanese is split into about 3.0 units (tokens) per character. In English, one token holds about 3.2 characters. For the same number of characters, Japanese needs about 9.6 times as many tokens as English. Of its 4,100 vocabulary entries, 0 contain kana or kanji.
  • Context length: The limit written in the config (max_position_embeddings) is 2,048 tokens, roughly 680 Japanese characters or 6,600 English characters at the same ratio as the fixed texts above.
  • Skew in values: Values inside the model flow in groups of 512. Positions 317 and 432 were among the positions where outliers (extremely large values) appear most often, in 22 of 24 layers. Positions 317 and 432 also appeared in the tally of positions where normalization-layer weights take extreme values (317: 43, 432: 42 of 49 normalization layers). This kind of skew is generally considered a cause of accuracy loss when a model is compressed (quantized).

One line: Dense · klm · 24 layers · 98.81M params · mixed (with short convolutions ×18, plain q/k/v ×6) · context 2,048 · vocab 4,160

Basic information

  • Model: MinimaLabs/KLM-1.5 (revision 5243a4ce6ca9, config.json)
  • License: apache-2.0
  • Declared base_model: none
  • Storage dtypes: F32 98.81M, I32 125.00K, I64 38.00K
  • 2 integer tensors (163,000 elements, I32, I64): model.memory.bigram_keys, model.memory.trigram_keys. These are integer tables whose names do not end in weight (lookup tables and the like), not weights changed by training, so they are not counted in the parameters

Architecture (stage 0)

Parameters by part

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

Parameters by part

Part Parameters Share
FFN (dense) 51,904,512 52.53%
Attention 39,475,796 39.95%
Memory tables (n-gram / engram) 5,248,832 5.31%
Embedding 2,129,920 2.16%
Normalization 53,248 0.05%

Structure

Values from config.json.

Item Value
model_type / architectures klm / KLMForCausalLM
Layers 24
Hidden size 512
FFN intermediate size (intermediate_size) 1,408
Attention type mixed (with short convolutions ×18, plain q/k/v ×6)
Heads / KV heads / head dim 8 / 4 / 64
Layers by attention build (from tensor names) with short convolutions: 0, 1, 2, 4, 5, 6, 8, 9, 10, 12, 13, 14, 16, 17, 18, 20, 21, 22; plain q/k/v: 3, 7, 11, 15, 19, 23
Sliding window — (use_sliding_window=—)
Layer types (layer_types) —
RoPE θ 10,000
RoPE scaling —
Partial rotary (partial_rotary_factor) —
Context length (max_position_embeddings) 2,048
Tied input/output embeddings Yes
Activation —
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 4,160 4,160 Yes model.embed.weight
hidden_size 512 512 Yes model.embed.weight
num_hidden_layers 24 24 Yes largest layer index + 1 (excluding MTP layers)
num_key_value_heads×head_dim 256 256 Yes model.blocks.3.mixer.k_proj.weight
num_attention_heads×head_dim 512 512 Yes model.blocks.0.mixer.q_proj.weight
tie_word_embeddings (no output-head tensor) Yes Yes 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 1,345 0.334 1 99.9% Yes
English 1,201 373 3.22 3.295 2.7% Yes

Of 4,100 vocabulary entries, 0 (0.00%) contain at least one kana or kanji character and 0 contain two or more (loaded with tokenizers).

Special tokens and chat format

7 special tokens. BOS: <bos>, EOS: <eos>. Chat template: none. Thinking tags: Yes, tool calls: No, FIM: No, image tokens: No (found by searching special-token names and the template text).

List of special tokens

<pad>, <bos>, <eos>, <|im_start|>, <|im_end|>, <think>, </think>

Weights (stage 1)

Analyzed 482 of 484 tensors (compute time 2 s). Each tensor was converted to fp32 for computation. Tensors excluded from analysis: not floating point (2).

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 40.502 (model.blocks.21.ffn.down.weight), excess kurtosis 127.791 (model.blocks.5.mixer.k_conv1d.weight), outlier share 0.830% (model.blocks.9.mixer.q_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 24)
317 22
432 22
200 19
169 18
230 18
46 16
442 16
13 13
76 11
436 11

Normalization-layer weights

For each of the 49 normalization layers whose length equals the hidden size (512), 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 30 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
442 46
200 43
317 43
432 42
436 31
169 28
76 23
141 23
230 19
341 19

Dimensions shared with the top 10 outlier channels above: 76, 169, 200, 230, 317, 432, 436, 442.

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 211 0.0222 0.1318 0.3788 model.blocks.19.mixer.gate_proj.weight
FFN (dense) 72 0.0848 0.216 0.39 model.blocks.23.ffn.down.weight
Memory tables (n-gram / engram) 4 0.0874 0.2489 0.4145 model.memory.trigram_proj.weight
Embedding 1 0.0035 0.0035 0.0035 model.embed.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.embed.weight (4,160 rows)

Min Bottom 0.1% Bottom 1% Median Top 1% Max
12.557 13.4225 14.8338 20.2784 44.4104 50.662

Rows with small norms (5 rows in the bottom 0.1%, smallest first): 19:'1'(12.557), 20:'2'(12.7566), 21:'3'(12.924), 22:'4'(13.1579), 23:'5'(13.4088)

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.19 (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
  • The text and figures of this record were generated with mbscope 0.2.20 (measured with 0.2.19)

Comments

…

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

← All notes