Inside Trillion-Parameter Open Models: Architecture and Training Lessons from Kimi K2
An in-depth look at how trillion-parameter sparse MoE models like Kimi K2 balance expert count, attention heads, and training stability, plus practical guidance on choosing between Base and Instruct versions and evaluating benchmark claims.
Why Trillion-Parameter Models Need Sparsity
Large language models currently follow two main design paths. Dense models activate all parameters on every inference step: capability grows with scale, but so does compute cost. Mixture-of-Experts (MoE) models split the feed-forward network into multiple experts, with a router selecting only a small subset of experts for each token. Total parameters can be very large, while the compute per forward pass stays comparable to the activated parameters alone.
Kimi K2, open-sourced by Moonshot AI in July 2025, is a representative model of this approach. According to its technical report, the model has roughly 1T total parameters and activates about 32B per inference. This article uses Kimi K2’s public materials to illustrate the key trade-offs in architecture, training, model versions, and deployment for this class of models. All figures come from official releases and should be verified against the original documentation before use.
Trade-offs Between Expert Count and Attention Heads
MoE models have two critical hyperparameters: the number of experts and the number of attention heads. Increasing the expert count while shrinking each expert lets the router assign different token types to the specialists best suited to them, improving parameter utilization. Kimi K2 uses 384 experts, activating 8 per token, plus one shared expert that handles general knowledge.
More experts mean a higher risk of load imbalance. If the router keeps sending requests to a few popular experts, the rest are undertrained and their parameters go to waste. Three common mitigation techniques are:
- Auxiliary load-balancing loss: an additional regularization term, on top of the main loss, that encourages experts to be selected evenly.
- Expert capacity limits: capping the number of tokens each expert can receive per batch, with overflow routed to other experts or dropped.
- Routing noise: adding small perturbations to routing scores early in training to prevent the router from prematurely locking in.
Attention heads capture dependencies within a sequence, but more heads means a larger KV cache and more memory usage. K2 uses 64 attention heads, down from the 128 in DeepSeek-V3, to reduce memory-access pressure during long-context inference.
To reproduce such a configuration in a model of your own, the common approach is to fix a total compute budget, compare different combinations of expert and head counts using small proxy models, then scale up to the target size. The effectiveness of this method depends on how well proxy experiments correlate with the final scale, which needs separate validation.
Training Stability: The MuonClip Optimizer
Training of large Transformer models has long been dominated by AdamW. In large-scale MoE training, the router and expert parameters update at different rhythms, gradient variance can increase, loss spikes appear, and in the worst case training collapses. Every rollback and restart consumes significant compute, so training stability directly affects cost.
MuonClip consists of two parts. The first is Muon, which orthogonalizes the momentum updates for two-dimensional weight matrices, making each step’s update more uniform at the matrix level. It mainly applies to the weight matrices of linear layers; embedding layers and normalization parameters typically still use other optimizers. The second is QK-Clip, which monitors the maximum attention logit during training. Once it exceeds a set threshold, the Query and Key projection weights of the corresponding attention head are scaled down proportionally, suppressing anomalous scores at the source.
The two components have distinct roles: Muon governs update quality, while QK-Clip controls the risk of attention logit explosion. According to Kimi K2’s technical report, the roughly 15.5T-token pretraining run showed no significant loss spikes. This result came from a single training run; other teams using different data and architectures may not reproduce it, so small-scale validation is advisable before adopting a similar scheme.
Choosing Between Base and Instruct Versions
Open models usually ship in two versions. The Base version retains full language modeling capability without instruction alignment, suited to researchers doing continued pretraining, domain-specific fine-tuning, or knowledge distillation. The Instruct version has been instruction-tuned and aligned, and can be used directly for chat, code generation, and agent tasks.
Choose based on your goal:
- Researching training methods or doing continued pretraining on large domain corpora: choose Base.
- Light fine-tuning on private data while preserving general chat ability: usually start from Instruct, then check whether the original capabilities degrade after tuning.
- Simply integrating the model into a product or dev tool: choose Instruct, and test it first with your own task set.
When a Base version is used directly for conversation, you typically need to design your own prompts and alignment pipeline, and output formats tend to be less stable.
How to Verify Benchmark Results
Evaluating a trillion-parameter model requires covering multiple dimensions. Common categories include repository-level code fixing, tool calling, math and reasoning, and human preference evaluations based on anonymous head-to-head voting.
When reading benchmark reports, check the following:
- Benchmark name and version. For example, scores from SWE-bench Verified and other variants in the same family are not directly comparable.
- Evaluation framework. Whether agent scaffolding, tool sets, and timeout settings were used.
- Attempt count. Single-pass rates and best-of-multiple-pass results differ substantially.
- Inference parameters. Including temperature, maximum output length, and context length.
According to Kimi K2’s official report, its performance on SWE-bench Verified demonstrates competitiveness in agentic coding tasks—readers should consult the original documentation for exact figures and evaluation conditions.
