The Rabbit Hole / AI / Model architectures
Tencent · Architecture mapHy4 preview
Latent attention with a sparse token selector that most layers share, a sigmoid gate and a learnable sink on every head, and a residual stream widened to four copies.
Hy4 preview, August 2026 · Hunyuan release timeline
Inside Hy4 preview
Inside latent attention · Transformer layer 1
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Inside latent attention · Layers that reuse the indexer (the other 57)
Earlier context dimmed · current token bright · dashed regions contain cached entries.
Model-specific details
- Transformer layer 1 · 1 repetitions
- Dense feed-forward network (hidden size 18432).
- indexer runs here
- This layer scores past tokens itself and keeps the top 2048.
- Indexer layers 2, 6, 10 and every fourth after, to 78 · 20 repetitions
- 256 routed experts (size 2048), 8 chosen per token, plus 1 shared expert of size 2048.
- indexer runs here
- This layer scores past tokens itself and keeps the top 2048. The next three layers reuse its choice.
- Layers that reuse the indexer (the other 57) · 57 repetitions
- Same expert block. These layers run no indexer; they read the top 2048 tokens chosen by the most recent layer that did.
- reuses an earlier indexer
- The token choice comes from the latest layer that ran an indexer.
- Attention and positions
- 64 heads over a latent cache: queries are compressed to rank 2048, keys and values to a 512-value latent. Each head has a key of 192 content plus 64 rotary values and a value of 256. A sparse indexer (32 heads of size 128) picks the top 2048 tokens, but it runs in only 21 of 78 layers; the other 57 reuse the choice of the latest layer that ran one. The attention output of each head is multiplied by a sigmoid gate computed from the layer input, and each head has a learnable sink.
- Memory
- A 512-value KV latent plus a 64-value rotary key per token per layer, plus the indexer's keys (128 values per token) in the 21 layers that run an indexer.
What changes from Hy3
- Seventy-eight layers of gated latent attention with sparse selection. Twenty-one indexers compute token choices; the other 57 layers reuse the latest selection.
- Each indexer retains up to 2,048 tokens. Attention also includes per-head learned sinks and an elementwise output gate.
- Four iHC residual streams, without mHC’s Sinkhorn mixing matrix.
- One dense opening layer, then 77 expert layers selecting eight of 256 experts plus one shared expert.
The preview has width 6,144 and supports 1,048,576 tokens.
Explore the components
- Embeddings: giving every token a meaning
- Residual connections: when more layers made things worse
- A whole LLM, layer by layer
- RMSNorm: keeping a token's scale under control
- Hyper-connections: more than one residual stream
- Multi-head latent attention (MLA): caching a compressed latent
- Sparse attention and the lightning indexer
- Attention gating: should this head add anything?
- Attention sinks: where does unused attention go?
- Bounded SwiGLU: clamping and squashing the gatecoming soonA gated feed-forward activation whose values are clamped or smoothly squashed into a range.
- Mixture of experts (MoE): a big model that uses only part of itself
- Routing: selecting experts and weighting their work
- Multi-token prediction (MTP): learning to look further ahead
- RoPE: position as a rotation
- Attention, from scratch
- The KV cache: why LLMs remember every key and value
- Transformer layers: attention is only half of what you need