K2-Horizon-MoVA-36B-A4B (mid_4_10000)
MBZUAI IFM · base checkpoint
Describes tag mid_4_10000, the final Midtraining Stage 4 checkpoint (before SFT). Stage 4 trains on a mix shifted toward agentic and reasoning SFT data, so this is not a pure pretraining checkpoint (that is pretrain_1100000, at 8K context).
Open in the comparison table Hugging Face ↗ Blog ↗
KV calculations use one sequence at 131,072 tokens and 16-bit cache elements. They include bounded sliding-window caches. This is retained cache payload, not peak prefill memory. The comparison table also offers sourced mixed-precision layouts, including quantization scales.
Release
- Released
2026-09-03
Source: blog · ifm.ai/blog/k2 (Wayback snapshot 2026-09-03); header
September 3, 2026
Date the weights (or, if earlier, the technical report) were first made public, YYYY-MM-DD, as dated by the publisher. A Hugging Face repository creation date is used only when no dated publisher page exists, with a note.
- License
apache-2.0
Source: model-card · README.md; YAML front matter
license: apache-2.0
License of the released weights as declared by the publisher (model card metadata or license file), e.g. apache-2.0, mit, or the name of a custom license.
- Input modalities
text
Inferred from the source; see the explanation below.
Source: model-card · README front matter
pipeline_tag: text-generation
Card tags the checkpoint text-generation; config declares no vision or audio tower (K2HorizonForCausalLM).
Input modalities of the released checkpoint as the publisher states them, from: text, image, video, audio, joined with ' + ' in that order ("text", "text + image + video").
Parameters
- Total params
36B parameters
Source: model-card · README.md; introduction
a Mixture-of-Experts model with Mixture-of-Values attention (MoVA) that stores 36B parameters and runs 4B per token
Total parameter count as reported by the publisher. See params.note for whether embeddings, MTP heads or vision towers are included.
- Active params
4B parameters
Source: model-card · README.md; introduction
a Mixture-of-Experts model with Mixture-of-Values attention (MoVA) that stores 36B parameters and runs 4B per token
Parameters used per token in the forward pass, as reported by the publisher.
- Active non-embedding (stated)
Not disclosed
Active parameters excluding the input embedding and the output head (unembedding). Stated by the publisher, or computed from params.active by subtracting vocab × d_model for each of the embedding and output head that params.active is stated to include (basis inferred, note with the arithmetic). Not disclosed when the scope of params.active is not stated.
- Counted total params
Not calculated
Calculated: checkpoint count (37.4B backbone) does not reproduce the stated total and active counts
Parameters of the text backbone counted from the released checkpoint's safetensors headers (embedding, output head, all experts and other weights; excluding MTP modules, vision/audio towers and n-gram lookup tables). Shown only when the counts reproduce the publisher's stated total and active parameters within 5% under some scope.
- Counted embedding + head
Not calculated
Calculated: checkpoint count (37.4B backbone) does not reproduce the stated total and active counts
Input embedding plus output head (once if tied), counted from the checkpoint.
- Non-emb. params (counted)
Not calculated
Calculated: checkpoint count (37.4B backbone) does not reproduce the stated total and active counts
Language backbone weights excluding input embeddings, output head, lookup/Engram tables, MTP modules and vision/audio towers. Equals params.counted_total minus params.counted_embedding. Same validation as params.counted_total.
- Active non-emb. (counted)
Not calculated
Calculated: checkpoint count (37.4B backbone) does not reproduce the stated total and active counts
Active parameters per token excluding the input embedding and output head, counted from the checkpoint as all non-expert weights plus routed-expert weights × top_k / experts. Same validation as params.counted_total.
- Counting scope
Scope of the 36B and 4B counts is not stated. xLLM's num_parameters formula on this config gives 36.2B total and 4.7B active excluding the embedding and output head (1.28B together).
Inferred from the source; see the explanation below.
Source: code · xllm/models/transformer.py; num_parameters
activated_value_params = self.model_dim * self.num_kv_heads * self.head_dim * self.num_activated_values
Per MoVA+MoE layer: 34.1M Q/K/O/gate + 64 × 2.62M value experts (4 active) + 100 × 5.9M routed experts (8 active) + 5.9M shared + routers; × 45 layers, plus 3 dense layers of 83.9M.
What the publisher's counts include or exclude (MTP modules, embeddings, vision encoder, n-gram tables).
Shape
- Layers
48
Source: config · /num_hidden_layers
Number of transformer blocks in the main backbone (attention or token mixer plus FFN), excluding MTP modules.
- d_model
2,560
Source: config · /hidden_size
Residual stream width.
- Vocab
250,624
Source: config · /vocab_size
Embedding table rows (vocab_size in config, may include padding).
- Tied embeddings
No
Source: config · /tie_word_embeddings
Input embedding and output head share weights.
- d_model / layers
53.3333
Calculated: d_model / layers
Width-to-depth ratio, d_model divided by the number of blocks.
Attention
- Token mixers
GQA (MoVA: routed value projections in 45 of 48 layers)
Source: code · modeling_k2_horizon.py; K2HorizonMoVAAttention
MoVA attention with routed value experts and optional post-attention gate.
MoVA (Mixture-of-Value Attention) replaces v_proj with 64 value experts (/mova_num_experts), each a 2560→8×128 linear map; a sigmoid router picks 4 per token (/mova_num_experts_per_tok), and the SiLU'd expert outputs are summed with renormalized weights × 2.5. Q and K are ordinary GQA, every token attends to all earlier tokens, and the mixed V is cached like a normal V, so the KV cache is the standard 8 × (128 + 128) per layer. sliding_window null, use_sliding_window false.
Token-mixing layer types in the backbone, e.g. GQA, MLA, SWA, Gated DeltaNet, Mamba-2, DSA (DeepSeek sparse attention).
- Layer layout
3 GQA, then 45 GQA with MoVA values
Source: code · modeling_k2_horizon.py; K2HorizonDecoderLayer.__init__
if is_sparse_layer and config.mova_num_experts > 0:
MoVA layers are exactly the MoE-FFN layers; layers 0-2 (/mlp_only_layers) use a plain v_proj and a dense FFN.
Token-mixer order, summarized as a pattern or layer positions. The fact's optional sequence lists each mixer in order; a ratio alone does not establish the order. Auxiliary prediction modules and standalone FFNs are excluded.
- Global-attention layers
48
Source: config · /num_hidden_layers
Layers whose KV cache grows with full context (dense or sparse global attention, MLA). Excludes sliding-window and linear/recurrent layers.
- Query heads
32
Source: config · /num_attention_heads
Query heads in the global-attention layers.
- KV heads
8
Source: config · /num_key_value_heads
Key/value heads in the global-attention layers. Not applicable to MLA, whose cache is a shared latent.
- Heads × head dim
4,096
Calculated: heads × head_dim
attn.heads × attn.head_dim, the query projection width of global layers.
- Q heads / KV head
4
Calculated: heads / kv_heads
attn.heads divided by attn.kv_heads in global layers.
- QK head dim
128
Source: config · /head_dim
Query/key dimension per head in global-attention layers (for MLA, nope + rope dims).
- Positional encoding
RoPE
Source: config · config.json; rope_head_dim, head_dim
"rope_head_dim": 128
rope_head_dim equals head_dim, so all 128 QK dims rotate (unlike the 375B sibling's 64).
Positional scheme in global layers: RoPE, partial RoPE, NoPE, or mixed per layer type.
- RoPE base
10,000,000
Source: config · /rope_parameters/rope_theta
RoPE base frequency of the global layers at release.
- Rotary fraction
1
Inferred from the source; see the explanation below.
Source: config · config.json; rope_head_dim, head_dim
"rope_head_dim": 128
rope_head_dim 128 divided by head_dim 128.
Fraction of each head's QK dimensions that are rotated.
- QK norm
No
Source: config · /query_key_norm
Queries and keys are normalized per head before the dot product.
- Output gate
softplus (β = ln 2) gate per head dimension on the attention output, before o_proj, in all layers
Source: code · modeling_k2_horizon.py; K2HorizonAttention.forward and K2HorizonMoVAAttention.forward
gate = F.softplus(gate, beta=math.log(2))
Gate is gate_proj(x), 2560 → 32 × 128, selected by /attention_gate_func.
Gate applied to the attention output before the output projection, with its placement.
- QKV bias
No
Source: config · /attention_bias
Query/key/value projections have bias terms.
Feed-forward
- Activation
SwiGLU
Source: code · modeling_k2_horizon.py; K2HorizonMLP.forward
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
act_fn is SiLU (/hidden_act); dense FFN, routed and shared experts all use K2HorizonMLP.
FFN activation (SwiGLU, GeGLU, ...).
- Dense FFN dim
6,144
Source: config · /intermediate_size
Intermediate width of the dense FFN layers that are actually executed.
- FFN bias
No
Source: code · modeling_k2_horizon.py; K2HorizonMLP.__init__
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
FFN projections have bias terms.
- Dense FFN / d_model
2.4
Calculated: ffn.dim / d_model
ffn.dim divided by shape.d_model.
Mixture of experts
- Routed experts
100
Source: config · /num_experts
Routed experts per MoE layer.
- Experts per token
8
Source: config · /num_experts_per_tok
Routed experts selected per token.
- Expert dim
768
Source: config · /moe_intermediate_size
Intermediate width of one routed expert.
- Leading dense layers
3
Source: config · /mlp_only_layers | len
Layers 0, 1, 2 use the 6144-wide dense FFN; decoder_sparse_step 1 makes every later layer MoE.
Number of initial blocks that use a dense FFN instead of MoE.
- Router score
sigmoid
Source: config · /router_score_func
Gating function over expert logits (softmax, sigmoid).
- Load balancing
per-expert bias for top-k selection only (update rate 1e-3) plus 'dot' auxiliary loss, coefficient 1e-4
Source: code · examples/k2-horizon-mova-36B-a4B.sh; TRAINING_CFGS
--moe_aux_loss_coeff 1e-4
Bias update rate from ConfStore["k2-horizon-mova-36B-a4B"] (moe_router_bias_update_rate=1e-3; HF config moe_gate_bias, router_aux_loss_coef 1e-4). The MoVA value routers use the same router settings; xLLM averages their aux loss with the FFN router's.
Load-balancing method, with coefficients where disclosed.
- Routed scaling factor
2.5
Source: config · /router_scaling_factor
Multiplier applied to the combined routed-expert output (routed_scaling_factor).
- Renormalize top-k
Yes
Source: config · /norm_topk_prob
Selected expert weights are renormalized to sum to 1.
- Expert dim / d_model
0.3
Calculated: moe.expert_dim / d_model
moe.expert_dim divided by shape.d_model.
- Sparsity (experts / top-k)
12.5
Calculated: experts / top_k
Routed experts divided by experts selected per token.
- Active / total
0.111111
Calculated: params.active / params.total
params.active divided by params.total.
Multi-token prediction
- MTP depth
0
Inferred from the source; see the explanation below.
Source: code · xllm/models/transformer.py; TransformerOutputLayer.forward
loss = vocab_parallel_cross_entropy(logits, y)
xLLM, the training code, has no MTP implementation; the loss is next-token cross-entropy, and model.safetensors.index.json has no MTP weights.
Additional future tokens predicted during pretraining (0 when the model was trained without MTP).
Normalization and stability
- Norm
RMSNorm (2 groups of 1280)
Source: code · modeling_k2_horizon.py; K2HorizonRMSNorm.forward
hidden_states = hidden_states.reshape(*hidden_states.shape[:-1], self.n_groups, -1)
layernorm_num_groups 2: each half of d_model is normalized separately, in block and final norms.
Normalization layer type in the blocks.
- Norm placement
pre
Source: code · modeling_k2_horizon.py; K2HorizonDecoderLayer.forward
hidden_states = self.input_layernorm(hidden_states)
Pre-norm, post-norm, or sandwich (pre and post).
- Norm epsilon
1e-06
Source: config · /rms_norm_eps
Epsilon of the block normalization layers.
Context length
- Pretraining context
8.192K tokens
Source: model-card · README.md; Training Overview table
Pretraining | 1100000 | 22.9T | 8K | Pretraining.
Sequence length of the main pretraining stage.
- Trained context
524.3K tokens
Source: model-card · README.md; Training Overview table
Midtraining — Stage 3 | 5500 | 110B | 512K | Context extension.
512K = 524,288 tokens (Highlights).
Longest sequence length trained on after context extension.
- Advertised context
524.3K tokens
Source: model-card · README.md; Highlights
Native 524,288-token context from the midtraining stages onward.
config max_position_embeddings 524288.
Longest context the publisher says the model supports, possibly beyond trained length via RoPE scaling.
- Extension method
8K → 32K (1.1T) → 128K (498B) → 512K (110B, then 199B with agentic/reasoning SFT data)
Source: model-card · README.md; Training Overview table
Midtraining — Stage 1 | 55000 | 1.1T | 32K | Context extension.
RoPE base raised with length: config rope_theta 500000 at pretrain_1100000 (commit 3cc4264), 1e6 at mid_1_55000 (632ec2f), 1e7 from mid_2_25000 (358bc8f); rope_type default, no scaling.
How context was extended (stages, RoPE base change, YaRN factor).
Pretraining recipe
- Pretraining tokens
24.81T tokens
Inferred from the source; see the explanation below.
Source: model-card · README.md; Training Overview
Token budgets cover only the additional training in that stage or phase.
Sum of the per-stage budgets in train.stages (22.9T + 1.1T + 498B + 110B + 199B) through mid_4_10000; includes the 199B Stage 4 tokens with SFT data in the mix.
Tokens seen in pretraining including annealing and context extension, as reported.
- Optimizer
AdamW
Source: code · xllm/optim/optimizer.py; build_optimizer
optimizer = AdamW(
Optimizer used for the bulk of parameters.
- Peak LR
0.0004
Source: code · examples/k2-horizon-mova-36B-a4B.sh; variables
LR=4e-4
IFM's launch script for this model; its --steps 1100000 matches the card's pretraining stage.
Peak learning rate of the main pretraining stage.
- Final LR
Not disclosed
Learning rate at the end of the decay.
- LR schedule
WSD with no decay phase in pretraining: linear warmup, then constant 4e-4 to step 1,100,000
Source: code · examples/k2-horizon-mova-36B-a4B.sh; OPTIM_CFGS
--optim.wsd_decay_duration_steps 0
xLLM lr_wsd holds the peak through total_steps when the decay duration is 0; the LR used in midtraining is not in these sources.
Learning-rate schedule shape with phase boundaries.
- Warmup
3,000 steps, linear from 1e-4 × peak
Source: code · examples/k2-horizon-mova-36B-a4B.sh; OPTIM_CFGS
--optim.warmup 3000
Warmup length in steps or tokens.
- Batch size
16 × 8,192 per data-parallel rank; global batch not stated
Source: code · examples/k2-horizon-mova-36B-a4B.sh; variables and TRAINING_CFGS
BSZ=16
xLLM batch_size is per DP rank. The script's 38 nodes × 8 GPUs with model_parallel_size 2 give 152 ranks (~19.9M tokens/step), but 22.9T / 1.1M steps is ~20.8M, so the global batch is left unstated.
Global batch size, including any batch-size ramp: sequences × sequence length (token total), or the token total alone when only that is stated.
- Weight decay
0.06
Source: code · examples/k2-horizon-mova-36B-a4B.sh; variables
WD=0.06
Decoupled weight decay coefficient.
- Adam betas
(0.9, 0.95)
Source: code · examples/k2-horizon-mova-36B-a4B.sh; OPTIM_CFGS
--optim.beta1 0.9 --optim.beta2 0.95
(beta1, beta2) of the Adam-family optimizer or its AdamW fallback.
- Grad clip
1
Source: code · examples/k2-horizon-mova-36B-a4B.sh; OPTIM_CFGS
--optim.clip 1.0
Global gradient-norm clipping threshold.
- Training precision
BF16
Source: code · examples/k2-horizon-mova-36B-a4B.sh; TRAINING_CFGS
--dtype "bf16"
Matmul precision of pretraining (BF16, FP8 recipe, NVFP4 recipe) with the scaling granularity where disclosed. Never inferred from the released checkpoint dtype.
- Initialization
Gaussian, std 0.02
Source: code · examples/k2-horizon-mova-36B-a4B.sh; MODEL_CFGS
--model.init_mode "gaussian" --model.init_std 0.02
Matches config initializer_range 0.02, which by itself is a loader value.
Weight initialization (std or scheme) as stated by the publisher; config initializer_range alone is not evidence.
- Document masking
no attention across document boundaries (BOS-delimited segments)
Source: code · xllm/config.py; TrainerConf.multi_segments
This will prevent attention across document boundaries.
The launch script sets --multi_segments true.
Whether attention crosses document boundaries within a packed sequence.
- Data mix
Same pretraining tokens as K2 Horizon 3.7B, 7B and 32B; Midtraining Stage 4 shifts the mix toward agentic and reasoning SFT data
Source: blog · ifm.ai/blog/k2; Pre-training Dynamics
and 36B-A4B were trained on exactly the same 22 trillion tokens.
The blog says 22 trillion; the card's pretraining stage says 22.9T.
Pretraining data composition as disclosed (domain shares, synthetic fraction, repetition).
- Parallelism
TP2 · FSDP
Source: code · examples/k2-horizon-mova-36B-a4B.sh; DISTRIBUTED_CFGS
--model_parallel_size 2
xllm/config.py defines model_parallel_size as model/tensor parallel; the script sets --context_parallel_size 1 and --model.ddp_backend fsdp2.
Parallelism layout of the main pretraining run as stated, as degree-annotated terms in the order TP, PP, VPP, EP, CP, DP ("PP16 · EP64 · ZeRO-1 DP"); a term without a stated degree has none ("FSDP").
- Stages
pretraining
- Tokens
- 22900000000000
- Seq len
- 8192
- Steps
- 1100000
Source: model-card · README.md; Training Overview table
Pretraining | 1100000 | 22.9T | 8K | Pretraining.
midtraining-1
- Tokens
- 1100000000000
- Seq len
- 32768
- Steps
- 55000
Source: model-card · README.md; Training Overview table
Midtraining — Stage 1 | 55000 | 1.1T | 32K | Context extension.
Context extension.
midtraining-2
- Tokens
- 498000000000
- Seq len
- 131072
- Steps
- 25000
Source: model-card · README.md; Training Overview table
Midtraining — Stage 2 | 25000 | 498B | 128K | Context extension.
Context extension.
midtraining-3
- Tokens
- 110000000000
- Seq len
- 524288
- Steps
- 5500
Source: model-card · README.md; Training Overview table
Midtraining — Stage 3 | 5500 | 110B | 512K | Context extension.
Context extension.
midtraining-4
- Tokens
- 199000000000
- Seq len
- 524288
- Steps
- 10000
Source: model-card · README.md; Training Overview table
Midtraining — Stage 4 | 10000 | 199B | 512K | Continued context extension from Stage 3, with the data mix shifted toward agentic and reasoning SFT data.
Mix shifted toward agentic and reasoning SFT data; final checkpoint is tag mid_4_10000.
Source: model-card · README.md; Training Overview table
Ordered pretraining stages. Each item: name, tokens, seq_len, lr, batch_tokens, batch_sequences, steps, note, quote, and source when it differs from the fact's source.
Scaling & HP transfer
- Tokens / param
689.083
Calculated: train.tokens / params.total
train.tokens divided by params.total.
KV cache
- KV bytes / token
196,608 bytes
Calculated: kv.bytes_at_context / 131072 tokens; uniform BF16, payload only; quantization overhead excluded. Global KV: 48 × (2048 × 16/8) B/entry
Retained KV cache divided by context length, including bounded SWA caches and indexer keys. Exports use uniform BF16 at 131,072 tokens. The website can select uniform payload precision (no quantization overhead) or sourced component formats (including scales and documented padding). This is cache payload, not peak prefill memory or persistent prefix storage.
- Global KV bytes / token
196,608 bytes
Calculated: 196608 B / 1 tokens (Global KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 48 × (2048 × 16/8) B/entry
Long-context global KV bytes per token, including indexer keys; excludes bounded SWA caches. Compression rates and cross-layer cache reuse are included. Exports use uniform BF16; the website's storage selector also applies here. This is the field to compare with global-KV figures in reports, using the matching storage recipe.
- KV bytes / token / B active
49,152 bytes
Calculated: kv.bytes_per_token (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 48 × (2048 × 16/8) B/entry
kv.bytes_per_token divided by active parameters in billions (131,072 tokens in exports).
- KV at context / B active
6,442,450,944 bytes
Calculated: kv.bytes_at_context (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 48 × (2048 × 16/8) B/entry
kv.bytes_at_context divided by active parameters in billions (131,072 tokens in exports).
- KV at context
25,769,803,776 bytes
Calculated: 196608 B × 131072 (Global KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 48 × (2048 × 16/8) B/entry
Retained KV cache for one sequence at the selected context, including SWA windows and indexer keys. Exports use uniform BF16 at 131,072 tokens. Excludes recurrent state, compressor tail state, draft/MTP caches, temporary prefill tensors, allocator metadata and persistent prefix snapshots. Does not estimate peak prefill or total serving memory.
Evaluations
- AA Intelligence Index
25
Source: leaderboard · Artificial Analysis model page /models/k2-horizon-mova-36b-a4b, Wayback snapshot 2026-10-19
K2 Horizon MoVA 36B A4B scores 25 on the Artificial Analysis Intelligence Index
Score of K2-Horizon-MoVA-36B-A4B (SFT checkpoint sft_2_2500 on main, from the final Midtraining Stage 4 checkpoint), post-trained from this base. Variant: K2 Horizon MoVA 36B A4B. Index v4.3.2.
Artificial Analysis Intelligence Index v4.3.2 of the post-trained model, from a dated Wayback snapshot of its Artificial Analysis page. The note names the variant (reasoning setting).