archdb

LLM architectures and pretraining recipes, with sources.

K2-Horizon-375B-A23B (mid_4_6000)

MBZUAI IFM · base checkpoint

Describes tag mid_4_6000, the final Midtraining Stage 4 checkpoint (before RL and 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_ph2_240000, 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

375B parameters

Source: model-card · README.md; introduction
a sparse Mixture-of-Experts model that stores 375B parameters and runs 23B 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

23B parameters

Source: model-card · README.md; introduction
a sparse Mixture-of-Experts model that stores 375B parameters and runs 23B 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

379.2B parameters

Calculated: embedding + output head + all experts + other weights, IFM/K2-Horizon-375B-A23B@7d22cc0 safetensors headers; reproduces stated total (backbone) and active (non-embedding)

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

3.08B parameters

Calculated: input embedding + output head, IFM/K2-Horizon-375B-A23B@7d22cc0 safetensors headers

Input embedding plus output head (once if tied), counted from the checkpoint.

Non-emb. params (counted)

376.1B parameters

Calculated: dense + routed backbone weights; excludes input embedding, output head, lookup tables, MTP and other modalities, IFM/K2-Horizon-375B-A23B@7d22cc0 safetensors headers; reproduces stated total (backbone) and active (non-embedding)

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.

Largest layer (counted)

6.464B parameters

Calculated: max(sum of dense and routed weights sharing a full layers.<index> tensor path), all experts included, IFM/K2-Horizon-375B-A23B@7d22cc0 safetensors headers

Largest group of language-backbone weights sharing a full layers.<index> tensor path, including every routed expert. Excludes lookup/Engram tables, embeddings, output head, MTP and other modalities. Hybrid checkpoints may store mixers and FFNs as separate layers. All-gather volume also depends on wrapping, sharding and dtype.

Active non-emb. (counted)

23.59B parameters

Calculated: non-expert weights + routed experts × 8/192, excluding embedding and output head, IFM/K2-Horizon-375B-A23B@7d22cc0 safetensors headers; reproduces stated total (backbone) and active (non-embedding)

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.

Shape

Layers

61

Source: config · /num_hidden_layers

Number of transformer blocks in the main backbone (attention or token mixer plus FFN), excluding MTP modules.

d_model

6,144

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

100.721

Calculated: d_model / layers

Width-to-depth ratio, d_model divided by the number of blocks.

Attention

Token mixers

GQA

Source: config · config.json; num_attention_heads, num_key_value_heads
"num_key_value_heads": 8

48 query heads share 8 KV heads; sliding_window null, no MoVA experts (/mova_num_experts 0).

Token-mixing layer types in the backbone, e.g. GQA, MLA, SWA, Gated DeltaNet, Mamba-2, DSA (DeepSeek sparse attention).

Layer layout

61 GQA

Source: config · config.json; num_hidden_layers, use_sliding_window
"use_sliding_window": false

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

61

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

48

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

6,144

Calculated: heads × head_dim

attn.heads × attn.head_dim, the query projection width of global layers.

Q heads / KV head

6

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

partial RoPE (64 of 128 QK dims)

Source: code · modeling_k2_horizon.py; K2HorizonAttention.forward
split_size_or_sections=[self.rope_head_dim, self.head_dim - self.rope_head_dim],

rope_head_dim is config /rope_head_dim (64); the remaining 64 dims per head carry no position.

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

0.5

Inferred from the source; see the explanation below.

Source: config · config.json; rope_head_dim, head_dim
"rope_head_dim": 64

rope_head_dim 64 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.

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

16,384

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.66667

Calculated: ffn.dim / d_model

ffn.dim divided by shape.d_model.

Mixture of experts

Routed experts

192

Source: config · /num_experts

Routed experts per MoE layer.

Experts per token

8

Source: config · /num_experts_per_tok

Routed experts selected per token.

Shared experts

1

Source: config · /num_shared_experts

Always-on experts per MoE layer.

Expert dim

1,792

Source: config · /moe_intermediate_size

Intermediate width of one routed expert.

Shared expert dim

1,792

Source: code · modeling_k2_horizon.py; K2HorizonSparseMoeBlock.__init__
intermediate_size=config.moe_intermediate_size * config.num_shared_experts)

