Rúben GalvãoThe Rabbit Hole

The Rabbit Hole / AI / Model architectures

Tencent · Architecture map

Hunyuan-A13B

A compact fine-grained mixture of experts with GQA, QK-norm and tied embeddings, extended to long context with dynamic NTK scaling.

Hunyuan-A13B-Instruct, June 2025 · Hunyuan release timeline

Inside Hunyuan-A13B

Parameters
80B · 13B active
Layers
32
Width
4,096
Mixer
Grouped-query
Select a component to explore it.
The complete Hunyuan-A13B architectureInput IDs select embeddings. Each layer adds its updates along the residual stream. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation. Keys and values for 8 heads of size 128 per token per layer. Final normalisation and output weights produce vocabulary scores and the next-token distribution.Text becomes token IDs.Text → tokens → IDstheoldrabbitsleepsEmbedding lookup128,1674,096Input token vectorsCL4,096Transformer layers 1–32Transformer layers 1–32 · 32 repetitions32 layers · one layer shown32RMSNorm before this operation.RMSNormGrouped-query attention: 64 routed experts (size 3072), 8 chosen per token, plus 1 shared expert. No dense layers.Grouped-queryattentionRotate query and key position components before attention scores; values are unchanged. 64 routed experts (size 3072), 8 chosen per token, plus 1 shared expert. No dense layers.RoPENormalise queries and keys before attention scores. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.QK-normAdd the branch output to the original stream. +RMSNorm before this operation.RMSNormMoE: 64 routed experts (size 3072), 8 chosen per token, plus 1 shared expert. No dense layers.MoE8 of 64 routed experts selected per token. Highlighted boxes are schematic; boxes do not correspond one-to-one to experts. 1 shared experts run for every token.Add the branch output to the original stream. +8 of 64 experts + 1sharedResidual streamLast columnCL4,096Final RMSNormReuses the embedding table, transposed.Tied output weights4,096128,167Vocabulary scoresSoftmax128,167Next-token probabilities
Inside grouped-query attention · Transformer layers 1–32
4 query heads per group × 8 K/V groups.

Earlier context dimmed · current token bright · dashed regions contain cached entries.

Hunyuan-A13B: Transformer layers 1–32 · grouped-query attention32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation. Keys and values for 8 heads of size 128 per token per layer.8 KV groups; the front face shows one representative.8 KV groups4 heads / group; the front face shows one representative.4 heads / groupAttention input. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Earlier context is dimmed; outlined columns are current.Current token computation.Attention input4,096CLWq. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Wq4,096128Wk. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Wk4,096128Wv. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Wv4,096128RoPE. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.RoPERMSNorm. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.RMSNormRoPE. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.RoPERMSNorm. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.RMSNormK cache. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.K cache128CLV cache. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Earlier columns are cached; outlined columns are newly computed.Cached positions from earlier decoding steps.Current token computation.V cache128CLQ context. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Earlier context is dimmed; outlined columns are current.Current token computation.Q context128CLScaled query–key scores, masking and softmax. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.CLCL×. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.×Joined heads. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.32Wo. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Wo4,0964,096Attention output. 32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.Earlier context is dimmed; outlined columns are current.Current token computation.Attention output4,096CL
Model-specific details
Transformer layers 1–32 · 32 repetitions
64 routed experts (size 3072), 8 chosen per token, plus 1 shared expert. No dense layers.
Attention and positions
32 query heads share 8 key/value heads of size 128, with per-head query/key normalisation applied after the rotary rotation.
Memory
Keys and values for 8 heads of size 128 per token per layer.

Experts in every layer

All 32 layers select eight of 64 routed experts plus one shared expert. Attention uses grouped queries, with QK-norm applied after RoPE; input and output embeddings are tied.

The model supports 262,144 tokens. Its shipped config defaults to 32,768 positions to reduce memory use; the model card documents raising that setting for the full context.

Explore the components

Sources for this map