← 返回目录
arxiv:2507.20534 · 32 页 · 1 张图

Kimi K2: Open Agentic Intelligence

轨道 B 优先级 read W7 Tech ReportMuon 原文 ↗ PDF ↗
📝 论文一图速览(Claude Opus 4.7 填写)

一句话总结:Kimi K2 是一款 1T 总参 / 32B 激活的开源 MoE 大模型,主打 agentic 与 tool use 能力——预训练侧首次把 Muon 优化器规模化到万亿级别(用 QK-Clip 解决 attention logits 爆炸),后训练侧用大规模 agentic 数据合成 + verifiable rewards / self-critic RL,在 SWE-bench、Tau2、AceBench 等代理类任务上达到开源 SOTA。

🎯 面试考点(高频):

  1. Muon vs AdamW:Muon 用 Newton–Schulz 对动量矩阵 $M_t$ 做正交化再更新——$W_t = W_{t-1} - \eta\,(\mathrm{NS}(M_t)\cdot\sqrt{\max(n,m)}\cdot 0.2 + \lambda W_{t-1})$,在同算力下 token 效率显著优于 AdamW;但仅对 2D 权重矩阵生效,embedding/LayerNorm 仍走 AdamW。
  2. 1T MoE 架构选型:DeepSeek-V3 同款骨架,但 sparsity 拉到 48(384 选 8,V3 是 256 选 8),attention heads 砍半到 64——以 0.5–1.2% 的 loss 代价,把 128k 推理 FLOPs 降 83%,体现"长上下文 agent 场景 inference 优先"取舍。
  3. Muon stability tricks(QK-Clip):Muon 训练易出现 attention logits 爆炸(超 1000),论文提出"训后按头重缩放 $W_q, W_k$":若 $S^h_{\max} = \tfrac{1}{\sqrt d}\max QK^\top > \tau$(取 $\tau=100$),则按 $\gamma^h = \tau / S^h_{\max}$ 在前/后向之外rescale 权重——15.5T tokens 零 loss spike。
  4. Tool-calling 训练数据怎么造:三段式合成 pipeline——① 3000+ 真实 MCP 工具 + 20000+ LLM 进化合成工具;② 每个 toolset 生成 agent + 带 rubric 的 task;③ LLM 模拟 user / tool-env / judge 多轮交互,合格轨迹入 SFT。Coding/SWE 任务则用 K8s 沙箱跑真实代码 + 单元测试做 ground truth。
  5. RL 目标函数:在 K1.5 基础上做 group-relative 优势 + KL 正则:$\mathcal{L}_{\mathrm{RL}}(\theta) = \mathbb{E}_{x\sim\mathcal{D}}\Big[\tfrac{1}{K}\sum_i \big(r(x,y_i) - \bar r(x) - \tau \log\tfrac{\pi_\theta(y_i|x)}{\pi_{\mathrm{old}}(y_i|x)}\big)^2\Big]$;扩展了 budget control(截断 + 罚)、PTX loss(防遗忘)、温度退火(探索→利用)。
  6. Self-Critique Rubric Reward:对无 verifiable reward 的开放式任务(写作、问答),让 K2 自己当 critic 做 pairwise 比较;critic 用 RLVR 的可验证 on-policy rollout 不断校准,把客观信号"蒸馏"进主观评分。
  7. Agentic benchmark 对比:SWE-bench Verified 65.8(多次 71.6,逼近 Claude 4 Sonnet 72.7),SWE-bench Multilingual 47.3,Tau2 micro 66.1,AceBench(en) 76.5——非 thinking 设定下开源 SOTA、整体跻身 Claude 4 Opus / Sonnet 之列。
  8. 对工业训练的启示:① token efficiency 是新的 scaling 系数,Muon + 改写式合成数据(WRAP 风格 + 长文 chunk-wise 改写)联合提升 per-token 信号;② 训推一体(colocated RL)+ checkpoint engine 让 1T 模型 30s 内完成参数同步,这是 agentic 长 rollout 能跑起来的关键工程支撑。
📌 我对这篇的学习方针
Muon 优化器(面试热点!) + agentic intelligence
📚 章节目录

🖼 图表速览 (1 张) · 点击放大

fig_1
fig_1 · p.1 · 1024×1024
Figure 1: Kimi K2 main results.2

① 图说明:这张 1024×1024 的图实际上是 Kimi K2 的品牌 logo——黑色背景上的一颗四角星(类似 Gemini 风格的"sparkle"),四个尖角分别为(上)、(右)、绿(下)、(左),内部呈柔和径向渐变。JSON 解析器给的 caption 是 Figure 1: Kimi K2 main results(并带一个尾巴 ".2",疑似页脚噪声),但 PDF 抽取阶段只保留了页 1 顶部的 logo 像素,真正的"主结果条形图"以纯文本数字形式留在 §1 正文里——见下面 ② 中的数字。

② 关键数据(来自论文 §4 评测,与 logo 旁边的条形图对应):非 thinking 设定下,Kimi-K2-Instruct 对照 DeepSeek-V3-0324 / Qwen3-235B-A22B / GPT-4.1 / Claude 4 Opus 与 Sonnet / Gemini 2.5 Flash,三大赛道成绩为——Agentic & Coding:SWE-bench Verified 65.8(多次 71.6) / SWE-bench Multilingual 47.3 / LiveCodeBench v6 53.7 / OJBench 27.1;Tool Use:τ2-Bench micro 66.1 / AceBench(en) 76.5;Math & STEM:AIME 2025 49.5 / GPQA-Diamond 75.1 / MATH-500、HMMT、PolyMath 等均开源领先。

③ 启示:① 从工程角度,这张图"是一颗星"也很说明问题——技术报告页 1 的视觉锚点是品牌 logo,把数字结果留给正文表格;② 从论文定位角度,Kimi K2 立的"人设"很明确:开源世界第一个把 agentic(工具调用 + SWE)做到逼近闭源前沿的 base model;③ 所有数字都是 non-thinking 取得,意味着分数不靠 CoT 长推理,而是源自 1T MoE 容量 + Muon 的 token 效率 + 大规模合成 tool-use 轨迹 + RL 的复合产物。它不和 R1 / o3 / Claude-thinking 抢推理王座,而是抢"工程上能跑 agent"的事实标准。

📖 论文正文(英文,按章节折叠)

Preamblep.1

KIMI K2: OPEN AGENTIC INTELLIGENCE.

TECHNICAL REPORT OF KIMI K2.

Kimi Team.

(Published as a technical report; arXiv:2507.20534; July 2025.)

(Open weights and post-trained checkpoints released to facilitate future research and applications of agentic intelligence.)

《Kimi K2:开源 Agentic Intelligence》。

Kimi K2 技术报告。

Kimi 团队。

(作为技术报告发布;arXiv:2507.20534;2025 年 7 月。)

(开放权重与后训练 checkpoint,以推动未来 agentic intelligence 方向的研究与应用。)

Abstract / 摘要p.1

We introduce Kimi K2, a Mixture-of-Experts (MoE) large language model with 32 billion activated parameters and 1 trillion total parameters. We propose the MuonClip optimizer, which improves upon Muon with a novel QK-clip technique to address training instability while enjoying the advanced token efficiency of Muon. Based on MuonClip, K2 was pre-trained on 15.5 trillion tokens with zero loss spike. During post-training, K2 undergoes a multi-stage post-training process, highlighted by a large-scale agentic data synthesis pipeline and a joint reinforcement learning (RL) stage, where the model improves its capabilities through interactions with real and synthetic environments.

Kimi K2 achieves state-of-the-art performance among open-source non-thinking models, with strengths in agentic capabilities. Notably, K2 obtains 66.1 on Tau2-Bench, 76.5 on ACEBench (En), 65.8 on SWE-Bench Verified, and 47.3 on SWE-Bench Multilingual — surpassing most open and closed-sourced baselines in non-thinking settings. It also exhibits strong capabilities in coding, mathematics, and reasoning tasks, with a score of 53.7 on LiveCodeBench v6, 49.5 on AIME 2025, 75.1 on GPQA-Diamond, and 27.1 on OJBench, all without extended thinking. These results position Kimi K2 as one of the most capable open-source large language models to date, particularly in software engineering and agentic tasks. We release our base and post-trained model checkpoints to facilitate future research and applications of agentic intelligence.

