archdb

LLM architectures and pretraining recipes, with sources.

Kimi-K2-Base

Moonshot AI · base checkpoint

Open in the comparison table Hugging Face ↗ Paper ↗

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

2025-07-11

Source: blog · kimi.com blog index (Wayback 2026-08-17); Kimi K2 entry
Kimi K2 2025-07-11

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

other (modified-mit)

Source: model-card · README.md; YAML front matter
license_name: modified-mit

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.

Parameters

Total params

1.04T parameters

Source: paper · p.6 §2.3, Table 2
Kimi K2 is a 1.04 trillion-parameter Mixture-of-Experts (MoE) transformer model

Abstract and card round to 1T.

Total parameter count as reported by the publisher. See params.note for whether embeddings, MTP heads or vision towers are included.

Active params

32.6B parameters

Source: paper · p.6 §2.3, Table 2
Activated Parameters 37B 32.6B

Abstract and card round to 32B.

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

1.026T parameters

Calculated: embedding + output head + all experts + other weights, moonshotai/Kimi-K2-Base@ce72df0 safetensors headers; reproduces stated total (backbone) and active (with embedding and output head)

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

2.349B parameters

Calculated: input embedding + output head, moonshotai/Kimi-K2-Base@ce72df0 safetensors headers

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

Non-emb. params (counted)

1.024T parameters

Calculated: dense + routed backbone weights; excludes input embedding, output head, lookup tables, MTP and other modalities, moonshotai/Kimi-K2-Base@ce72df0 safetensors headers; reproduces stated total (backbone) and active (with embedding and output head)

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)

17.06B parameters

Calculated: max(sum of dense and routed weights sharing a full layers.<index> tensor path), all experts included, moonshotai/Kimi-K2-Base@ce72df0 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)

30.51B parameters

Calculated: non-expert weights + routed experts × 8/384, excluding embedding and output head, moonshotai/Kimi-K2-Base@ce72df0 safetensors headers; reproduces stated total (backbone) and active (with embedding and output head)

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

Table 2 figures; abstract rounds to 1T total / 32B active.

Source: paper · p.1 Abstract
32 billion activated parameters and 1 trillion total parameters

What the publisher's counts include or exclude (MTP modules, embeddings, vision encoder, n-gram tables).

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

7,168

Source: config · /hidden_size

Residual stream width.

Vocab

163,840

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

117.508

Calculated: d_model / layers

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

Attention

Token mixers

MLA

Source: paper · p.6 §2.3
employing Multi-head Latent Attention (MLA) [44] as the attention mechanism

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

Layer layout

61 MLA

Source: paper · p.6 §2.3, Table 2
#Layers 61 61

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

64

Source: config · /num_attention_heads

Query heads in the global-attention layers.

Heads × head dim

12,288

Calculated: heads × head_dim

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

QK head dim

192

Source: config · /qk_nope_head_dim + /qk_rope_head_dim

Query/key dimension per head in global-attention layers (for MLA, nope + rope dims).

V head dim

128

Source: config · /v_head_dim

Value dimension per head in global layers (MLA v_head_dim; stated for MLA even when equal to the QK head dim).

MLA KV latent

512

Source: config · /kv_lora_rank

Width of the compressed KV latent that MLA caches per token per layer.

MLA Q latent

1,536

Source: config · /q_lora_rank

Width of the low-rank query projection in MLA; 0 when queries use a full-rank projection.

Decoupled RoPE dim

64

Source: config · /qk_rope_head_dim

Width of the shared positional key that MLA caches next to the latent.

Positional encoding

partial RoPE (MLA decoupled, 64 of 192 QK dims)

Source: code · modeling_deepseek.py; DeepseekV3Attention.forward
q_pe, k_pe = apply_rotary_pos_emb(q_pe, k_pe, cos, sin, position_ids)

Positional scheme in global layers: RoPE, partial RoPE, NoPE, or mixed per layer type.

RoPE base

50,000

Source: config · /rope_theta

RoPE base frequency of the global layers at release.

QK norm

No

Source: code · modeling_deepseek.py; DeepseekV3Attention.forward
torch.matmul(query_states, key_states.transpose(2, 3)) * self.softmax_scale

