Kimi-K3 技术报告解读:2.8T 参数的混合线性注意力架构

解读 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
KDAKimi Delta Attention:delta-rule recurrence + channel-wise forget gate,chunk-wise parallel形式(chunk内并行,chunk间递推)
AttnResAttention 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
MTPMulti-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(前缀扫描恢复),实现线性计算扩展
MoonEPPerfectly 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

训练策略

项目详情
三域×三effort3个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 OptimizationCUDA/Triton/CuTeDSL/Gluon/ThunderKittens/TileLang,BF16/FP8/FP4,reward = correctness + performance vs roofline,含hacking detection
Personal AssistantMock implementations of Gmail/Notion/Slack/Canvas,multi-day persistent环境,单rollout可达thousands of tool calls + millions of context tokens
Visual ReasoningAgent环境+Python interpreter sandbox:iteratively crop/zoom/transform image → execute → receive outputs,多步visual reasoning
VerificationDeterministic 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 PoolWrite-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 reuseNon-policy model(如reference model)权重CPU存储,需要时载入GPU并复用policy model的FP32 gradient buffer存储,零额外分配
AgentENVMicroVM-based sandbox(Firecracker):①完全隔离(可mount disk/run containers/launch VMs)②增量checkpoint(dirty pages only,133ms checkpoint / 49ms resume)③支持partial rollout的灵活生命周期管理

4. 关键亮点

  1. 2.8T / 104B激活:开源模型首次达到3T-class参数规模
  2. Hybrid KDA + Gated MLA:线性注意力(3层)与全局注意力(1层)混合,高效处理1M上下文
  3. Attention Residuals (Block模式):解决深层网络信息压缩瓶颈,只需8个block-level表示即可覆盖所有层
  4. Stable LatentMoE:NormalizedLatentMoE + SiTU-GLU + Quantile Balancing三组件解决896专家极端稀疏下的训练稳定性
  5. Per-Head Muon:避免大梯度head主导共享更新方向
  6. MoonViT-V2 from scratch:抛弃SigLIP初始化,直接用NTP训练ViT更稳定
  7. MOPD(Multi-Teacher On-Policy Distillation):9个domain×effort expert合并为单一模型,per-token dense reward
  8. MoonEP:理论保证完美负载均衡,zero-copy通信,static shapes免同步
  9. Million-token Agentic RL:External KV cache pool + auto-throttling + AgentENV microVM sandbox
  10. Deployment-Aware Training:全程MXFP4 QAT + EAGLE-3 draft model (LK loss优化)
  11. 整体scaling efficiency:相比K2提升约2.5×
本文结束 感谢您的阅读