Paper Breakdowns  /  Kimi K2
Paper 42~8 min readMoonshot AI · 2025
Paper Breakdown

Kimi K2,
explained.

Two bets define this model. First: that a trillion-parameter MoE could be trained through 15.5T tokens without a single loss spike — on an optimizer most labs considered a research toy. Second: that the next era belongs to models trained for agents from the start — on synthesized tool-use episodes, not just text. Both bets landed, the weights went up for download, and "open model" stopped meaning "the one you settle for."

Written breakdown
This one is a written deep-dive.
Paper, mechanism, worked math and a runnable version — all below ↓
01

The shape: V3's skeleton, stretched to 1T

K2's architecture is a knowing descendant of DeepSeek-V3: a fine-grained mixture-of-experts with multi-head latent attention for a small KV cache — scaled up to ~1 trillion total parameters with only ~32B active per token. More, smaller experts (384 versus V3's 256) push sparsity further: an even bigger knowledge store, an even smaller per-token bill.

The sparsity scaling law behind that choice is the quiet thesis of the model: at fixed compute, more total parameters with fewer active keeps winning. K2 is what happens when a lab takes that curve seriously and rides it to thirteen digits.

02

Muon: the outsider optimizer goes to production

Every frontier model you'd heard of before K2 was trained with Adam-family optimizers. Muon — born in the open-source speedrunning community — updates weight matrices with orthogonalized momentum (via Newton-Schulz iterations), spending each update more evenly across a matrix's directions instead of letting a few dominant ones soak it up. The result: measurably more learning per token — exactly what matters when quality data, not compute, is the binding constraint.

The open question was whether Muon survived scale. Nobody had bet a trillion-parameter, multi-month run on it. Moonshot did — after finding and fixing the one thing that broke.

03

QK-clip: how 15.5T tokens passed without a spike

What broke was attention. In big runs, query-key dot products can grow until softmax saturates and the loss spikes — sometimes fatally, always expensively (rewind to checkpoint, skip data, pray). Muon's update geometry made these attention logit explosions worse, and at K2's scale a single bad spike could cost days.

MuonClip = Muon + QK-clip
Muon update
orthogonalized momentum
Watch max QK logit
per head
Over threshold?
rescale Wq · Wk
No spike, ever

QK-clip is the seatbelt: monitor each attention head's maximum logit, and when one crosses a threshold, rescale that head's query/key projection weights directly — at the source, in the weights, not with a bandage on the activations. The receipt is the single most striking line in the report: zero loss spikes across the entire 15.5T-token pretraining run. Boring, at trillion scale, is a superpower.

The key idea

Stability engineering IS capability engineering: every spike you don't have is data you don't skip and compute you don't rewind. MuonClip turned a research-grade optimizer into frontier infrastructure.

The clip itself is one rule. When a head's max logit crosses the threshold τ, rescale its query and key projections so their product — and thus the logit — is capped right at the source:

Left alone, a drifting logit blows up (softmax collapses to one-hot, gradients die); capped, attention stays differentiable. The runnable version below shows a logit exploding to millions vs held flat at τ.

04

Trained for agents, not adapted to them

Most models learn tool calling as a garnish: pretrain on text, sprinkle function-calling examples during fine-tuning. K2's subtitle — Open Agentic Intelligence — announces the opposite bet. Moonshot built a large-scale agentic data synthesis pipeline: thousands of real and synthetic tools, simulated multi-step episodes (plan → call → observe → recover → finish), user simulators to create realistic friction, and an LLM judge filtering the episodes for quality before they ever reach training.

On top: reinforcement learning on verifiable tasks — code that runs, answers that check — plus a critic for the fuzzy ones. The result is a model whose tool use feels native rather than prompted: it decomposes, calls, reads errors, and retries as learned behavior. This is the training-side mirror of everything the agent patterns world builds at inference time.

05

The numbers

ClaimEvidence
Scale~1T total params · ~32B active · 15.5T pretraining tokens
Stabilityzero loss spikes, entire run (MuonClip)
Agentic / codingtop of open models on SWE-bench-class and tool-use benchmarks at release; competitive with closed frontier
Opennessweights downloadable — the largest open agentic model of its moment

The benchmark story concentrated exactly where the training diet aimed: software engineering and multi-step tool tasks. On knowledge trivia it was merely very good; on doing things, it led the open field — which was precisely the point.

06

Why it matters

K2 validated two ideas the field now treats as obvious. Optimizers are not settled science: Muon at 1T ended Adam's decade of unquestioned default status and reopened optimizer research as a frontier lever. And agentic ability is a pretraining decision: synthesized tool-use at scale beats bolting function calling onto a text model — a lesson every serious lab's data pipeline absorbed within months.

Strategically, K2 extended what V3 started: open weights competing at the front, this time on the agent workloads that define the current product era. For builders it meant something concrete — the model driving your agent loop could now be one you download, inspect, fine-tune and serve yourself.

Read next

The architectural parent: DeepSeek-V3. The reasoning lineage: DeepSeek-R1. The behavior it was trained for: Toolformer and the Agent Patterns handbook.

RUN IT YOURSELF

Watch a logit explode — then get clipped

Kimi-K2's "zero loss spikes across 15.5T tokens" comes down to one guardrail. This simulates an attention logit drifting upward each step: left alone, it blows past a million and softmax collapses to a one-hot with zero gradient to the other keys — a dead, spike-prone head. QK-clip watches the max logit and, when it crosses the threshold, rescales the query/key weights so it's pinned right at τ — attention stays differentiable. Run it and compare the two columns, and the gradient signal each leaves alive. Change the threshold or the drift.

CPython · WebAssembly
Frequently asked

Quick answers

What is Kimi K2?

Moonshot AI's open-weight 1T-parameter MoE (~32B active), pretrained on 15.5T tokens and built explicitly for agentic work — tool calling, coding, multi-step tasks.

What is MuonClip?

The Muon optimizer plus QK-clip: rescale a head's query/key weights when attention logits grow too large. Result: zero loss spikes across the whole run.

How was it made agentic?

Large-scale synthesis of simulated multi-step tool-use episodes across thousands of tools, judge-filtered, plus RL on verifiable tasks — tool use as a first-class training objective.

Why does K2 matter?

It proved Muon works at trillion scale, made agentic ability a pretraining concern, and put frontier-class agent weights in the open.

Finished this one? 0 / 111 Paper Breakdowns done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.

More Paper Breakdowns