RMSNorm only on the Q and KV latents before up-projection; no per-head Q/K norm. Training bounded logits with QK-Clip weight clipping instead (see train.optimizer).

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_deepseek.py; DeepseekV3MLP.forward
down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))

act_fn is SiLU (config hidden_act).

FFN activation (SwiGLU, GeGLU, ...).

Dense FFN dim

18,432

Source: config · /intermediate_size

Intermediate width of the dense FFN layers that are actually executed.

FFN bias

No

Source: code · modeling_deepseek.py; DeepseekV3MLP.__init__
self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)

FFN projections have bias terms.

Dense FFN / d_model

2.57143

Calculated: ffn.dim / d_model

ffn.dim divided by shape.d_model.

Mixture of experts

Routed experts

384

Source: config · /n_routed_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 · /n_shared_experts

Always-on experts per MoE layer.

Expert dim

2,048

Source: config · /moe_intermediate_size

Intermediate width of one routed expert.

Shared expert dim

2,048

Inferred from the source; see the explanation below.

Source: code · modeling_deepseek.py; DeepseekV3MoE.__init__
intermediate_size = config.moe_intermediate_size * config.n_shared_experts

2048 × 1 shared expert.

Total intermediate width of the shared expert(s).

Leading dense layers

1

Source: paper · p.6 §2.3, Table 2
Number of Dense Layers 3 1

config first_k_dense_replace = 1, moe_layer_freq = 1.

Number of initial blocks that use a dense FFN instead of MoE.

Router score

sigmoid

Source: config · /scoring_func

Gating function over expert logits (softmax, sigmoid).

Load balancing

aux-loss-free selection bias (e_score_correction_bias added to sigmoid scores for top-k only)

Source: code · modeling_deepseek.py; MoEGate.forward
scores_for_choice = scores.view(bsz * seq_len, -1) + self.e_score_correction_bias.unsqueeze(0)

config topk_method = noaux_tc; the K2 report does not describe the bias update rule or any auxiliary loss.

Load-balancing method, with coefficients where disclosed.

Routed scaling factor

2.827

Source: config · /routed_scaling_factor

MoEGate.forward multiplies the renormalized top-k weights by it.

Multiplier applied to the combined routed-expert output (routed_scaling_factor).

Renormalize top-k

Yes

Source: config · /norm_topk_prob

Applied in MoEGate.forward before the routed scaling factor.

Selected expert weights are renormalized to sum to 1.

Group-limited routing

none

Source: paper · p.6 §2.3, Table 2
Expert Grouping Yes No

DeepSeek-V3 column says Yes, Kimi K2 says No; config n_group = topk_group = 1.

Expert groups and groups selected per token, or node-limited routing, when used.

Expert dim / d_model

0.285714

Calculated: moe.expert_dim / d_model

moe.expert_dim divided by shape.d_model.

Sparsity (experts / top-k)

48

Calculated: experts / top_k

Routed experts divided by experts selected per token.

Active / total

0.0313462

Calculated: params.active / params.total

params.active divided by params.total.

Multi-token prediction

MTP depth

1

Source: paper · K3 report p.11 §3.2, Table 1 (Kimi K2 column)
Number of MTP Layers 1 layer 1 layer

The K2 report does not mention MTP.

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

MTP modules

1

Source: paper · K3 report p.11 §3.2, Table 1 (Kimi K2 column)
Number of MTP Layers 1 layer 1 layer

MTP modules with distinct weights. 1 with mtp.depth > 1 means one module is applied recursively.

MTP module

Not disclosed

Contents of one MTP module (mixer and FFN type, norms, how the previous hidden state and next-token embedding are combined).

MTP FFN

Not disclosed

FFN in the MTP module: 'dense' or 'MoE', with its width when it differs from the backbone.

MTP shares embedding/head

Not disclosed

MTP modules use the main model's input embedding and output head.

MTP loss weight

Not disclosed

Weight of the MTP loss, including its schedule.

MTP weights released

No

Source: config · /weight_map | has eh_proj

Backbone layers 0–60 only; config /num_nextn_predict_layers 0.