我们介绍 Kimi K2:一款 Mixture-of-Experts(MoE)大型语言模型,激活参数 320 亿、总参数 1 万亿。我们提出 MuonClip 优化器——通过一种新颖的 QK-clip 技术对 Muon 加以改进,在保留 Muon 优越 token 效率的同时,解决其训练不稳定问题。基于 MuonClip,K2 在 15.5 万亿 tokens 上完成了零 loss spike 的预训练。在后训练阶段,K2 经历了一套多阶段流程,其中最关键的两点是:一条大规模 agentic 数据合成 pipeline,以及一个联合强化学习(RL)阶段——模型通过与真实与合成环境的交互来提升能力。

Kimi K2 在开源非 thinking 模型中达到 SOTA,尤其以 agentic 能力见长。值得指出:K2 在 Tau2-Bench 上得 66.1,在 ACEBench(En)上 76.5,在 SWE-Bench Verified 上 65.8,在 SWE-Bench Multilingual 上 47.3——在非 thinking 设定下超过绝大多数开源与闭源基线。它在编程、数学与推理任务上同样表现强劲:LiveCodeBench v6 得 53.7、AIME 2025 得 49.5、GPQA-Diamond 得 75.1、OJBench 得 27.1,且全部都不使用扩展思考。这些结果把 Kimi K2 推上目前最强开源大模型之一的位置,尤其是在软件工程与 agentic 任务上。我们开源 base 与 post-trained 模型 checkpoint,以促进未来的 agentic intelligence 研究与应用。

§1 Introduction / 引言p.2

The development of Large Language Models (LLMs) is undergoing a profound paradigm shift towards Agentic Intelligence — the capabilities for models to autonomously perceive, plan, reason, and act within complex and dynamic environments. This transition marks a departure from static imitation learning towards models that actively learn through interactions, acquire new skills beyond their training distribution, and adapt behavior through experiences. It is believed that this approach allows an AI agent to go beyond the limitation of static human-generated data, and acquire superhuman capabilities through its own exploration and exploitation. Agentic intelligence is thus rapidly emerging as a defining capability for the next generation of foundation models, with wide-ranging implications across tool use, software development, and real-world autonomy.

Achieving agentic intelligence introduces challenges in both pre-training and post-training. Pre-training must endow models with broad general-purpose priors under constraints of limited high-quality data, elevating token efficiency — learning signal per token — as a critical scaling coefficient. Post-training must transform those priors into actionable behaviors, yet agentic capabilities such as multi-step reasoning, long-term planning, and tool use are rare in natural data and costly to scale. Scalable synthesis of structured, high-quality agentic trajectories, combined with general reinforcement learning (RL) techniques that incorporate preferences and self-critique, are essential to bridge this gap.

大型语言模型(LLM)的发展正经历一次深刻的范式迁移,迈向 Agentic Intelligence——也就是模型在复杂且动态环境中自主感知、规划、推理并行动的能力。这一转变意味着从静态的模仿学习走向"通过交互主动学习、获得训练分布之外的新技能、并通过经验调整行为"的模型范式。人们相信这一路线能让 AI agent 跳出"静态人类数据"的限制,通过自身的探索与利用获得超越人类的能力。因此,agentic intelligence 正迅速成为下一代 foundation model 的核心特征,在 tool use、软件开发、真实世界自动化等方向产生广泛影响。

实现 agentic intelligence 同时给预训练与后训练带来挑战。预训练必须在高质量数据有限的约束下,赋予模型广泛的通用先验,使"token 效率——每个 token 所产生的学习信号"上升为一个关键的 scaling 系数。后训练则要把这些先验转化为可执行的行为;然而 agentic 能力(如多步推理、长程规划、tool use)在自然数据中很稀缺,规模化又昂贵。可规模化合成结构化、高质量的 agentic 轨迹,再叠加结合偏好与 self-critique 的通用强化学习(RL),是弥合这一鸿沟的关键。

In this work, we introduce Kimi K2, a 1.04 trillion-parameter Mixture-of-Experts (MoE) LLM with 32 billion activated parameters, purposefully designed to address the core challenges and push the boundaries of agentic capability. Our contributions span both the pre-training and post-training frontiers: (i) We present MuonClip, a novel optimizer that integrates the token-efficient Muon algorithm with a stability-enhancing mechanism called QK-Clip. Using MuonClip, we successfully pre-trained Kimi K2 on 15.5 trillion tokens without a single loss spike. (ii) We introduce a large-scale agentic data synthesis pipeline that systematically generates tool-use demonstrations via simulated and real-world environments. This system constructs diverse tools, agents, tasks, and trajectories to create high-fidelity, verifiably correct agentic interactions at scale. (iii) We design a general reinforcement learning framework that combines verifiable rewards (RLVR) with a self-critique rubric reward mechanism. The model learns not only from externally defined tasks but also from evaluating its own outputs, extending alignment from static into open-ended domains.

Kimi K2 demonstrates strong performance across a broad spectrum of agentic and frontier benchmarks. It achieves scores of 66.1 on Tau2-bench, 76.5 on ACEBench (en), 65.8 on SWE-bench Verified, and 47.3 on SWE-bench Multilingual, outperforming most open- and closed-weight baselines under non-thinking evaluation settings, closing the gap with Claude 4 Opus and Sonnet. In coding, mathematics, and broader STEM domains, Kimi K2 achieves 53.7 on LiveCodeBench v6, 27.1 on OJBench, 49.5 on AIME 2025, and 75.1 on GPQA-Diamond. On the LMSYS Arena leaderboard (July 17, 2025), Kimi K2 ranks as the top-1 open-source model and 5th overall based on over 3,000 user votes.

本工作介绍 Kimi K2——一个 1.04 万亿参数的 Mixture-of-Experts(MoE)LLM,激活参数 320 亿,专门为应对上述核心挑战、推开 agentic 能力的边界而设计。我们的贡献横跨预训练与后训练两条前线:① 我们提出 MuonClip,这是一种把 token-efficient 的 Muon 算法与稳定性增强机制 QK-Clip 整合在一起的新优化器。借助 MuonClip,我们在 15.5 万亿 tokens 上成功预训练 Kimi K2,且整个过程没有一次 loss spike;② 我们提出大规模 agentic 数据合成 pipeline,通过仿真与真实环境系统性生成 tool-use 示范——构造多样的工具、agent、任务与轨迹,大规模产出高保真、可验证正确的 agentic 交互;③ 我们设计了一套通用 RL 框架,将 verifiable rewards(RLVR)与 self-critique rubric 奖励机制结合起来:模型不仅从外部定义的任务学习,也通过评估自身输出来学习,从而把对齐从静态扩展到开放式领域。

Kimi K2 在广泛的 agentic 与前沿 benchmark 上表现强劲:在 Tau2-bench 上 66.1,ACEBench(en)76.5,SWE-bench Verified 65.8,SWE-bench Multilingual 47.3——在非 thinking 评测设定下超过大多数开源与闭源基线,逼近 Claude 4 Opus 与 Sonnet。在编程、数学及更广义 STEM 领域,Kimi K2 取得 LiveCodeBench v6 53.7、OJBench 27.1、AIME 2025 49.5、GPQA-Diamond 75.1。在 2025 年 7 月 17 日的 LMSYS Arena 排行榜上,基于 3000+ 真实用户投票,Kimi K2 是开源第一、综合排名第 5。

§2.1 MuonClip / Muon 优化器与 QK-Clipp.3

We train Kimi K2 using the token-efficient Muon optimizer, incorporating weight decay and consistent update RMS scaling. Experiments in our previous work Moonlight show that, under the same compute budget and model size — and therefore the same amount of training data — Muon substantially outperforms AdamW, making it an effective choice for improving token efficiency in large language model training. Despite its efficiency, scaling up Muon training reveals a challenge: training instability due to exploding attention logits, an issue that occurs more frequently with Muon but less with AdamW in our experiments. Existing mitigation strategies are insufficient: logit soft-cap directly clips the attention logits, but the dot products between queries and keys can still grow excessively before capping; Query-Key Normalization (QK-Norm) is not applicable to multi-head latent attention (MLA), because its Key matrices are not fully materialized during inference.

The Muon update for a 2D weight matrix $W \in \mathbb{R}^{n\times m}$ at step $t$ can be written as:

$$M_t = \mu\,M_{t-1} + G_t, \qquad O_t = \mathrm{NewtonSchulz}(M_t)\cdot\sqrt{\max(n,m)}\cdot 0.2, \qquad W_t = W_{t-1} - \eta\,\bigl(O_t + \lambda\,W_{t-1}\bigr),$$

where $G_t$ is the gradient of $W_t$, $\mu$ is momentum, $\eta$ is learning rate, and $\lambda$ is weight decay. The Newton–Schulz step orthogonalizes the momentum matrix, and the factor $\sqrt{\max(n,m)}\cdot 0.2$ rescales the update so that its RMS matches the Adam-style update.

我们用 token-efficient 的 Muon 优化器训练 Kimi K2,并加入 weight decay 与一致的 update RMS scaling。我们此前工作 Moonlight 的实验表明:在同等算力预算与模型规模下(因此训练数据量也相同),Muon 显著优于 AdamW,是提升大语言模型训练 token 效率的有效选择。但 Muon 在放大训练规模时暴露出一个挑战——attention logits 爆炸引发训练不稳定,这一问题在我们的实验中 Muon 比 AdamW 更频繁。已有的缓解手段并不充分:logit soft-cap 直接对 attention logits 截断,但 query 与 key 的点积在被 cap 之前就可能膨胀得过大;Query-Key Normalization(QK-Norm)对 multi-head latent attention(MLA)又不适用,因为 MLA 的 Key 矩阵在推理时并不完全物化

对一个二维权重矩阵 $W\in\mathbb{R}^{n\times m}$,Muon 在第 $t$ 步的更新可以写为上式:$G_t$ 为 $W_t$ 的梯度,$\mu$ 为动量,$\eta$ 为学习率,$\lambda$ 为权重衰减。Newton–Schulz 步将动量矩阵正交化,$\sqrt{\max(n,m)}\cdot 0.2$ 因子则把更新重新缩放,使其 RMS 与 Adam 风格的更新匹配。

Taming Muon with QK-Clip. To address attention-logit explosion, we propose QK-Clip, a weight-clipping mechanism that explicitly constrains attention logits by rescaling the query and key projection weights post-update. For each head $h$ in attention layer, let $Q^h = X W_q^h, K^h = X W_k^h, V^h = X W_v^h$ and $O^h = \mathrm{softmax}\bigl(\tfrac{1}{\sqrt d} Q^h {K^h}^\top\bigr) V^h$. We define the per-head max logit on the current batch $\mathcal{B}$ as $S^h_{\max} = \tfrac{1}{\sqrt d}\max_{X\in\mathcal{B}}\max_{i,j} Q^h_i {K^h_j}^\top$. The core idea of QK-Clip is to rescale $W_q^h$ and $W_k^h$ whenever $S^h_{\max}$ exceeds a target threshold $\tau$; this operation does not alter the current step's forward/backward computation, merely uses the max logit as a signal to control weight growth.

$$\gamma^h = \min\!\left(1,\;\frac{\tau}{S^h_{\max}}\right), \qquad W_q^h \leftarrow (\gamma^h)^{\alpha}\,W_q^h, \qquad W_k^h \leftarrow (\gamma^h)^{1-\alpha}\,W_k^h, \quad \alpha=0.5.$$

Naively this can be applied with a global $\gamma = \min(1,\tau/S_{\max})$, but in practice only a small subset of heads exhibit exploding logits, so we apply per-head clipping to minimize intervention. For MLA we clip only the unshared components: $q^C, k^C$ each scaled by $\sqrt{\gamma^h}$; the head-specific rotary $q^R$ scaled by $\gamma^h$; the shared rotary $k^R$ left untouched to avoid cross-head effects.

We integrate Muon (with weight decay, consistent RMS matching) and QK-Clip into a single optimizer called MuonClip (Algorithm 1). In a 9B-activated / 53B-total MoE control run, vanilla Muon's max attention logits quickly exceed 1000 (Figure 2 left), causing instability. For Kimi K2 trained with MuonClip and $\tau=100$, max logits are capped at 100, gradually decay back to a typical operating range after about 30% of steps, and the training loss is smooth and spike-free across the entire 15.5T-token run (Figure 3).

用 QK-Clip 驯服 Muon。为解决 attention-logit 爆炸,我们提出 QK-Clip——一种权重裁剪机制:在更新之后,通过重缩放 query 和 key 投影权重来显式约束 attention logits。对注意力层中每个头 $h$,设 $Q^h = X W_q^h,\,K^h = X W_k^h,\,V^h = X W_v^h$,以及 $O^h = \mathrm{softmax}\bigl(\tfrac{1}{\sqrt d}Q^h {K^h}^\top\bigr) V^h$。定义当前 batch $\mathcal{B}$ 上的每头最大 logit:$S^h_{\max} = \tfrac{1}{\sqrt d}\max_{X\in\mathcal{B}}\max_{i,j} Q^h_i {K^h_j}^\top$。QK-Clip 的核心想法是:每当 $S^h_{\max}$ 超过目标阈值 $\tau$,就重缩放 $W_q^h$ 与 $W_k^h$。这一步不改变本步前/反向计算,只是用 max logit 作为"控制权重增长"的指引信号——见上式,默认 $\alpha=0.5$,即对 query 与 key 各分一半。

朴素做法是用一个全局 $\gamma=\min(1,\tau/S_{\max})$;但实践中只有少数几个头会出现 logit 爆炸,因此我们采用逐头裁剪以最小化对训练的干预。对于 MLA,只裁剪非共享分量:$q^C, k^C$ 各乘 $\sqrt{\gamma^h}$;头特异的 rotary $q^R$ 乘 $\gamma^h$;共享的 rotary $k^R$ 保持不动,避免跨头副作用。

我们把 Muon(加 weight decay、一致 RMS 匹配)与 QK-Clip 合并成一个统一优化器,称为 MuonClip(算法 1)。在 9B 激活 / 53B 总参的 MoE 对照实验中,vanilla Muon 的 max attention logit 很快冲过 1000(图 2 左),导致不稳定。Kimi K2 用 $\tau=100$ 的 MuonClip 训练时,max logit 先被 cap 在 100,经过约 30% 的训练步逐渐衰减回正常范围,且整个 15.5T tokens 的训练 loss 平滑、无 spike(图 3)。

§2.2 Pre-training Data / 预训练数据:改写式增强p.4

Token efficiency in pre-training refers to how much performance improvement is achieved for each token consumed during training. Increasing token utility — the effective learning signal each token contributes — enhances the per-token impact on model updates, thereby directly improving token efficiency. This is particularly important when the supply of high-quality tokens is limited and must be maximally leveraged. A naive approach is repeated exposure to the same tokens, which can lead to overfitting and reduced generalization. A key advancement of Kimi K2's pre-training data over Kimi K1.5 is the introduction of a synthetic data generation strategy to increase token utility: a carefully designed rephrasing pipeline amplifies the volume of high-quality tokens without inducing significant overfitting. We describe two domain-specialized rephrasing techniques for the Knowledge and Mathematics domains.

Knowledge Data Rephrasing. Pre-training on natural, knowledge-intensive text presents a trade-off: a single epoch is insufficient for comprehensive knowledge absorption, while multi-epoch repetition yields diminishing returns and increases the risk of overfitting. To improve token utility, we propose a synthetic rephrasing framework with three components: (i) style- and perspective-diverse prompting, inspired by WRAP, that uses carefully engineered prompts to guide an LLM to faithfully rephrase original texts in varied styles and perspectives; (ii) chunk-wise autoregressive generation, where long documents are split into segments, rephrased individually, then stitched back, mitigating implicit output-length limits of LLMs; (iii) fidelity verification, comparing semantic alignment between rephrased and source passages.

We compare data rephrasing with multi-epoch repetition on SimpleQA using an early checkpoint of K2: (1) repeating raw data for 10 epochs gives 23.76% accuracy; (2) rephrasing once then training for 10 epochs gives 27.39%; (3) rephrasing 10 times with a single pass gives 28.94%. We extend this method to other large knowledge corpora; each corpus is rephrased at most twice. For mathematics, we rewrite high-quality math documents into a "learning-note" style following SwallowMath, and translate non-English high-quality math materials into English to diversify.

