解读 Kimi-K3 如何把开源模型推到 3T 参数级别:线性注意力 KDA 与全局 Gated MLA 按层混合以高效处理百万上下文、用注意力残差缓解深层网络的信息压缩瓶颈,以及提升大规模 MoE 训练稳定性的 Stable LatentMoE。
Kimi K3 —技术报告摘要
论文:Kimi K3: Open Frontier Intelligence
团队:Kimi Team(月之暗面)
发布时间:2026.07
页数:47页
1. 预训练 Recipe
训练策略
| 项目 | 详情 |
|---|---|
| 模型架构 | MoE,2.8T总参数,104B激活参数 |
| 专家设计 | StableLatentMoE:896routed experts,每token激活16个(稀疏度56×),2个shared experts |
| 注意力 | Hybrid Attention:3层KDA + 1层Gated MLA per block(3:1比例),末层额外加一层Gated MLA |
| KDA | Kimi Delta Attention:delta-rule recurrence + channel-wise forget gate,chunk-wise parallel形式(chunk内并行,chunk间递推) |
| AttnRes | Attention Residuals(Block模式):将所有层分为8个block(每block 12层),block内求和压缩为一个表示,block间用attention选择性检索之前所有block的表示。解决标准残差连接在深度方向的信息压缩瓶颈 |
| Stable LatentMoE三组件 | ①NormalizedLatentMoE:在expert aggregation和W↑之间插入RMSNorm ②SiTU-GLU(Sigmoid Tanh Unit GLU):gate branch用β₁·tanh(x/β₁)·σ(x),up branch用β₂·tanh(x/β₂),bounded激活防止overflow ③Quantile Balancing:load balancing新方法(替代aux loss) |
| 优化器 | Per-Head Muon:对Q/K/V投影矩阵按head维度分块后独立做Newton-Schulz正交化,避免大梯度head主导共享更新方向 |
| 上下文长度 | 1M tokens |
| MTP | Multi-Token Prediction层(结构与backbone block相同),后续fine-tune为EAGLE-3draft model |
| 视觉编码器 | MoonViT-V2:27层ViT ~0.4B参数,from scratch训练(不用SigLIP初始化),RMSNorm+无bias设计,pixel-shuffle2×2下采样 |
| 学习率调度 | Cosine decay(scaling law实验中一致优于WSD) |
| Scaling效率 | 相比Kimi K2,整体scaling efficiency提升约2.5× |
训练数据
| 项目 | 详情 |
|---|---|
| 文本领域 | Web Text, Code, Mathematics, Knowledge四大领域 |
| 视觉数据 | Captions, interleaved image-text, OCR, perception, video, visual coding |
| 数据管线 | 基于K2/K2.5管线:rule-based heuristics + classifier quality scoring + deduplication |
| Knowledge/Math增强 | Rephrasing recipe(style/perspective-diverse prompting + chunk-wise autoregressive generation + fidelity verification) |
| 视觉编程数据 | 大规模programmatic multimodal data:SVG、3D assets、Webpage、Game、CAD schematics与其rendered visuals配对 |
| 坐标监督 | 同时提供absolute和normalized [0,1] 两种格式,实现精确且分辨率鲁棒的定位 |
| 具体数据量/配比 | 原文未详述 |
Infra设计
| 项目 | 详情 |
|---|---|
| 并行策略 | PP(VP) + EP + ZeRO-1DP + Pipeline ZeRO-2 gradient sharding + CP |
| KDA Context Parallelism (KCP) | 将长序列分到多rank,每rank独立计算本地state片段,通过一次fixed-size all-gather同步recurrent state(前缀扫描恢复),实现线性计算扩展 |
| MoonEP | Perfectly balanced EP:理论证明最多E/R个redundant experts per rank即可保证完美平衡;online GPU planning kernel近最优分配;zero-copy通信(直接发送到目标位置);static shapes免sync |
| Expert-GEMM调度 | Workload-aware scheduler,基于hardware metric分析模型自适应参数,避免SM worker间makespan不平衡 |
| 显存管理 | Unified activation manager:所有backward存储统一管理(local offload到CPU, remote offload到peer GPU/NVMe);activation recomputation结合tiered offload |
| 梯度优化 | ZeRO-2 gradient sharding + gradient offload to NVMe |
| 多模态编码优化 | ViT forward/backward与LLM PP stages overlap(不在critical path上) |
2. 后训练 Recipe (SFT)
训练策略
| 项目 | 详情 |
|---|---|
| 方法 | SFT作为cold-start policy,为后续RL提供基础 |
| 数据生成 | 用prior Kimi系列domain-specialized模型合成agentic trajectories + multi-stage verification + human-in-the-loop annotation |
| 数据格式 | XTML(eXtensible Token Markup Language)统一chat template序列化所有复杂agentic轨迹 |
| QAT | 从SFT阶段开始全程MXFP4权重+MXFP8激活的quantization-aware training |
| 目标能力 | Adaptive reasoning + precise tool calling + robust long-horizon agentic execution |
训练数据
| 项目 | 详情 |
|---|---|
| 规模 | “large-scale instruction dataset”(原文未给具体数量) |
| 来源 | 合成数据(domain-specialized model生成)+ 人工标注 |
| 覆盖 | 显著扩展了complex agentic tasks的覆盖面(相比K2/K2.5) |
3. RL Recipe
训练策略
| 项目 | 详情 |
|---|---|
| 三域×三effort | 3个domain(General、General Agent、Coding Agent)× 3个reasoning effort(low, high, max)= 9个expert models |
| General域 | General experience, vision, reasoning, faithfulness, search, knowledge work |
| General Agent域 | Long-horizon assistant, deep research, paragraph-level writing |
| Coding Agent域 | SWE, coding experience, kernel tasks, web development |
| 算法 | 基于K1.5/K2.5同步RL框架 + partial rollout + 1M上下文multi-step rollout |
| 关键观察 | ScalingRL FLOPs一致性提升各项能力,tool-call steps随FLOPs增长而增加 |
| 合并策略 | MOPD(Multi-Teacher On-Policy Distillation):9个domain expert作为teacher,student从每个teacher获取per-token OPD reward(clip到[-R_max, R_max]),密集奖励信号,自然支持partial rollout training |
| Deployment-Aware | ①MXFP4 QAT全程(SFT+RL),rollout和training共享量化方案消除mismatch ②Draft Model Fine-Tuning:将MTP层fine-tune为EAGLE-3 draft model,用LK loss直接优化acceptance rate |
| Draft model细节 | 融合target model的low/mid/high-level features(1st/4th/final AttnRes block输出),拼接后线性投影(初始化为[0,0,I]),训练时展开7步 |
训练数据(RL环境/任务)
| 项目 | 详情 |
|---|---|
| Unified Code Tasks | 结合LeetCode-style算法题+ real-world SWE tasks,统一评分(correctness + code quality metrics) |
| Kernel Optimization | CUDA/Triton/CuTeDSL/Gluon/ThunderKittens/TileLang,BF16/FP8/FP4,reward = correctness + performance vs roofline,含hacking detection |
| Personal Assistant | Mock implementations of Gmail/Notion/Slack/Canvas,multi-day persistent环境,单rollout可达thousands of tool calls + millions of context tokens |
| Visual Reasoning | Agent环境+Python interpreter sandbox:iteratively crop/zoom/transform image → execute → receive outputs,多步visual reasoning |
| Verification | Deterministic rules或LLM-based evaluators |
Infra 设计
| 项目 | 详情 |
|---|---|
| 框架 | Co-locatedRL(rollout+training同集群),few hundred GPUs per1M-context experiment |
| Partial rollout | 继承K1.5/K2.5的partial rollout降低tail latency |
| External KV Cache Pool | Write-back设计:active decoding blocks在GPU,idle prefixes write-back到CPU DRAM(含KDA states),prefetch回GPU before reuse;training时offload到NVMe释放DRAM |
| Auto-throttling scheduler | 基于active/queued request count + KV cache utilization动态调整并发,避免early under-saturation和late overload |
| Gradient-buffer reuse | Non-policy model(如reference model)权重CPU存储,需要时载入GPU并复用policy model的FP32 gradient buffer存储,零额外分配 |
| AgentENV | MicroVM-based sandbox(Firecracker):①完全隔离(可mount disk/run containers/launch VMs)②增量checkpoint(dirty pages only,133ms checkpoint / 49ms resume)③支持partial rollout的灵活生命周期管理 |
4. 关键亮点
- 2.8T / 104B激活:开源模型首次达到3T-class参数规模
- Hybrid KDA + Gated MLA:线性注意力(3层)与全局注意力(1层)混合,高效处理1M上下文
- Attention Residuals (Block模式):解决深层网络信息压缩瓶颈,只需8个block-level表示即可覆盖所有层
- Stable LatentMoE:NormalizedLatentMoE + SiTU-GLU + Quantile Balancing三组件解决896专家极端稀疏下的训练稳定性
- Per-Head Muon:避免大梯度head主导共享更新方向
- MoonViT-V2 from scratch:抛弃SigLIP初始化,直接用NTP训练ViT更稳定
- MOPD(Multi-Teacher On-Policy Distillation):9个domain×effort expert合并为单一模型,per-token dense reward
- MoonEP:理论保证完美负载均衡,zero-copy通信,static shapes免同步
- Million-token Agentic RL:External KV cache pool + auto-throttling + AgentENV microVM sandbox
- Deployment-Aware Training:全程MXFP4 QAT + EAGLE-3 draft model (LK loss优化)
- 整体scaling efficiency:相比K2提升约2.5×