1792 × 1 shared expert.

Total intermediate width of the shared expert(s).

Leading dense layers

3

Source: config · /mlp_only_layers | len

Layers 0, 1, 2 use the 16384-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)

Source: code · xllm/models/transformer.py; ConfStore["k2-horizon-375B-a23B"]
num_experts=192, num_activated_experts=8, num_shared_experts=1, expert_inter_dim=1792, moe_router_score_func='sigmoid', moe_router_bias=True, moe_router_bias_update_rate=1e-3,

HF code adds gate.bias (config moe_gate_bias) to scores for selection only; whether the 375B run also used an auxiliary loss is not stated (config router_aux_loss_coef 1e-4 is a loader value).

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.291667

Calculated: moe.expert_dim / d_model

moe.expert_dim divided by shape.d_model.

Sparsity (experts / top-k)

24

Calculated: experts / top_k

Routed experts divided by experts selected per token.

Active / total

0.0613333

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 the checkpoint has no MTP weights.

Additional future tokens predicted during pretraining (0 when the model was trained without MTP).

Normalization and stability

Norm

RMSNorm

Source: code · modeling_k2_horizon.py; K2HorizonDecoderLayer.__init__
self.input_layernorm = K2HorizonRMSNorm(

layernorm_num_groups 1: one normalization group over d_model.

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 — Phase 1 | 211000 | 7.08T | 8K

Sequence length of the main pretraining stage.

Trained context

524.3K tokens

Source: model-card · README.md; Training Overview table
Midtraining — Stage 3 | 3500 | 117B | 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.09T) → 128K (503B) → 512K (117B, then 201B with agentic/reasoning SFT data)

Source: model-card · README.md; Training Overview table
Midtraining — Stage 1 | 32500 | 1.09T | 32K | Context extension.

RoPE base raised with length: config rope_theta 500000 at branch pretrain_ph2_240000, 1e6 at mid_1_32500, 1e7 from mid_2_15000; no RoPE scaling (rope_type default).

How context was extended (stages, RoPE base change, YaRN factor).

Pretraining recipe

Pretraining tokens

17.04T 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 quoted in train.stages (7.08T + 8.05T + 1.09T + 503B + 117B + 201B) through mid_4_6000; includes the 201B Stage 4 tokens with SFT data in the mix.

Tokens seen in pretraining including annealing and context extension, as reported.

Optimizer

Not disclosed

Optimizer used for the bulk of parameters.

Peak LR

Not disclosed

Peak learning rate of the main pretraining stage.

Final LR

Not disclosed

Learning rate at the end of the decay.

LR schedule

Not disclosed

Learning-rate schedule shape with phase boundaries.

Warmup

Not disclosed

Warmup length in steps or tokens.

Batch size

~33.5M tokens

Inferred from the source; see the explanation below.

Source: model-card · README.md; Training Overview table
Pretraining — Phase 2 | 240000 | 8.05T | 8K

8.05T / 240,000 steps (Phase 1: 7.08T / 211,000 steps gives the same); sequences per batch and any ramp not stated.

Global batch size, including any batch-size ramp: sequences × sequence length (token total), or the token total alone when only that is stated.

Batch (tokens)

33.5M tokens

Inferred from the source; see the explanation below.

Source: model-card · README.md; Training Overview table
Pretraining — Phase 2 | 240000 | 8.05T | 8K

8.05T tokens / 240,000 steps, to the card's 3-significant-figure precision.

Global batch size in tokens during the main pretraining stage, after any ramp (sequences × sequence length when stated in sequences, marked inferred).

Weight decay

Not disclosed

Decoupled weight decay coefficient.