The released checkpoint contains the MTP module weights.

Normalization and stability

Norm

RMSNorm

Source: code · modeling_deepseek.py; DeepseekV3DecoderLayer.__init__
self.input_layernorm = DeepseekV3RMSNorm(

Normalization layer type in the blocks.

Norm placement

pre

Source: code · modeling_deepseek.py; DeepseekV3DecoderLayer.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

4.096K tokens

Source: paper · p.9 §2.5
We pre-trained the model with a 4,096-token context window

Sequence length of the main pretraining stage.

Trained context

32.77K tokens

Source: paper · p.9 §2.5
followed by an additional 60 billion tokens with a 32k sequence length

Longest length the K2 report states was trained; 128K is reached by YaRN. The K3 report (Table 1) lists K2 training context as 128K.

Longest sequence length trained on after context extension.

Advertised context

131.1K tokens

Source: paper · p.9 §2.5
To extend the context window to 128k, we employed the YaRN method

config max_position_embeddings = 131072.

Longest context the publisher says the model supports, possibly beyond trained length via RoPE scaling.

Extension method

4K → 32K (60B tokens), then YaRN to 128K

Source: paper · p.9 §2.5
followed by an additional 60 billion tokens with a 32k sequence length. To extend the context window to 128k, we employed the YaRN method [55].

Release rope_scaling: type yarn, factor 32 over original_max_position_embeddings 4096, beta_fast = beta_slow = 1, mscale = mscale_all_dim = 1 (softmax scale × (0.1·ln 32 + 1)² in DeepseekV3Attention).

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

Pretraining recipe

Pretraining tokens

15.5T tokens

Source: paper · p.9 §2.5
We pre-trained the model with a 4,096-token context window using the MuonClip optimizer (Algorithm 1) and the WSD learning rate schedule [25], processing a total of 15.5T tokens.

15.5T = 10T constant + 5.5T cosine; the 400B anneal and 60B long-context tokens are reported separately.

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

Optimizer

MuonClip (Muon + weight decay + RMS matching + QK-Clip, τ=100)

Source: paper · p.4 §2.1
we train Kimi K2, a large-scale MoE model, using MuonClip with τ = 100

Optimizer used for the bulk of parameters.

Peak LR

0.0002

Source: paper · p.9 §2.5
The first 10T tokens were trained with a constant learning rate of 2e-4 after a 500-step warm-up, followed by 5.5T tokens with a cosine decay from 2e-4 to 2e-5.

Peak learning rate of the main pretraining stage.

Final LR

7e-06

Source: paper · p.9 §2.5
the learning rate was decayed from 2e-5 to 7e-6.

Learning rate at the end of the decay.

LR schedule

WSD: 500-step warmup, constant 2e-4 for 10T, cosine to 2e-5 over 5.5T, then 2e-5 → 7e-6 over the 400B (4K) + 60B (32K) annealing/long-context phase

Source: paper · p.9 §2.5
the WSD learning rate schedule [25], processing a total of 15.5T tokens.

Learning-rate schedule shape with phase boundaries.

Warmup

500 steps

Source: paper · p.9 §2.5
after a 500-step warm-up

Warmup length in steps or tokens.

Batch size

67M tokens, constant

Source: paper · p.9 §2.5
the global batch size was held at 67M tokens.

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)

67M tokens

Source: paper · p.9 §2.5
the global batch size was held at 67M tokens.

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

Weight decay

0.1

Source: paper · p.9 §2.5
Weight decay was set to 0.1 throughout

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

No FP8 compute; MoE up-projection and SwiGLU inputs stored as FP8-E4M3 (1×128 tiles, FP32 scales)

Source: paper · p.8 §2.4.3
Inputs of MoE up-projections and SwiGLU are compressed to FP8-E4M3 in 1× 128 tiles with FP32 scales. Small-scale experiments show no measurable loss increase. Due to potential risks of performance degradation that we observed during preliminary study, we do not apply FP8 in computation.

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

Stability measures

QK-Clip (MuonClip), τ=100, per head; MLA: head-specific q/k content weights × √γ, q rope weights × γ, shared k rope untouched; 12.7% of heads triggered at least once in the first 70k steps, inactive afterwards