Pre-training Data Overall. The Kimi K2 corpus comprises 15.5 trillion tokens of curated, high-quality data spanning four primary domains: Web Text, Code, Mathematics, and Knowledge. Most data processing pipelines follow the methodologies outlined in Kimi K1.5; for each domain we performed rigorous correctness and quality validation and designed targeted data experiments to ensure both diversity and effectiveness.

预训练中的 token 效率,指每消耗一个 token 所获得的性能提升幅度。提高 token 效用——每个 token 所贡献的有效学习信号——能放大每个 token 对模型更新的影响,从而直接改善 token 效率。当高质量 token 供给受限、必须榨干价值时,这一点尤其重要。朴素的"重复曝光相同 token"会导致过拟合、泛化下降。Kimi K2 在预训练数据上相对 Kimi K1.5 的一个关键进步,是引入合成数据生成策略来提升 token 效用:一条精心设计的改写 pipeline,在不引发显著过拟合的前提下放大高质量 token 的量。下面介绍两种针对 Knowledge 与 Mathematics 领域的专门改写技术。

知识数据改写。在自然的、知识密集的文本上预训练有 trade-off:一个 epoch 不足以充分吸收知识,多 epoch 重复又收益递减且过拟合风险上升。为提升 token 效用,我们提出一个三件套合成改写框架:① 风格与视角多样化的 prompting——借鉴 WRAP,用一组精心设计的 prompt 引导大模型在不同风格、不同视角下对原文做忠实改写;② chunk-wise 自回归生成——长文本被切成小段分别改写,再拼回,以规避 LLM 隐式的输出长度限制;③ 保真度校验——对比改写段与源文的语义一致性,做初步质量控制。

我们用 SimpleQA 把"改写"和"多 epoch 重复"做对照实验,基于 K2 的早期 checkpoint:(1)原始数据重复 10 epoch:准确率 23.76%;(2)改写一次后训 10 epoch:27.39%;(3)改写 10 次但只过一遍:28.94%。我们把这一方法推广到其它大规模知识语料,每个语料最多改写 2 次。数学方面,我们参照 SwallowMath 把高质量数学文档改写为"学习笔记"风格,同时把其它语言的高质量数学材料翻译成英文,增加多样性。

预训练数据总览。Kimi K2 的预训练语料包含 15.5 万亿精挑高质量 tokens,覆盖 Web 文本、代码、数学、知识四大领域。多数数据处理流程沿用 Kimi K1.5;对每个领域我们做了严格的正确性与质量校验,并设计有针对性的数据实验来确保多样性与有效性兼具。

§2.3 Model Architecture / 1T MoE 架构与 sparsity scalingp.6

Kimi K2 is a 1.04 trillion-parameter Mixture-of-Experts (MoE) transformer with 32 billion activated parameters. The architecture follows DeepSeek-V3, employing Multi-head Latent Attention (MLA) with hidden dimension 7168 and MoE expert hidden dimension 2048. Our scaling law analysis reveals that increasing sparsity yields substantial gains, motivating us to use 384 experts (up from 256 in DeepSeek-V3). To reduce inference overhead we cut attention heads to 64 (down from 128 in DeepSeek-V3). Compared with DeepSeek-V3: layers 61 (=), total params 1.04T (+54%), activated params 32.6B (−13%), experts total 384 (+50%), experts active per token 8 (=), shared experts 1 (=), attention heads 64 (−50%), dense layers 1 (−67%), no expert grouping.

Sparsity Scaling Law. We develop a sparsity scaling law for the MoE family using Muon, where sparsity is the ratio of total to activated experts. Under a fixed number of activated parameters (constant FLOPs), increasing the total experts (i.e., increasing sparsity) consistently lowers both training and validation loss. Concretely, to reach validation loss 1.5, sparsity 48 reduces FLOPs by $1.69\times, 1.39\times, 1.15\times$ over sparsities 8, 16, 32 respectively. Increasing sparsity, however, raises infrastructure complexity. To balance performance and cost we choose sparsity 48 for K2 — activating 8 of 384 experts per forward pass.

Number of Attention Heads. DeepSeek-V3 sets attention heads to roughly twice the number of layers to better utilize memory bandwidth. But as context length grows, doubled attention heads incur significant inference overhead — at 128k sequence length, going from 64 to 128 heads (with 384 total experts) increases inference FLOPs by 83%. This is a major limitation for agentic applications where efficient long-context processing is essential. Controlled experiments show doubling heads gives only 0.5%–1.2% validation-loss improvement across compute budgets. Given sparsity 48 already delivers strong performance, the marginal gain does not justify the inference cost, so we choose 64 attention heads.

Kimi K2 是一个 1.04 万亿参数的 MoE Transformer 模型,激活参数 320 亿。架构沿用 DeepSeek-V3:注意力机制用 Multi-head Latent Attention(MLA),hidden dim 7168,MoE 专家 hidden dim 2048。我们的 scaling law 分析表明,继续提升 sparsity 仍有可观增益,因此我们把专家数从 V3 的 256 提到 384;为降低推理开销,attention heads 从 V3 的 128 砍到 64。相对 DeepSeek-V3 的差异:层数 61(持平)、总参 1.04T(+54%)、激活参 32.6B(−13%)、总专家数 384(+50%)、每 token 激活专家 8(持平)、共享专家 1(持平)、attention heads 64(−50%)、稠密层数 1(−67%)、不再使用 expert grouping。

Sparsity Scaling Law。我们针对用 Muon 训练的 MoE 家族建立了一条 sparsity scaling 律——sparsity 定义为总专家数与激活专家数之比。在激活参数固定(即 FLOPs 恒定)下,增加总专家数(即提高 sparsity)能稳定降低训练和验证 loss。具体而言,要达到 1.5 的验证 loss,sparsity 48 相比 sparsity 8、16、32 分别节省 $1.69\times、1.39\times、1.15\times$ 的 FLOPs。但提高 sparsity 会增加基础设施复杂度,综合权衡后我们为 K2 选定 sparsity 48——每次前向从 384 个专家里激活 8 个。

注意力头数。DeepSeek-V3 把 attention heads 设为约层数的两倍,以更好利用显存带宽。但随着上下文变长,翻倍的 heads 引入显著推理开销——在序列长 128k 时,从 64 头增到 128 头(384 专家不变)会使推理 FLOPs 增加 83%。对长上下文 agentic 应用这是主要瓶颈。对照实验显示在不同算力预算下,翻倍 heads 只带来 0.5%–1.2% 的验证 loss 改进。鉴于 sparsity 48 已经提供了强劲性能,这点边际收益不值得增加那么多推理代价,因此我们选择 64 attention heads。

§2.4–2.5 Training Infrastructure & Recipe / 基础设施与训练菜单p.7

Compute Cluster & Parallelism. Kimi K2 was trained on a cluster of NVIDIA H800 GPUs; each node has 2 TB RAM and 8 GPUs connected via NVLink/NVSwitch, and 8×400 Gbps RoCE between nodes. Rather than optimizing one parallelism strategy tied to a specific node count, we pursue a flexible strategy allowing K2 to be trained on any multiple of 32 nodes. We combine 16-way Pipeline Parallelism (PP) with virtual stages, 16-way Expert Parallelism (EP), and ZeRO-1 Data Parallelism. Storing BF16 parameters and FP32 gradient accumulation needs ~6 TB of GPU memory, distributed over a model-parallel group of 256 GPUs; each GPU holds ~30 GB of all states, leaving the rest for activations.

