Hunyuan · 2026-08 · Sparse MoE

Hunyuan 4 Preview

Hunyuan 4 Preview is a multi-head latent attention (MLA) transformer released by Hunyuan in 2026-08, with 78 layers, hidden size 6144 and a context window of 1,048,576 tokens.

Layer stack

sparse ×78 · Layers 78

Key facts

FamilyHunyuan
Released2026-08
Params770 B
Active49 B
Context1,048,576 tokens
AttentionMLA · kv_lora_rank 512
Layers78
Hidden6,144
Heads64
Vocab120,832
Positionlearned/absolute
NormRMSNorm
Activationsilu
Dtypefp8
Architecture classHYV4ForCausalLM

Architecture overview

t₁ t₂ t₃ t₄ input tokens Embedding · Vocab 120,832 → Hidden 6,144 Q · 64 Wᴰᴷⱽ ↓ c_KV · 512 kᴿ · RoPE 64 Wᵁᴷ/Wᵁⱽ ↑ ⊕kᴿ Attention KV cache/token ≈ 512+64 vs dense 2·6,144 → ≈ 1/21.3 Router E1 E2 E3 E4 E5 E6 E7 E8 +248… Shared expert ×1 top-8 of 256 experts · ≈ 49B params active per token × 78 transformer block Attention Feed-forward / MoE RMSNorm pre-norm Final norm · RMSNorm LM head → Vocab 120,832 p p p → next token MTP ×1 → +1 future tokens Position learned/absolute Dtype FP8 Context 1024K tok
Drawn from the shipped config.json · 78 layers / width 6,144 / context 1,048,576. Original diagram by this atlas.

Attention

multi-head latent attention (MLA). kv_lora_rank=512.

Feed-forward / MoE

It is a sparse mixture-of-experts with 256 routed experts and top-8 routing; about 49B parameters are active per token.

The configuration ships 1 extra multi-token-prediction (MTP) layers used to accelerate decoding.

Field-level comparison

Compared against the previous model of the same lab; where none exists, against the structurally closest model. The ratio column is this model divided by the comparison model.

Full-field comparison vs predecessor Hunyuan 3
ModelHunyuan 4 PreviewHunyuan 3Ratio
model_typehy_v4hy_v3
architecturesHYV4ForCausalLMHYV3ForCausalLM
hidden_size61444096×1.50
num_hidden_layers7880×0.975
num_attention_heads6464≈1
num_key_value_heads88≈1
head_dim64128×0.500
intermediate_size1843213312×1.38
hidden_actsilusilu
n_routed_experts256
num_experts_per_tok88≈1
n_shared_experts1
moe_intermediate_size20481536×1.33
kv_lora_rank512
qk_rope_head_dim64
q_lora_rank2048
max_position_embeddings1048576262144×4.00
rms_norm_eps0.000010.00001≈1
vocab_size120832120832≈1
torch_dtypebfloat16
num_nextn_predict_layers11≈1
attention_biasfalse
attention_dropout0
bitwise_backward_alignfalse
bos_token_id120000120000≈1
dtypebfloat16bfloat16

Most similar architectures

Similarity values range from 0 (no shared categorical features) to 1 (identical profiles).

Raw config fields

58 fields
architecturesHYV4ForCausalLM
attention_biasfalse
attention_dropout0
bitwise_backward_alignfalse
bos_token_id120000
dtypebfloat16
enable_ihctrue
enable_lm_head_fp32true
eos_token_id120025
gated_mlatrue
gating_typeelementwise
hc_eps0.000001
hc_magnitude2
hc_mult4
head_dim64
hidden_actsilu
hidden_size6144
index_head_dim128
index_n_heads32
index_topk2048
indexer_typesfull×21 + shared×57
initializer_range0.006
intermediate_size18432
kv_lora_rank512
layer_typesdeepseek_sparse_attention×78
learnable_sinktrue
learnable_sink_init0
max_position_embeddings1048576
mlp_layer_typesdense×1 + sparse×77
model_typehy_v4
moe_intermediate_size2048
mtp_loss_factor0.1
n_group1
n_routed_experts256
n_shared_experts1
norm_topk_probtrue
num_attention_heads64
num_experts_per_tok8
num_hidden_layers78
num_key_value_heads8
num_nextn_predict_layers1
pad_token_id120002
q_lora_rank2048
qk_head_dim256
qk_nope_head_dim192
qk_rope_head_dim64
rms_norm_eps0.00001
routed_scaling_factor2.827
swiglu_limit10
tie_word_embeddingsfalse
topk_group1
transformers_version5.16.2
use_cachetrue
use_dsatrue
use_mlatrue
v_head_dim256
vocab_size120832
torch_dtypebfloat16