Kimi K3.1 Pro goes open: how Moonshot trained a model that pushes the coding frontier
Moonshot AI's 2.8-trillion-parameter Kimi K3.1 Pro is now downloadable on Hugging Face. How nine expert models were merged into one, what the team tried and dropped, and why it deliberately removed cybersecurity data.
Imagine asking an AI model to build a walking human on top of an open-source anatomical model of the body: 296 skeletal parts including cartilage, 402 muscles. In the first attempts the simulated human collapses within seconds. The model analyses the results, diagnoses the problems and refines the walking controller step by step until the figure walks continuously with alternating strides for 11.2 seconds. When reward tweaks fail to fix the arm motion, it stops adjusting the reward, probes the simulator itself, finds 36 errors in the shoulder-muscle calculations and fixes them. Moonshot AI describes this internal test in its announcement, and it sums up what Kimi K3.1 Pro is built for: long tasks that run for hours, where the model hunts down its own mistakes.
Moonshot AI introduced Kimi K3.1 Pro in late October and published the full model weights on Hugging Face on November 2. It is an open-weight model, so organisations can download it and run it on their own servers. It has 2.8 trillion parameters, of which 104 billion are active for each token, a 1-million-token context window and native image understanding. In the company's results it scores 65.7% on Terminal-Bench 4.0, a test of coding in the terminal, against 66.4% for Claude Opus 5.5 and 58.2% for GPT-6 Astra. This article explains what the model is, how it was trained step by step, what the team tried and dropped, why it deliberately removed cybersecurity data, and how you can try it.
What Kimi K3.1 Pro is
Kimi is the name of Moonshot AI's assistant and model family. In July the company launched Kimi K3, which it called the world's first open 3T-class model. K3.1 Pro builds on that base with far more post-training. It is the first model in the new K3.1 series and comes with Kimi K3.1 Pro Highspeed, which the company says responds 2 to 3 times faster. The model is available on kimi.ai, in the Kimi mobile apps, in the Kimi Work desktop app, in the Kimi Code terminal tool and through the Kimi API. Besides coding, Moonshot highlights three areas: 3D design, financial research and factual accuracy.
The idea: pre-training and post-training
A large language model grows up in two stages. Pre-training teaches it to predict the next word across web text, code and books, much like a broad university education. Post-training is the apprenticeship: the model practises real tasks, its results are measured, and the behaviour that works is reinforced through reinforcement learning. What separates K3.1 Pro from K3 is mostly this second stage. Moonshot says it spent substantially more compute on post-training and ran joint reinforcement learning across hundreds of domains at once. To make that work it rebuilt every layer of the stack: the RL framework, long-context inference, training efficiency, sandbox infrastructure, rollout scheduling and a shared platform for checking the quality of training environments, so that each extra unit of RL compute returns a stable, predictable gain.
How it was trained
There is no separate technical report for K3.1, but the 47-page technical report for the base model K3 is on GitHub. The training story comes from that report and from the differences listed in the K3.1 announcement.
Data. K3 was pre-trained on four main text domains: web text, code, mathematics and knowledge, plus a large vision corpus of captions, interleaved image and text documents, OCR, perception, video and visual coding data. Each domain was filtered with rules, quality classifiers and deduplication, and knowledge and maths texts were rephrased in varied styles and checked against their sources. The roots of the model's 3D skills are here: the team scaled up data that pairs code with the visuals it renders, across SVG, 3D assets, web pages, games and CAD schematics. The report does not give the total amount of training data.
Architecture. The model is a mixture of experts. Picture a hospital with 896 specialists where each patient sees only 16 of them, plus 2 general doctors who are always on duty. For each token the model picks 16 of 896 small expert networks, so only 104 billion of its 2.8 trillion parameters run at each step; Kimi K2 had 384 experts and picked 8. Of the 93 layers, 69 use Kimi Delta Attention (KDA), a linear attention layer that works like a student taking notes while reading, carrying a fixed-size summary instead of rereading the whole text, which costs far less on long inputs. The other 24 are global attention layers that look at the whole text. This is where K3.1 changes the architecture: those 24 layers swap K3's Gated MLA for Gated DeepSeek Sparse Attention (DSA), which picks the 2,048 most relevant positions at each step and handles the 1-million-token context more efficiently. Attention Residuals let each layer look back selectively at earlier layers instead of stacking all their outputs, and the 401-million-parameter MoonViT-V2 encoder handles vision. The report says these changes give roughly 2.5 times better scaling efficiency than Kimi K2.
Pre-training steps. Language and vision were trained together from the first step, with image and text tokens interleaved in one next-token objective. The optimiser is a per-head version of Muon, which Moonshot also used for K2, updating each attention head separately. The context window grew in stages: from 8K to 64K tokens during pre-training, then from 256K to 1M during the cooldown. The model uses no explicit positional encoding and learns order from the gating in its KDA layers. To make it truly use long context, the team synthesised documents and tasks whose answers are scattered across the full million tokens.
Post-training steps. The pipeline has three stages. First comes supervised fine-tuning on long agent trajectories produced by earlier Kimi models and passed through multi-stage verification and human annotation. Then reinforcement learning: three broad domains (general tasks, general agents and coding agents) are crossed with three reasoning-effort levels (low, high, max), and a separate expert is trained for each, nine experts in total. Effort levels are taught with budgets: a trajectory that goes over its token budget gets a penalty even if its answer is right. For tasks that cannot be checked automatically, a judge model first writes a rubric and then scores candidates against it, and a candidate that runs too long automatically loses the comparison. Finally the nine experts are merged into one model with multi-teacher on-policy distillation (MOPD), pulling the student towards the matching expert's token-level choices for each task.
Two details stand out. To keep the model from overfitting to one agent tool, the team built a training environment that imitates the tool definitions, system prompts and context handling of Kimi Code, Claude Code, Codex, OpenClaw and Hermes, and mixes them throughout training; the company evaluates K3.1 Pro inside the Claude Code harness for most coding results. And the model is trained in its compressed form from the start of fine-tuning: the expert weights are stored in 4-bit MXFP4 with MXFP8 activations, so the model adapts to the precision loss during training, and the released files use the same format. On top of this, K3.1 adds the joint RL across hundreds of domains and targeted work on factual accuracy: on an internal stress test built from deliberately hard prompts, the claim-level hallucination rate fell from 23.4% for K3 to 8.3%. Moonshot notes that the test is deliberately hard and does not reflect everyday error rates.
What was tried and dropped
The report also explains the paths the team turned back from. Starting the vision encoder from a pre-trained SigLIP model made joint training unstable, with persistently high and spiky gradients, so the encoder was trained from scratch with the language objective and matched the baseline on vision tests. Two learning-rate schedules were compared, WSD and cosine decay; with hyperparameters searched separately for each, cosine reached a lower loss and was adopted. The 896-expert layout first ran into exploding internal activations and a load-balancing problem across nearly a thousand experts; the fixes were an extra normalisation, a new bounded activation called SiTU-GLU and a method called Quantile Balancing. A finer-grained top-k distillation objective was also tested and dropped because it showed no clear gain in speed or results.
The known limitations listed for K3 are useful for K3.1 users too. The model works best when its earlier reasoning is passed back in full; switching to it in the middle of a session with another model can make output unstable, and the K3.1 Pro model card likewise asks for the reasoning content and tool calls to be returned as-is. Because training emphasises long, hard tasks, the model may also take unexpected decisions on the user's behalf when intent is unclear, so Moonshot recommends spelling out boundaries in the system prompt or an AGENTS.md file.
Why Moonshot removed cybersecurity data
This is the most intriguing part of the announcement. As post-training scaled, the team saw the model's vulnerability research skills rise steadily. Tracing the cause, they found cyber-related content mixed into the general mid-training corpus and cyber tasks in the RL environment mix. For the open-weight release they removed that data from both stages while keeping the general coding tasks. They measured the effect with xdev-bench-hard, an internal test that rebuilds recently disclosed real vulnerabilities in software such as the Linux kernel, Node.js, JavaScriptCore, Exim and VirGL with mitigations enabled; the agent must write an exploit, achieve code execution in a separate sandbox and retrieve a secret string. A checkpoint trained without the removal solves 90.5% of tasks, the released K3.1 Pro 81.0%. In the same table DeepSeek-V4.1-Flash-1017 scores 85.7% and GLM-5.3 57.1%.
The principle behind it is interesting: do not push the absolute frontier of this capability through open weights, but raise the security capability of open models step by step. Moonshot argues that a capable model that is open and runs on infrastructure its users control lets many more teams audit the code they maintain, including legacy systems that rarely get a dedicated security review, and that letting the capability spread gradually makes software safer overall.
Where it stands on benchmarks
Selected results from the table in Moonshot's model card are below. Kimi K3.1 Pro was measured at max reasoning effort; most competitor scores come from their own official reports or the benchmarks' leaderboards.
| Benchmark | Kimi K3.1 Pro | Claude Opus 5.5 | GPT-6 Astra | DeepSeek-V4.1-Flash-1017 |
|---|---|---|---|---|
| Terminal-Bench 4.0 (terminal coding) | 65.7 | 66.4 | 58.2 | 42.3 |
| SWE Marathon v1.1 (long software tasks) | 51.7 | 46.3 | 42.5 | 40.0 |
| DeepSWE v1.1 | 75.5 | 74.2 | 74.1 | 77.0 |
| ProgramBench | 31.5 | 65.0 | 50.0 | 29.1 |
| BenchCAD with tools (3D modelling) | 92.7 | 96.2 | 95.9 | 81.6 |
| BrowseComp (web research) | 92.1 | 90.8 | 91.5 | n/a |
| OfficeQA Pro v2 (financial documents) | 64.4 | 62.2 | 54.4 | 40.4 |
| OSWorld V2.1 (computer use) | 79.6 | 81.8 | 75.8 | 69.3 |
| HLE-Full, no tools (hard knowledge) | 51.1 | 59.8 | 53.6 | 42.6 |
| GPQA-Diamond (science) | 94.2 | 93.9 | 96.1 | 92.2 |
| ExploitBench (exploitation) | 74.7 | 91.0 | 100 | n/a |
The picture runs both ways. On SWE Marathon, which measures long software tasks, on BrowseComp for web research and on OfficeQA Pro v2 for financial documents, K3.1 Pro has the top score in the table. On Terminal-Bench 4.0 it is very close to Opus 5.5 and ahead of GPT-6 Astra. On ProgramBench, which asks for a full program that works almost perfectly, on the hard knowledge questions of HLE and on Terminal-Bench-Science (38.1 against 68.1 for Astra), it is clearly behind the closed models. On Moonshot's internal Kimi Code Bench 3.0 the score rose from 55.95% for K3 to 61.2%.
What it does in code, 3D and finance
Moonshot says K3.1 Pro covers coding from quick fixes to full-project builds and can combine game engines such as Unity, Unreal Engine and Godot with web search and 3D generation. On BenchCAD, which tests rebuilding objects from multi-view renderings through CAD code, it scores 92.7% with tools. From a text brief, a sketch or a reference image it can infer shape, proportions and spatial relationships and build parametric models such as mechanical parts, architectural models or custom furniture, writing and running scripts for Blender and CAD software. The new 3D Make feature on kimi.ai and in the Kimi app lets you edit these models online and download them ready for 3D printing. In finance, the internal tests show 7.2 points better financial modelling, 11.6 points better source-grounded research, and about 4.2 times K3's result in a simulated business management test.
How to try it
The simplest route is kimi.ai and the Kimi apps. Developers can pick K3.1 Pro in Kimi Code with the /model command. On the API the model is kimi-k3.1-pro, with OpenAI- and Anthropic-compatible endpoints, and reasoning effort is set with the reasoning_effort field to low, high or max. In enterprise accounts administrators have to enable the model first.
To run it on your own servers, the model files come to about 1.56 terabytes. According to the vLLM recipe, the simplest setup is one tensor-parallel group of 8 GPUs: one NVIDIA B300 node, two GB300 trays or one AMD MI355X node. SGLang and TokenSpeed are also recommended engines. The basic command:
vllm serve moonshotai/Kimi-K3.1-Pro \
--trust-remote-code \
--tensor-parallel-size 8 \
--enable-auto-tool-choice \
--tool-call-parser kimi_k3 \
--reasoning-parser kimi_k3The model is released under the Kimi K3.1 Pro License, which allows free download, modification and commercial use; very large commercial services should check the licence terms.
Kimi K3.1 Pro gives teams a strong downloadable option next to the closed models for long software work and research tasks, and with most of the training recipe documented in the technical report it also offers a map for other labs. Some benchmarks in the table are internal, and competitor scores were measured with different tools at different times. For a fuller picture, follow evaluations from independent researchers as well.
Sources: Kimi K3.1 Pro announcement, Hugging Face model card, Kimi K3 technical report, vLLM recipe