EP overlap with interleaved 1F1B; smaller EP size. By increasing warm-up micro-batches, we overlap EP all-to-all with computation under standard interleaved 1F1B. We did not adopt DualPipe because it doubles parameter/gradient memory, prohibitive at trillion scale. Interleaved 1F1B introduces PP-communication overhead; we mitigate this by decoupling weight-gradient computation from each micro-batch's backward and running it in parallel with the corresponding PP communication. To ensure full computation-communication overlap during 1F1B given K2's reduced attention compute (64 heads vs V3's 128), we use the smallest feasible EP (=16), which also relaxes expert-balance constraints.

Activation Reduction. Selective recomputation is applied to inexpensive, high-footprint stages (LayerNorm, SwiGLU, MLA up-projections, MoE down-projections). MoE up-projection and SwiGLU inputs are stored as FP8-E4M3 in $1\times 128$ tiles with FP32 scales — small-scale experiments show no measurable loss increase, though we do not apply FP8 in compute. All remaining activations are offloaded to CPU RAM via a copy engine that overlaps with compute/communication kernels: during 1F1B we offload the previous micro-batch's forward activations while prefetching the next backward, with EP communication remaining fully overlapped.

Training Recipe. We pre-trained K2 with a 4096-token context window using MuonClip and the WSD learning rate schedule, processing 15.5T tokens total. The first 10T tokens used constant LR 2e-4 after a 500-step warm-up; the remaining 5.5T tokens used cosine decay from 2e-4 to 2e-5. Weight decay was 0.1; global batch size 67M tokens. An annealing phase followed: at 67M batch size LR decayed from 2e-5 to 7e-6 across 400B tokens at 4k seq-len, then 60B tokens at 32k seq-len. Context window was extended to 128k via YaRN.

算力集群与并行。Kimi K2 在 NVIDIA H800 GPU 集群上训练;每个节点 2 TB RAM、8 GPU 通过 NVLink/NVSwitch 互联,节点间用 8×400 Gbps RoCE。与"只针对特定节点数优化一种并行策略"不同,我们追求灵活策略,使 K2 能在任意 32 的倍数节点上训练。我们组合:16-way Pipeline Parallelism(PP,带 virtual stages)、16-way Expert Parallelism(EP)、ZeRO-1 Data Parallelism。BF16 参数 + FP32 梯度累积约需 6 TB 显存,分布在 256 GPU 的模型并行组上;每 GPU 持有约 30 GB 状态,剩余显存留给激活。

EP 通信与 interleaved 1F1B 重叠;更小的 EP 规模。通过增加 warm-up 微批数,我们在标准 interleaved 1F1B 下让 EP all-to-all 与计算重叠。我们没有采用 DualPipe——它会把参数和梯度显存翻倍,在万亿规模下不可承受。Interleaved 1F1B 会引入 PP 通信开销,为此我们把每个微批反向中的 weight-gradient 计算从主反向中解耦,与对应的 PP 通信并行执行,从而几乎全部 PP 通信都能被掩盖,仅 warm-up 阶段例外。考虑 K2 的注意力计算更轻(64 vs V3 的 128 头),为保证 1F1B 阶段计算-通信完全重叠,我们采用尽可能小的 EP 规模 EP=16,同时这也放宽了专家均衡的约束。

激活内存优化。对廉价但占用大的环节做选择性重算:LayerNorm、SwiGLU、MLA up-projection,以及 MoE down-projection 也在训练中重算。MoE up-projection 和 SwiGLU 的输入用 FP8-E4M3 + $1\times 128$ tile + FP32 scale 存储,小规模实验显示 loss 无可测增加,但出于稳健性,FP8 不进入计算。剩余激活全部 offload 到 CPU RAM;一个 copy engine 负责流式 offload/onload,与计算/通信内核重叠:1F1B 阶段我们一边 offload 上一个微批的前向激活,一边预取下一个的反向激活,EP 通信仍能被完全掩盖。

训练菜单。我们在 4096-token 上下文下,用 MuonClip 与 WSD 学习率,共训了 15.5T tokens。前 10T tokens 在 500 步 warm-up 后用恒定 LR 2e-4;之后 5.5T tokens 用 cosine 从 2e-4 衰减到 2e-5。weight decay 恒为 0.1;全局 batch size 6700 万 tokens。预训练末段做了 annealing:batch size 不变,LR 从 2e-5 衰减到 7e-6,先用 4k 序列长跑 400B tokens,再用 32k 序列长跑 60B tokens。最后用 YaRN 把上下文窗口扩展到 128k。

§3.1 SFT & Agentic Data Synthesis / SFT 与 agentic 数据合成p.9

Supervised Fine-Tuning. We employ the Muon optimizer in post-training and recommend it for fine-tuning with K2: a Muon-pre-trained checkpoint yields the best performance when fine-tuned with Muon. We construct a large-scale instruction-tuning dataset across diverse domains under two principles: maximizing prompt diversity and ensuring response quality. We build a suite of data-generation pipelines per task domain, combining human annotation, prompt engineering, and verification. K1.5 and other in-house domain-specialized expert models generate candidate responses; LLM- or human-based judges perform automated quality evaluation and filtering. For agentic data, we create a dedicated data-synthesis pipeline to teach tool-use through multi-step, interactive reasoning.

Large-Scale Agentic Data Synthesis for Tool Use. A critical LLM-agent capability is autonomously using unfamiliar tools, interacting with external environments, and iteratively refining actions through reasoning, execution, and error correction. Real environments provide rich signals but are hard to scale due to cost, complexity, privacy, and accessibility. Inspired by ACEBench's data-synthesis framework, we build a pipeline that simulates real tool-use scenarios at scale, generating tens of thousands of diverse, high-quality training examples. The pipeline has three stages: (i) Tool spec generation: construct a large repository of tool specs from real-world tools and LLM-synthetic tools; (ii) Agent and task generation: for each toolset sampled from the repository, generate an agent that uses the toolset and corresponding tasks; (iii) Trajectory generation: for each agent+task, generate trajectories where the agent completes the task by invoking tools.

Domain Evolution and Tool Generation. We build the tool repository two ways. First, we directly fetch 3000+ real MCP (Model Context Protocol) tools from GitHub. Second, we systematically evolve synthetic tools through a hierarchical domain process: start from key categories (e.g., financial trading, software apps, robot control), evolve specific application domains within each, then synthesize specialized tools per domain with clear interfaces, descriptions, and semantics — over 20,000 synthetic tools in total. t-SNE shows MCP and synthetic tools cover complementary regions of the tool space.

监督微调(SFT)。后训练阶段我们采用 Muon 优化器,并推荐在 K2 上做 fine-tuning 时也用 Muon:Muon 预训的 checkpoint 配上 Muon 微调能给出最好效果。我们构建了一个覆盖多领域的大规模指令微调数据集,坚持两条核心原则:最大化 prompt 多样性、保证响应质量。为此我们针对不同任务领域设计了一整套数据生成 pipeline,组合人工标注、prompt 工程与验证流程。我们用 K1.5 以及其它内部领域专家模型生成候选答案,再由 LLM 或人类裁判做自动质量评估与过滤。对 agentic 数据,我们专门构建一条数据合成 pipeline,通过多步交互推理教会模型 tool use。

大规模 agentic 数据合成。现代 LLM agent 的关键能力,是自主使用不熟悉的工具、与外部环境交互、并通过推理-执行-纠错迭代调整动作。真实环境信号丰富但因成本、复杂度、隐私、可达性难以规模化。受 ACEBench 数据合成框架启发,我们构建了一条大规模仿真真实 tool-use 场景的 pipeline,生成数万条多样、高质量训练样例。Pipeline 分三阶段:① tool spec 生成——从真实工具与 LLM 合成工具构造一个大型 tool spec 仓库;② agent 与任务生成——对从仓库采样的每个工具集合,生成一个使用该工具集的 agent 与对应任务;③ 轨迹生成——对每个 agent+task,生成 agent 调用工具完成任务的交互轨迹。

领域演化与工具生成。我们用两条互补路线构建工具库。其一,直接从 GitHub 拉取 3000+ 个真实 MCP(Model Context Protocol)工具;其二,通过层级化的领域演化合成工具:先定义关键大类(金融交易、软件应用、机器人控制等),在每个大类下进化出多个具体应用域,再为每个域合成具备清晰接口、描述与语义的专门工具——合计 20000+ 个合成工具。t-SNE 可视化显示 MCP 工具与合成工具覆盖了工具空间的互补区域。

Agent Diversification & Rubric Tasks. We synthesize thousands of agents by combining various system prompts with different tool combinations, ensuring broad capability/expertise/behavior coverage. For each agent we generate tasks ranging from simple to complex, each paired with an explicit rubric specifying success criteria, expected tool-use patterns, and evaluation checkpoints — enabling consistent, objective evaluation.

Multi-turn Trajectories & Filtering. We simulate realistic scenarios with (i) user simulation — LLM-generated personas with distinct styles engaging in multi-turn dialogue with agents; (ii) a tool execution environment (functionally a world model) that executes calls, maintains state, and injects controlled stochasticity for varied outcomes including partial failures and edge cases. An LLM-based judge evaluates each trajectory against rubrics; only trajectories meeting success criteria are kept.

Hybrid with Real Sandboxes. Simulation provides scale; for authenticity (coding/SWE), we complement with real execution sandboxes — running real code, using genuine dev environments, returning ground-truth feedback via test pass rates. The hybrid pipeline implements large-scale rejection sampling through quality filtering, and the resulting synthetic data, used in SFT, substantially improves tool-use across real-world applications.

Agent 多样化与 rubric 任务。我们通过组合不同 system prompt 与不同工具子集,合成出数千个 agent,确保能力/专长/行为模式都覆盖广。对每个 agent,我们生成从简单到复杂的任务,每个任务配一份显式 rubric(成功标准、期望 tool-use 模式、评估 checkpoint),从而保证评估的一致性与客观性。

多轮轨迹生成与过滤。我们用以下组件模拟真实场景:① user 仿真——LLM 生成风格各异的 user persona,与 agent 进行多轮对话;② tool 执行环境(功能上等价于一个 world model)——执行工具调用、维护状态、注入受控随机性,产出包括成功/部分失败/边缘案例在内的多样结果。LLM judge 按 rubric 评估每条轨迹,只保留达标轨迹。

仿真 + 真实沙箱的混合方案。仿真擅长规模化,但对真实性敏感的场景(编程 / SWE)我们辅以真实执行沙箱——跑真实代码、对接真实开发环境、用测试通过率作 ground-truth 反馈。这种混合 pipeline 通过质量过滤实质上实现了大规模 rejection sampling;生成的高质合成数据用于 SFT 后,显著提升了模型在各类真实应用中的 tool-use 能力。

§3.2 Reinforcement Learning / 强化学习p.11

Reinforcement learning (RL) is believed to have better token efficiency and generalization than SFT. Building on K1.5, we continue to scale RL in both task diversity and training FLOPs. We develop a Gym-like extensible framework facilitating RL across a wide range of scenarios, extending it with many verifiable-reward tasks. For tasks that rely on subjective preferences (creative writing, open-ended QA), we introduce a self-critic reward in which the model performs pairwise comparisons of its own outputs. This allows tasks from all domains to benefit from the RL paradigm.

Verifiable Rewards Gym. For math/STEM/logical reasoning, we follow two principles: diverse coverage (expert annotations + internal QA extraction + open datasets; a tagging system intentionally raises coverage of under-covered domains; logic tasks include multi-hop tabular reasoning, cross-table aggregation, the 24-game, Sudoku, cryptarithms, Morse-code decoding) and moderate difficulty (assess each problem's difficulty via the SFT model's pass@k; keep only moderate-difficulty problems). For complex instruction following, we combine code-interpreter-based deterministic evaluation (length/style constraints) with LLM-as-judge, and a hack-check layer that detects deceptive claims of fulfillment. Instructions come from expert-crafted prompts/rubrics, AutoIF-style agentic augmentation, and a fine-tuned model specialized in probing failure modes. For faithfulness, we train a sentence-level faithfulness judge model (FACTS-Grounding-style) that flags claims lacking in-context evidence, serving as a reward model. For coding/SWE, we use open-source datasets, synthetic problems with human-written unit tests, and a Kubernetes-powered sandbox supporting 10k+ concurrent instances. For safety, an attack model iteratively generates adversarial prompts, a target model responds, and a judge model decides bypass success.

RL 被认为在 token 效率与泛化上都优于 SFT。在 K1.5 基础上,我们在 K2 中继续扩展 RL 的任务多样性与训练 FLOPs。我们开发了一个 Gym-like 的可扩展框架来支撑广泛场景下的 RL,并向其中加入大量带 verifiable reward 的任务。对依赖主观偏好的任务(写作、开放式 QA),我们引入 self-critic 奖励——让模型对自己的输出做 pairwise 比较。这样各领域任务都能享受 RL 范式的好处。

Verifiable Rewards Gym。对数学 / STEM / 逻辑推理任务,我们坚持两条原则:① 覆盖多样(专家标注 + 内部 QA 抽取 + 公开数据集;用一套打标系统主动提升欠覆盖领域的占比;逻辑任务覆盖多跳表格推理、跨表聚合、24 点、数独、字谜、Morse 码解码等);② 难度适中(以 SFT 模型的 pass@k 评估每道题的难度,只保留中等难度题)。对 复杂指令跟随,我们组合两种验证:对有可验证输出的指令(长度、风格约束)用 code interpreter 做确定性评估;对需要细致理解约束的指令用 LLM-as-judge;并加一层 hack-check 专门识别"自称完成了实际没完成"的欺骗性回答。指令来源:专家手写的复杂条件 prompt 与 rubric、AutoIF 风格的 agentic 指令增强、以及一个专门擅长生成"探测失效模式"指令的微调模型。忠实性方面,我们仿照 FACTS Grounding,训练一个句子级 faithfulness judge,标出"没有上下文证据支持"的断言,作为奖励模型。编程 / SWE 方面,我们用开源数据集、配高质量人工单测的合成题、以及 Kubernetes 驱动、支持 1 万+并发实例的稳定沙箱。安全方面,attack 模型迭代生成对抗 prompt,target 模型回答,judge 模型判定是否绕过安全机制。

Beyond Verification: Self-Critique Rubric Reward. To align beyond verifiable-reward tasks, we introduce general RL from self-critic feedback. The K2 actor generates responses for general prompts; the K2 critic ranks them via pairwise evaluation against a mix of core rubrics (fundamental values), prescriptive rubrics (anti-reward-hacking), and human-annotated rubrics. Some rubrics can be designated mandatory, while K2 retains flexibility to weigh them against internal priors — enabling dynamic, continuous alignment with evolving on-policy behavior. Critically, during RL training the critic is continuously refined using verifiable signals: on-policy rollouts from verifiable-reward prompts update the critic, distilling objective performance gains from RLVR into the evaluator, and grounding subjective judgment in verifiable data.

RL Algorithm. We adopt the K1.5 policy optimization algorithm. For each problem $x$ we sample $K$ responses $\{y_1,\dots,y_K\}$ from the previous policy $\pi_{\mathrm{old}}$ and optimize $\pi_\theta$ against the following objective:

$$\mathcal{L}_{\mathrm{RL}}(\theta) = \mathbb{E}_{x\sim\mathcal{D}}\!\left[\frac{1}{K}\sum_{i=1}^{K}\!\left(r(x,y_i)-\bar r(x)-\tau\,\log\frac{\pi_\theta(y_i\mid x)}{\pi_{\mathrm{old}}(y_i\mid x)}\right)^{\!2}\,\right],\quad \bar r(x)=\frac{1}{K}\sum_{i=1}^{K}r(x,y_i),\;\;\tau>0.$$

Like SFT we use Muon to minimize it. We add three components: (i) Budget Control — per-sample max-token budget by task type; over-budget responses are truncated and penalized, encouraging concise solutions. (ii) PTX Loss — to prevent forgetting, integrate a hand-curated high-quality dataset via an auxiliary PTX loss. (iii) Temperature Decay — start with high temperature to encourage exploration, decay over training to favor exploitation; ensures stable, reliable final outputs.

超越 verification:Self-Critique Rubric Reward。为了把对齐扩展到 verifiable-reward 之外,我们引入"从 self-critic 反馈学习"的通用 RL 框架。K2 actor 对一般 prompt 生成回答;K2 critic 用 pairwise 评估对照一组 rubric 打分:其中包括 core rubrics(代表 Kimi 视为根基的 AI 助手价值观)、prescriptive rubrics(防止 reward hacking)、以及数据团队针对具体指令场景手写的 human-annotated rubrics。部分 rubric 可被设为强制,但 K2 仍有自由度在它们与自身内部先验间权衡——这让对齐能跟上不断演化的 on-policy 行为,既保住核心身份又能适配具体指令。RL 训练中,critic 还会用 verifiable 信号持续校准:从 verifiable-reward prompts 上的 on-policy rollout 反向更新 critic,把 RLVR 的客观信号"蒸馏"进评估器,让主观判断扎根于可验证数据。

RL 算法。我们沿用 K1.5 的策略优化算法。对每道题 $x$,我们从上一代策略 $\pi_{\mathrm{old}}$ 采 $K$ 个回答 $\{y_1,\dots,y_K\}$,然后对 $\pi_\theta$ 优化上式:其中 $\bar r(x) = \tfrac{1}{K}\sum_i r(x,y_i)$ 是组内平均奖励,$\tau>0$ 是促进稳定学习的正则系数。和 SFT 一样,我们用 Muon 来最小化它。我们额外加了三个组件:① Budget Control——按任务类型给每个样本设最大 token 预算,超预算回答被截断并罚分,鼓励简洁解;② PTX Loss——为防止遗忘,把一份手工挑选的高质量数据通过辅助 PTX loss 集成进 RL 目标;③ Temperature Decay——初期用高温度鼓励探索,训练中温度逐步衰减偏向利用,确保最终输出稳定可靠。

§3.3 RL Infrastructure / RL 基础设施p.13

Colocated Architecture. Like K1.5, we adopt a hybrid colocated architecture for synchronized RL: training and inference engines live on the same workers, and when one is active the other releases/offloads GPU resources. Each iteration: a centralized controller calls inference engine to generate new data, then trains on it, then sends updated parameters to inference for the next iteration. Each engine is heavily throughput-optimized; at K2's scale, engine-switching latency and failure recovery become significant — we describe our system design for both.

Efficient Engine Switching. During rollout, training-engine parameters are offloaded to DRAM, so bringing it up is just an H2D transfer. Bringing up the inference engine is harder: it must obtain updated parameters from the training engine with a different sharding paradigm. At K2's scale, using a network file system for resharding/broadcast is impractical (aggregate bandwidth needed reaches several PB/s). We built a distributed checkpoint engine co-located on training nodes: each worker obtains a local copy of parameters from training, broadcasts the full parameter set across all checkpoint workers, then inference retrieves only the shard it needs. For a 1T model, updates are pipelined parameter-by-parameter to minimize memory footprint. We broadcast the full parameter set rather than transfer-what-you-need, trading minor overhead for fully decoupled engines. The system completes a full K2 parameter update in <30s — negligible for typical RL iteration. The checkpoint-engine source is on GitHub.

Efficient System Startup & Agentic Rollout. To minimize disk IO at startup, each training worker selectively reads part of the parameters and broadcasts to peers — collectively reading the checkpoint exactly once. Inference replicas reuse the checkpoint engine for startup, avoiding cross-replica sync barriers and making the system robust to single-point failures. For long-horizon multi-turn agentic rollouts: (i) heavy environments are deployed as dedicated scalable services; (ii) we use many concurrent rollouts to amortize expensive interaction latency. Individual trajectories can be extremely long; to prevent long-tails blocking the rollout, we use partial rollout — pause long-tail unfinished tasks and resume in the next RL iteration. A unified Gym-inspired interface streamlines new-environment integration.

训推一体(Colocated)架构。与 K1.5 一致,我们用混合 colocated 架构做同步 RL:训练引擎与推理引擎部署在同一组 worker 上,谁工作就让另一方释放或 offload GPU 资源。每次 RL 迭代:中央控制器先让推理引擎生成新数据,然后通知训练引擎在新数据上训,接着把更新后的参数下发给推理引擎,开始下一轮。两边引擎都重度针对吞吐量优化;到 K2 这个量级,引擎切换延迟与失败恢复变得非常关键——下面分别介绍。

高效引擎切换。Rollout 期间训练引擎的参数被 offload 到 DRAM,因此把训练引擎"叫醒"只是一次 H2D 拷贝。把推理引擎叫醒更难——它必须用不同的 sharding 方式从训练引擎拿到最新参数。在 K2 这种规模下,用网络文件系统做 resharding+广播完全不现实(为不显著拉慢训练,聚合带宽要达 PB/s 级)。我们构建了一个分布式 checkpoint engine,与训练节点 colocated:每个 worker 从训练引擎本地拷一份参数,先在所有 checkpoint engine worker 间广播完整参数集,然后推理引擎只取自己需要的 shard。对 1T 模型,参数更新按"逐参数 pipeline"方式做,以最小化内存占用。我们之所以选择广播完整参数集而非"按需传输",是因为这样设计极简、对训练/推理引擎侵入小,我们愿意用这点开销换全完全解耦。系统能在 30 秒内完成 K2 的一轮完整参数更新——对 RL 迭代而言可忽略不计。checkpoint engine 已在 GitHub 开源。

高效系统启动 & Agentic Rollout。为最小化启动期的磁盘 IO,每个训练 worker 只选择性地读部分参数,然后广播给同伴——所有 worker 合起来对 checkpoint 只读一次。推理副本启动则复用 checkpoint engine,避免引入跨副本同步壁垒;这也让单点故障不会传染——一个推理副本能独立重启。对长程多轮 agentic rollout,我们做了两点优化:① 把重型环境部署为可独立扩展的专用服务;② 同时跑大量并发 rollout,以摊销昂贵交互的延迟。单条轨迹可能极长;为防止长尾阻塞整个 rollout,我们采用 partial rollout 技术——把长尾未完成任务挂起,留到下一轮 RL 迭代继续。我们还设计了一个 Gym 风格的统一接口,简化新环境接入。

§4 Evaluations / 评测p.15

Evaluation Settings. We assess Kimi-K2-Instruct across many areas. Coding: LiveCodeBench v6 (Aug 2024 – May 2025), OJBench, MultiPL-E, SWE-bench Verified, TerminalBench, Multi-SWE-bench, SWE-Lancer, PaperBench, Aider-Polyglot. Tool use: τ2-Bench, AceBench (emphasize multi-turn tool calling). Reasoning: AIME 2024/2025, MATH-500, HMMT 2025, CNMO 2024, PolyMath-en, ZebraLogic, AutoLogi, GPQA-Diamond, SuperGPQA, Humanity's Last Exam (Text-Only). Long context: MRCR, DROP, FRAMES, LongBench v2. Factuality: FACTS Grounding, Vectara Hallucination Leaderboard, FaithJudge. General: MMLU, MMLU-Redux, MMLU-Pro, IFEval, Multi-Challenge, SimpleQA, LiveBench. Baselines (all in non-thinking mode): DeepSeek-V3-0324, Qwen3-235B-A22B (vendor-recommended no-thinking), Claude Sonnet 4, Claude Opus 4, GPT-4.1, Gemini 2.5 Flash Preview (2025-05-20). Output cap 8192 tokens (16384 for SWE-bench Verified Agentless); 128k context for long-context tasks; SWE-bench Verified is evaluated agentless (single patch w/o test) and agentic (single attempt + multi-attempt best-of-N with internal verifier); SWE-bench Multilingual: single-attempt agentic only.

Key Post-training Results. Agentic and competitive coding: Kimi-K2-Instruct is open-source SOTA on real SWE: SWE-bench Verified 65.8% (71.6% multi-attempt), SWE-bench Multilingual 47.3%, SWE-lancer 39.1% — significantly closing the gap to Claude 4 Opus/Sonnet. On competitive coding: LiveCodeBench v6 53.7%, OJBench 27.1% — leading across all models. Agentic tool use: K2 sets new SOTA at τ2-Bench 66.1 Pass@1 and ACEBench 76.5, substantially outperforming all baselines. General: strong, balanced — SimpleQA 31.0%, MMLU 89.5%, MMLU-Redux 92.7%, IFEval 89.8%, Multi-Challenge 54.1%, AIME 2024 69.6%, GPQA-Diamond 75.1%, DROP 93.5%, MRCR 55.0%. Open-ended: LMSYS Arena (July 17, 2025) — top-1 open-source, 5th overall (3000+ votes).

评测设定。我们从多个维度评估 Kimi-K2-Instruct。编程:LiveCodeBench v6(2024.8–2025.5)、OJBench、MultiPL-E、SWE-bench Verified、TerminalBench、Multi-SWE-bench、SWE-Lancer、PaperBench、Aider-Polyglot。Tool use:τ2-Bench、AceBench(两者重点考察多轮工具调用)。推理:AIME 2024/2025、MATH-500、HMMT 2025、CNMO 2024、PolyMath-en、ZebraLogic、AutoLogi、GPQA-Diamond、SuperGPQA、Humanity's Last Exam(纯文本)。长上下文:MRCR、DROP、FRAMES、LongBench v2。事实性:FACTS Grounding、Vectara 幻觉榜、FaithJudge。通用:MMLU、MMLU-Redux、MMLU-Pro、IFEval、Multi-Challenge、SimpleQA、LiveBench。基线全部在非 thinking 模式下评测:DeepSeek-V3-0324、Qwen3-235B-A22B(厂商推荐的 no-thinking 配置)、Claude Sonnet 4、Claude Opus 4、GPT-4.1、Gemini 2.5 Flash Preview(2025-05-20)。输出长度 cap 在 8192 tokens(SWE-bench Verified Agentless 调到 16384);长上下文任务用 128k context;SWE-bench Verified 分 agentless(单 patch 无测)与 agentic(单次 + multi-attempt best-of-N + 内置 verifier)两种;SWE-bench Multilingual 仅 single-attempt agentic。

关键后训练结果。Agentic 与竞赛编程:Kimi-K2-Instruct 在真实 SWE 任务上开源 SOTA——SWE-bench Verified 65.8%(多次尝试 71.6%)、SWE-bench Multilingual 47.3%、SWE-lancer 39.1%,与 Claude 4 Opus/Sonnet 差距显著缩小;竞赛编程上 LiveCodeBench v6 53.7%、OJBench 27.1%,全榜领先。Agentic tool use:τ2-Bench 66.1 Pass@1、ACEBench 76.5,全面超基线,树立新 SOTA。通用:综合强且均衡——SimpleQA 31.0%、MMLU 89.5%、MMLU-Redux 92.7%、IFEval 89.8%、Multi-Challenge 54.1%、AIME 2024 69.6%、GPQA-Diamond 75.1%、DROP 93.5%、MRCR 55.0%。开放式评测:2025 年 7 月 17 日 LMSYS Arena,基于 3000+ 投票排开源第 1、综合第 5。

Pre-training Evaluations (Kimi-K2-Base). Against DeepSeek-V3-Base, Qwen2.5-72B-Base, Llama 4-Maverick. Kimi-K2-Base achieves SOTA on 10/12 English benchmarks: MMLU 87.79%, MMLU-Pro 69.17%, MMLU-Redux 90.17%, SuperGPQA 44.67%, SimpleQA 35.25%. Coding SOTA across all metrics: CRUXEval-I-cot 74.00%, CRUXEval-O-cot 83.50%, LiveCodeBench v6 26.29%, EvalPlus 80.33%. Math leads 3/4: MATH 70.22%, GSM8K 92.12%, GSM8K-Platinum 94.21%, narrowly behind on CMATH (90.26% vs V3 90.53%). Chinese SOTA across the board: C-Eval 92.50%, CMMLU 90.90%, CSimpleQA 77.57%.

Safety Evaluation. Red-team with Promptfoo across Harmful/Criminal/Misinformation/Privacy/Security plugins paired with Basic/Prompt Injection/Iterative Jailbreak/Crescendo strategies, vs DeepSeek-V3/R1 and Qwen3. Without targeted optimization, K2 holds its own on most basic and Base64 cases (≥90% passing), while complex strategies like Crescendo lower pass rates across all models (effective adversarial). Base64 transformation has minimal impact, suggesting basic robustness to encoding shifts.

预训练评测(Kimi-K2-Base)。对照 DeepSeek-V3-Base、Qwen2.5-72B-Base、Llama 4-Maverick。Kimi-K2-Base 在 12 个英文 benchmark 中 10 个 SOTA:MMLU 87.79%、MMLU-Pro 69.17%、MMLU-Redux 90.17%、SuperGPQA 44.67%、SimpleQA 35.25%。编程上全指标 SOTA:CRUXEval-I-cot 74.00%、CRUXEval-O-cot 83.50%、LiveCodeBench v6 26.29%、EvalPlus 80.33%。数学 4 中 3:MATH 70.22%、GSM8K 92.12%、GSM8K-Platinum 94.21%,CMATH 90.26% 略逊 V3 的 90.53%。中文全面 SOTA:C-Eval 92.50%、CMMLU 90.90%、CSimpleQA 77.57%。

安全评测。用 Promptfoo 做红队评测,覆盖 Harmful / Criminal / Misinformation / Privacy / Security 五大插件,与 Basic / Prompt Injection / Iterative Jailbreak / Crescendo 四种策略两两组合,对比 DeepSeek-V3 / R1 与 Qwen3。在没有针对评测做专门优化的情况下,K2 在多数 basic 与 Base64 测例上保持 ≥90% 通过率;复杂策略如 Crescendo 会拉低所有模型的通过率(对抗有效),Base64 编码扰动几乎不影响,说明基本鲁棒性 OK。

§5–6 Limitations & Conclusions / 局限与结论p.20

Limitations. In internal tests we identified several limitations. On hard reasoning tasks or with unclear tool definitions, K2 may generate excessive tokens, occasionally leading to truncated outputs or incomplete tool calls. Performance can decline on some tasks if tool use is unnecessarily enabled. For building complete software projects, the one-shot prompting success rate is lower than using K2 within an agentic coding framework. We are working to address these in future releases and welcome feedback.

Conclusions. We introduced Kimi K2, a 1T-parameter open-weight MoE model built for agentic intelligence. Leveraging the token-efficient MuonClip optimizer and a 15.5T-token high-quality dataset, Kimi K2 achieves stable, scalable pre-training. Post-training combines large-scale synthetic tool-use data with a unified RL framework using both verifiable rewards and self-critic feedbacks. Kimi K2 sets new state-of-the-art on agentic and reasoning benchmarks, establishing itself as the most capable open-weight LLM to date.

局限。在内部测试中我们发现若干局限。在硬推理任务、或工具定义不清晰时,K2 可能生成过多 token,偶尔导致输出被截断或工具调用不完整。在某些任务上,如果不必要地开启 tool use,性能反而会下降。要构建完整的软件项目,单次 one-shot prompt 的成功率不如把 K2 放进一个 agentic coding 框架里使用。我们正在后续版本中解决这些问题,也欢迎社区反馈。

结论。我们提出 Kimi K2——一个 1T 参数、面向 agentic intelligence 的开源 MoE 大模型。借助 token-efficient 的 MuonClip 优化器与 15.5T tokens 高质量数据,K2 实现了稳定、可规模化的预训练;后训练把大规模合成的 tool-use 数据与统一的 RL 框架(verifiable rewards + self-critic 反馈)结合起来。Kimi K2 在 agentic 与推理 benchmark 上刷出新 SOTA,确立其为迄今最强的开源大模型之一。

References & Appendixp.21

Appendix A — Contributions: the listing of authors is in alphabetical order based on their last names.

Appendix D — MuonClip ablation experiments: comparisons of vanilla Muon vs. Muon + QK-Clip across multiple control runs, including max-logit trajectories and per-head clipping ratios over training.

Appendix F — Self-Critique core and prescriptive rubrics: the full lists of rubrics used for the Self-Critique Rubric Reward, including the values-grounded "core" rubrics and the anti-reward-hacking "prescriptive" rubrics.

Appendix G — RL parameter-update pipeline: detailed diagrams of the checkpoint engine's pipelined per-parameter broadcast, including the <30s end-to-end 1T-parameter sync timeline.

(References / Appendix content omitted from this offline view — please refer to the original PDF on arXiv:2507.20534 for the full bibliography, evaluation tables, ablation curves, and pipeline diagrams.)

附录 A——贡献者:作者按姓氏字母顺序列出。

附录 D——MuonClip 消融实验:vanilla Muon 与 Muon + QK-Clip 在多组对照实验下的比较,包括 max-logit 训练曲线、以及训练过程中各 attention head 的逐头 clip 比例。

附录 F——Self-Critique 的 core 与 prescriptive rubrics:用于 Self-Critique Rubric Reward 的完整 rubric 列表,包括"核心价值观"core rubrics,以及防止 reward hacking 的 prescriptive rubrics。

附录 G——RL 参数更新 pipeline:checkpoint engine 逐参数 pipeline 广播的细节示意图,包含端到端 30 秒内完成 1T 参数同步的时间线。

(本离线视图省略了参考文献与附录正文——完整 bibliography、评测表、消融曲线、pipeline 图请参阅 arXiv:2507.20534 原 PDF。)