Source: paper · p.30 App. D
Initial 70000 steps: 12.7% of attention heads triggered QK-Clip for at least once, clamping Smax to 100.

Per-head weight rescaling is Algorithm 1 (p.4 §2.1); no loss spikes over the run (Figure 3).

Interventions used during pretraining to keep it stable (QK-clip, z-loss, logit caps, spike handling), with coefficients.

Data mix

15.5T tokens of Web Text, Code, Mathematics, Knowledge; knowledge corpora rephrased by LLM (each at most twice), math rewritten as learning notes and translated to English

Source: paper · p.5–6 §2.2
We extended this method to other large-scale knowledge corpora and observed similarly encouraging results, and each corpora is rephrased at most twice.

Domains: p.6 §2.2 "Pre-training Data Overall"; math rewriting follows SwallowMath.

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

Hardware

NVIDIA H800, 8 GPUs per node, 8×400 Gbps RoCE between nodes

Source: paper · p.7 §2.4.1
Kimi K2 was trained on a cluster equipped with NVIDIA H800 GPUs.

Accelerators used for pretraining, count and duration where stated.

Accelerators

H800

Source: paper · p.7 §2.4.1
Kimi K2 was trained on a cluster equipped with NVIDIA H800 GPUs.

Count not stated.

Accelerator count and type for the main pretraining run, as the count with thousands separators and the chip's short name ("2,048 H800", "2,048 GH200"). A stated range or bound stays as stated ("2,048–4,096 GH200").

Parallelism

PP16 · VPP · EP16 · ZeRO-1 DP

Source: paper · p.8 §2.4.2
Pipeline Parallelism (PP) with virtual stages [28, 53, 38, 57, 47, 21], 16-way Expert Parallelism (EP) [39], and ZeRO-1 Data Parallelism [60].

The PP degree ends the previous line, which Figure 7 separates from the quote: 'a combination of 16-way'; VPP degree not stated.

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
  • main

    Tokens
    15500000000000
    Seq len
    4096
    Lr
    0.0002
    Source: paper · p.9 §2.5
    The first 10T tokens were trained with a constant learning rate of 2e-4 after a 500-step warm-up, followed by 5.5T tokens with a cosine decay from 2e-4 to 2e-5.

    Constant 2e-4 for 10T tokens, then cosine to 2e-5 over 5.5T.

  • anneal

    Tokens
    400000000000
    Seq len
    4096
    Lr
    2e-05
    Source: paper · p.9 §2.5
    the model was trained on 400 billion tokens with a 4k sequence length

    LR decays from 2e-5 to 7e-6 across the anneal and long-context stages.

  • long-context

    Tokens
    60000000000
    Seq len
    32768
    Source: paper · p.9 §2.5
    followed by an additional 60 billion tokens with a 32k sequence length
Source: paper · p.9 §2.5

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

Scaling ladder

small-scale Muon MoE runs: sparsity 8–64 at 8 active + 1 shared expert; heads = layers vs 2× layers at 1.2e20–9.0e20 FLOPs

Source: paper · p.6–7 §2.3, Figures 5–6
Through carefully controlled small-scale experiments, we observe that — under a fixed number of activated parameters (i.e., constant FLOPs) — increasing the total number of experts (i.e., increasing sparsity) consistently lowers both the training and validation loss

Sparsity levels and FLOPs budgets from the Figure 5–6 legends; model sizes are not given.

Smaller models trained to choose the architecture or recipe (sizes, token budgets), as disclosed.

Tokens / param

14.9038

Calculated: train.tokens / params.total

train.tokens divided by params.total.

Tokens / active param (non-embedding)

507.985

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

70,272 bytes

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

70,272 bytes

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

2,156 bytes

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

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

KV at context / B active

282,536,552 bytes

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

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

KV at context

9,210,691,584 bytes

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

13

Source: leaderboard · Artificial Analysis model page /models/kimi-k2, Wayback snapshot 2026-10-19
Kimi K2 scores 13 on the Artificial Analysis Intelligence Index

Score of Kimi-K2-Instruct, post-trained from this base. Variant: Kimi K2. 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