tencent/Hy-Memory-30B-A3B — model analysis
Summary
- Size: The model consists of about 30.1 billion numbers (parameters). Its saved files total about 60.1GB.
- Structure: A mixture-of-experts (MoE) model that, for each input, selects only 8 of its 128 experts. Of about 30.1 billion parameters in total, about 3.5 billion are used per computation step. About 90% of the parameters are assigned to the experts and about 3% to the part that reads context (attention).
- Japanese text: In Japanese, one token holds about 1.3 characters. In English, one token holds about 4.2 characters. For the same number of characters, Japanese needs about 3.4 times as many tokens as English. Of its 120,818 vocabulary entries, 45,835 contain kana or kanji.
- Context length: The limit written in the config (max_position_embeddings) is 262,144 tokens, roughly 330,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 2,048. Positions 1447 and 1588 were among the positions where outliers (extremely large values) appear most often, in all 48 layers. Positions 1447 and 1588 also appeared in the tally of positions where normalization-layer weights take extreme values (1447: 58, 1588: 67 of 97 normalization layers). This kind of skew is generally considered a cause of accuracy loss when a model is compressed (quantized).
One line: MoE (8 of 128 experts active) · hy_v3 · 48 layers · 30.06B params · 3.45B active · GQA (8:1) · context 262,144 · vocab 120,832
Basic information
- Model: tencent/Hy-Memory-30B-A3B (revision
64a460a94d54, config.json) - License: apache-2.0
- Declared base_model: none
- Storage dtypes: BF16 30.06B, F32 6.02K
Architecture (stage 0)
Parameters by part
Counted from the tensor shapes in the safetensors headers (measured).
| Part | Parameters | Share |
|---|---|---|
| Experts | 28,387,049,472 | 94.42% |
| Attention | 905,969,664 | 3.01% |
| Output head | 247,463,936 | 0.82% |
| Embedding | 247,463,936 | 0.82% |
| Shared experts | 221,773,824 | 0.74% |
| FFN (dense) | 42,467,328 | 0.14% |
| Router | 12,326,784 | 0.04% |
| Normalization | 210,944 | 0.00% |
Structure
Values from config.json.
| Item | Value |
|---|---|
| model_type / architectures | hy_v3 / HYV3ForCausalLM |
| Layers | 48 |
| Hidden size | 2,048 |
| FFN intermediate size (intermediate_size) | 6,912 |
| Attention type | GQA (8:1) |
| Heads / KV heads / head dim | 32 / 4 / 128 |
| Sliding window | — (use_sliding_window=—) |
| Layer types (layer_types) | — |
| RoPE θ | 11,158,840 |
| RoPE scaling | {'rope_theta': 11158840.0, 'rope_type': 'default'} |
| Partial rotary (partial_rotary_factor) | — |
| Context length (max_position_embeddings) | 262,144 |
| Tied input/output embeddings | No |
| Activation | silu |
| Normalization ε | 1.000e-05 |
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) | 128 |
| Experts counted from tensor names (count: layers) | 128:47 layers |
| Active experts per token | 8 |
| Expert intermediate size (expert_hidden_dim) | 768 |
| moe_intermediate_size (value written in config; see the comparison below for the tensor shapes) | 1,536 |
| Shared experts | 1 |
| MoE layers | 47 |
| Leading dense layers (first_k_dense_replace) | 1 |
| Expert parameters | 28.39B |
| Active parameters | 3.45B |
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 | 120,832 | 120,832 | Yes | model.embed_tokens.weight |
| hidden_size | 2,048 | 2,048 | Yes | model.embed_tokens.weight |
| num_hidden_layers | 48 | 48 | Yes | largest layer index + 1 (excluding MTP layers) |
| num_key_value_heads×head_dim | 512 | 512 | Yes | model.layers.0.self_attn.k_proj.weight |
| num_attention_heads×head_dim | 4,096 | 4,096 | Yes | model.layers.0.self_attn.q_proj.weight |
| intermediate_size | 6,912 | 6,912 | Yes | model.layers.0.mlp.gate_proj.weight |
| expert_hidden_dim | 768 | 768 | Yes | model.layers.1.mlp.experts.0.gate_proj.weight |
| moe_intermediate_size | 1,536 | 768 | No | model.layers.1.mlp.experts.0.gate_proj.weight |
| tie_word_embeddings (no output-head tensor) | No | No | Yes | tensor list |
| num_experts | 128 | 128 | 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 | 357 | 1.258 | 3.768 | 10.6% | Yes |
| English | 1,201 | 285 | 4.214 | 4.312 | 0.0% | Yes |
Of 120,818 vocabulary entries, 45,835 (37.94%) contain at least one kana or kanji character and 41,286 contain two or more (loaded with tokenizers).
Special tokens and chat format
786 special tokens. BOS: <|hy_begin▁of▁sentence|>, EOS: <eos:6124c78e>. Chat template: present (11082 characters, sha256 prefix 8759492d33de).
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
<|hy_begin▁of▁sentence|>, <|hy_end▁of▁sentence|>, <|hy_▁pad▁|>, <|hy_fim▁hole|>, <|hy_fim▁begin|>, <|hy_fim▁end|>, <|hy_User|>, <|hy_Assistant|>, <|hy_EOT|>, <|hy_place▁holder▁no▁11|>, <|hy_place▁holder▁no▁12|>, <|hy_place▁holder▁no▁13|>, <|hy_place▁holder▁no▁14|>, <|hy_place▁holder▁no▁15|>, <|hy_place▁holder▁no▁16|>, <|hy_place▁holder▁no▁17|>, <|hy_place▁holder▁no▁18|>, <|hy_place▁holder▁no▁19|>, <|hy_place▁holder▁no▁0|>, <|hy_place▁holder▁no▁1|>, <|hy_place▁holder▁no▁2|>, <|hy_place▁holder▁no▁3|>, <|hy_place▁holder▁no▁4|>, <|hy_place▁holder▁no▁5|>, <|hy_place▁holder▁no▁6|>, <eos:6124c78e>, <|hy_place▁holder▁no▁8|>, <|hy_place▁holder▁no▁9|>, <|hy_place▁holder▁no▁10|>, <|hy_place▁holder▁no▁34|>, <|hy_place▁holder▁no▁35|>, <|hy_place▁holder▁no▁36|>, <|hy_place▁holder▁no▁37|>, <|hy_place▁holder▁no▁38|>, <|hy_place▁holder▁no▁39|>, <|hy_place▁holder▁no▁40|>, <|hy_place▁holder▁no▁41|>, <|hy_place▁holder▁no▁42|>, <|hy_place▁holder▁no▁43|>, <|hy_place▁holder▁no▁53|>, <|hy_place▁holder▁no▁54|>, <|hy_place▁holder▁no▁55|>, <|hy_place▁holder▁no▁56|>, <|hy_place▁holder▁no▁57|>, <|hy_place▁holder▁no▁58|>, <|hy_place▁holder▁no▁59|>, <|hy_place▁holder▁no▁60|>, <|hy_place▁holder▁no▁61|>, <|hy_place▁holder▁no▁62|>, <|hy_place▁holder▁no▁63|>, <|hy_place▁holder▁no▁64|>, <|hy_place▁holder▁no▁65|>, <|hy_place▁holder▁no▁66|>, <|hy_place▁holder▁no▁67|>, <|hy_place▁holder▁no▁68|>, <|hy_place▁holder▁no▁69|>, <|hy_place▁holder▁no▁70|>, <|hy_place▁holder▁no▁71|>, <|hy_place▁holder▁no▁72|>, <|hy_place▁holder▁no▁73|> …
Weights (stage 1)
Analyzed 18,673 of 18,673 tensors (compute time 1.1 min). 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.
Matrices with the largest values (main-model weights with 2 or more dimensions): max|w| ÷ RMS 163.206 (model.layers.47.mlp.experts.11.up_proj.weight), excess kurtosis 470.169 (model.layers.47.mlp.experts.11.up_proj.weight), outlier share 0.319% (model.layers.43.mlp.experts.100.up_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 48) |
|---|---|
| 1447 | 48 |
| 1588 | 48 |
| 201 | 47 |
| 347 | 47 |
| 449 | 47 |
| 748 | 47 |
| 820 | 47 |
| 1383 | 47 |
| 1736 | 47 |
| 1898 | 47 |
Normalization-layer weights
For each of the 97 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). The 96 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 |
|---|---|
| 1122 | 95 |
| 748 | 80 |
| 778 | 77 |
| 847 | 67 |
| 1588 | 67 |
| 1736 | 62 |
| 1898 | 62 |
| 1447 | 58 |
| 820 | 54 |
| 681 | 53 |
Dimensions shared with the top 10 outlier channels above: 748, 820, 1447, 1588, 1736, 1898.
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 |
|---|---|---|---|---|---|
| Experts | 18048 | 0.0126 | 0.1841 | 0.4006 | model.layers.47.mlp.experts.11.up_proj.weight |
| Attention | 192 | 0.0179 | 0.096 | 0.449 | model.layers.45.self_attn.q_proj.weight |
| Shared experts | 141 | 0.0228 | 0.0616 | 0.1703 | model.layers.46.mlp.shared_mlp.up_proj.weight |
| Router | 47 | 0.0417 | 0.0464 | 0.0574 | model.layers.22.mlp.router.gate.weight |
| FFN (dense) | 3 | 0.0741 | 0.0868 | 0.1254 | model.layers.0.mlp.gate_proj.weight |
| Output head | 1 | 0.0049 | 0.0049 | 0.0049 | lm_head.weight |
| Embedding | 1 | 0.0128 | 0.0128 | 0.0128 | 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 (120,832 rows)
| Min | Bottom 0.1% | Bottom 1% | Median | Top 1% | Max |
|---|---|---|---|---|---|
| 0.5667 | 0.5752 | 0.9083 | 1.3679 | 1.6439 | 1.8744 |
Rows with small norms (121 rows in the bottom 0.1%, the 20 smallest): 69851:'本案涉及的相关法条和被告人的刑期长短'(0.5667), 69853:'请根据刑事法律文书中的案情描述和事实部分来预测被告人被判的罪名'(0.5704), 69850:'其中有期徒刑刑期用月数表示'(0.5716), 65577:'_Pvsamv'(0.5721), 86967:'_VFCCU'(0.5727), 120614:'<|hy_place▁holder▁no▁596|>'(0.5729), 120026:'<|hy_place▁holder▁no▁8|>'(0.5745), 69553:'|>#'(0.5745), 120007:'<|hy_Assistant|>'(0.5746), 120006:'<|hy_User|>'(0.5747), 120021:'<|hy_place▁holder▁no▁3|>'(0.5747), 116263:'系矩体'(0.5751), 116447:'体矩系'(0.5751), 69848:'和被告人的刑期长短'(0.5752), 120421:'<|hy_place▁holder▁no▁403|>'(0.5752), 120005:'<|hy_fim▁end|>'(0.5752), 120672:'<|hy_place▁holder▁no▁654|>'(0.5752), 120506:'<|hy_place▁holder▁no▁488|>'(0.5752), 120200:'<|hy_place▁holder▁no▁182|>'(0.5752), 120700:'<|hy_place▁holder▁no▁682|>'(0.5752)
model.embed_tokens.weight (120,832 rows)
| Min | Bottom 0.1% | Bottom 1% | Median | Top 1% | Max |
|---|---|---|---|---|---|
| 0.2592 | 0.267 | 2.2893 | 4.8442 | 6.4391 | 7.2198 |
Rows with small norms (121 rows in the bottom 0.1%, the 20 smallest): 120087:'<|hy_place▁holder▁no▁69|>'(0.2592), 120294:'<|hy_place▁holder▁no▁276|>'(0.2603), 120656:'<|hy_place▁holder▁no▁638|>'(0.2605), 120539:'<|hy_place▁holder▁no▁521|>'(0.2607), 120441:'<|hy_place▁holder▁no▁423|>'(0.2608), 120419:'<|hy_place▁holder▁no▁401|>'(0.2611), 120763:'<|hy_place▁holder▁no▁745|>'(0.2613), 120255:'<|hy_place▁holder▁no▁237|>'(0.2615), 120073:'<|hy_place▁holder▁no▁55|>'(0.2616), 120652:'<|hy_place▁holder▁no▁634|>'(0.262), 120393:'<|hy_place▁holder▁no▁375|>'(0.2621), 120637:'<|hy_place▁holder▁no▁619|>'(0.2621), 120568:'<|hy_place▁holder▁no▁550|>'(0.2622), 120152:'<|hy_place▁holder▁no▁134|>'(0.2622), 120155:'<|hy_place▁holder▁no▁137|>'(0.2623), 120502:'<|hy_place▁holder▁no▁484|>'(0.2626), 120374:'<|hy_place▁holder▁no▁356|>'(0.2628), 120473:'<|hy_place▁holder▁no▁455|>'(0.2631), 120554:'<|hy_place▁holder▁no▁536|>'(0.2632), 120095:'<|hy_place▁holder▁no▁77|>'(0.2632)
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: 4.0827e-04.
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
…