Adam betas

Not disclosed

(beta1, beta2) of the Adam-family optimizer or its AdamW fallback.

Grad clip

Not disclosed

Global gradient-norm clipping threshold.

Training precision

Not disclosed

Matmul precision of pretraining (BF16, FP8 recipe, NVFP4 recipe) with the scaling granularity where disclosed. Never inferred from the released checkpoint dtype.

Data mix

Phase 2 continues on newer and better data; Midtraining Stage 4 shifts the mix toward agentic and reasoning SFT data

Source: model-card · README.md; Training Overview table
Continued context extension from Stage 3, with the data mix shifted toward agentic and reasoning SFT data.

Pretraining data composition as disclosed (domain shares, synthetic fraction, repetition).

Stages
  • pretraining-phase-1

    Tokens
    7080000000000
    Seq len
    8192
    Steps
    211000
    Source: model-card · README.md; Training Overview table
    Pretraining — Phase 1 | 211000 | 7.08T | 8K | Pretraining.
  • pretraining-phase-2

    Tokens
    8050000000000
    Seq len
    8192
    Steps
    240000
    Source: model-card · README.md; Training Overview table
    Pretraining — Phase 2 | 240000 | 8.05T | 8K | Continued pretraining from Phase 1, with newer and better data.

    Continued from Phase 1 with newer and better data.

  • midtraining-1

    Tokens
    1090000000000
    Seq len
    32768
    Steps
    32500
    Source: model-card · README.md; Training Overview table
    Midtraining — Stage 1 | 32500 | 1.09T | 32K | Context extension.

    Context extension.

  • midtraining-2

    Tokens
    503000000000
    Seq len
    131072
    Steps
    15000
    Source: model-card · README.md; Training Overview table
    Midtraining — Stage 2 | 15000 | 503B | 128K | Context extension.

    Context extension.

  • midtraining-3

    Tokens
    117000000000
    Seq len
    524288
    Steps
    3500
    Source: model-card · README.md; Training Overview table
    Midtraining — Stage 3 | 3500 | 117B | 512K | Context extension.

    Context extension.

  • midtraining-4

    Tokens
    201000000000
    Seq len
    524288
    Steps
    6000
    Source: model-card · README.md; Training Overview table
    Midtraining — Stage 4 | 6000 | 201B | 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_6000.

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

45.4427

Calculated: train.tokens / params.total

train.tokens divided by params.total.

Tokens / active param (non-embedding)

722.389

Calculated: train.tokens / params.counted_active_non_embedding

train.tokens divided by params.counted_active_non_embedding, or by the stated params.active_non_embedding when there is no validated checkpoint count.

KV cache

KV bytes / token

249,856 bytes

Calculated: kv.bytes_at_context / 131072 tokens; uniform BF16, payload only; quantization overhead excluded. Global KV: 61 × (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

249,856 bytes

Calculated: 249856 B / 1 tokens (Global KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 61 × (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

10,863 bytes

Calculated: kv.bytes_per_token (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 61 × (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

1,423,875,027 bytes

Calculated: kv.bytes_at_context (131072 tokens) / (params.active / 1e9); uniform BF16, payload only; quantization overhead excluded. Global KV: 61 × (2048 × 16/8) B/entry

kv.bytes_at_context divided by active parameters in billions (131,072 tokens in exports).

KV at context

32,749,125,632 bytes

Calculated: 249856 B × 131072 (Global KV); uniform BF16, payload only; quantization overhead excluded. Global KV: 61 × (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

31

Source: leaderboard · Artificial Analysis model page /models/k2-horizon-375b-a23b, Wayback snapshot 2026-10-19
K2 Horizon 375B A23B scores 31 on the Artificial Analysis Intelligence Index

Score of K2-Horizon-375B-A23B (RL and SFT from the final Midtraining Stage 4 checkpoint), post-trained from this base. Variant: K2 Horizon 375B A23B. 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).

All models · Link to this model