├── paper.pdf ├── figures ├── Xiaomi_MiMo.png ├── MiMo-v2-flash-arch.png ├── Xiaomi_MiMo_darkmode.png ├── wechat_group │ ├── wechat1.jpg │ ├── wechat2.jpg │ ├── wechat3.jpg │ └── wechat4.jpg └── MiMo-v2-flash-performance.jpg ├── LICENSE └── README.md /paper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/paper.pdf -------------------------------------------------------------------------------- /figures/Xiaomi_MiMo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/Xiaomi_MiMo.png -------------------------------------------------------------------------------- /figures/MiMo-v2-flash-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/MiMo-v2-flash-arch.png -------------------------------------------------------------------------------- /figures/Xiaomi_MiMo_darkmode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/Xiaomi_MiMo_darkmode.png -------------------------------------------------------------------------------- /figures/wechat_group/wechat1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/wechat_group/wechat1.jpg -------------------------------------------------------------------------------- /figures/wechat_group/wechat2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/wechat_group/wechat2.jpg -------------------------------------------------------------------------------- /figures/wechat_group/wechat3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/wechat_group/wechat3.jpg -------------------------------------------------------------------------------- /figures/wechat_group/wechat4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/wechat_group/wechat4.jpg -------------------------------------------------------------------------------- /figures/MiMo-v2-flash-performance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaomiMiMo/MiMo-V2-Flash/HEAD/figures/MiMo-v2-flash-performance.jpg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2025 Xiaomi Corporation. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |
4 | 5 | 6 | Xiaomi-MiMo 7 | 8 |
9 | 10 |
11 | 12 |
13 | | 14 | 🤗 HuggingFace 15 |  | 16 | 📔 Technical Report 17 |  | 18 | 📰 Blog 19 |  | 20 |

21 | Play around!   22 | 🗨️ Xiaomi MiMo Studio 23 |   24 | 🎨 Xiaomi MiMo API Platform 25 |
26 |
27 | 28 | # MiMo-V2-Flash 29 | 30 | **MiMo-V2-Flash** is a Mixture-of-Experts (MoE) language model with **309B total parameters** and **15B active parameters**. Designed for high-speed reasoning and agentic workflows, it utilizes a novel hybrid attention architecture and Multi-Token Prediction (MTP) to achieve state-of-the-art performance while significantly reducing inference costs. 31 | 32 |

33 | 34 |

35 | 36 | ----- 37 | 38 | ## 1. Introduction 39 | 40 | MiMo-V2-Flash creates a new balance between long-context modeling capability and inference efficiency. Key features include: 41 | 42 | * **Hybrid Attention Architecture**: Interleaves Sliding Window Attention (SWA) and Global Attention (GA) with a 5:1 ratio and an aggressive 128-token window. This reduces KV-cache storage by nearly 6x while maintaining long-context performance via learnable **attention sink bias**. 43 | * **Multi-Token Prediction (MTP)**: Equipped with a lightweight MTP module (0.33B params/block) using dense FFNs. This triples output speed during inference and will be good to accelerates rollout in RL training. 44 | * **Efficient Pre-Training**: Trained on 27T tokens using FP8 mixed precision and native 32k seq length. The context window supports up to 256k length. 45 | * **Agentic Capabilities**: Post-training utilizes Multi-Teacher On-Policy Distillation (MOPD) and large-scale agentic RL, achieving superior performance on **SWE-Bench** and complex reasoning tasks. 46 | 47 | ----- 48 | 49 | ## 2. Model Downloads 50 | 51 | | Model | Total Params | Active Params | Context Length | Download | 52 | | :--------------------- | :----------: | :-----------: | :------------: | :-------------------------------------------------------------------: | 53 | | **MiMo-V2-Flash-Base** | 309B | 15B | 256k | [🤗 HuggingFace](https://huggingface.co/XiaomiMiMo/MiMo-V2-Flash-Base) | 54 | | **MiMo-V2-Flash** | 309B | 15B | 256k | [🤗 HuggingFace](https://huggingface.co/XiaomiMiMo/MiMo-V2-Flash) | 55 | 56 | > [!IMPORTANT] 57 | > We also open-source the 3-layer MTP weights to foster community research. 58 | 59 | ----- 60 | 61 | ## 3. Evaluation Results 62 | 63 | ### Base Model Evaluation 64 | 65 | MiMo-V2-Flash-Base demonstrates strong performance across standard benchmarks, surpassing models with significantly larger parameter counts. 66 | 67 | | Category | Benchmark | Setting/Length | MiMo-V2-Flash Base | Kimi-K2 Base | DeepSeek-V3.1 Base | DeepSeek-V3.2 Exp Base | 68 | | :--------------- | :---------------------- | :------------- | :----------------: | :-------------: | :----------------: | :--------------------: | 69 | | **Params** | **#Activated / #Total** | - | **15B / 309B** | **32B / 1043B** | **37B / 671B** | **37B / 671B** | 70 | | **General** | BBH | 3-shot | 88.5 | 88.7 | 88.2 | 88.7 | 71 | | | MMLU | 5-shot | 86.7 | 87.8 | 87.4 | 87.8 | 72 | | | MMLU-Redux | 5-shot | 90.6 | 90.2 | 90.0 | 90.4 | 73 | | | MMLU-Pro | 5-shot | 73.2 | 69.2 | 58.8 | 62.1 | 74 | | | DROP | 3-shot | 84.7 | 83.6 | 86.3 | 86.6 | 75 | | | ARC-Challenge | 25-shot | 95.9 | 96.2 | 95.6 | 95.5 | 76 | | | HellaSwag | 10-shot | 88.5 | 94.6 | 89.2 | 89.4 | 77 | | | WinoGrande | 5-shot | 83.8 | 85.3 | 85.9 | 85.6 | 78 | | | TriviaQA | 5-shot | 80.3 | 85.1 | 83.5 | 83.9 | 79 | | | GPQA-Diamond | 5-shot | 55.1 | 48.1 | 51.0 | 52.0 | 80 | | | SuperGPQA | 5-shot | 41.1 | 44.7 | 42.3 | 43.6 | 81 | | | SimpleQA | 5-shot | 20.6 | 35.3 | 26.3 | 27.0 | 82 | | **Math** | GSM8K | 8-shot | 92.3 | 92.1 | 91.4 | 91.1 | 83 | | | MATH | 4-shot | 71.0 | 70.2 | 62.6 | 62.5 | 84 | | | AIME 24&25 | 2-shot | 35.3 | 31.6 | 21.6 | 24.8 | 85 | | **Code** | HumanEval+ | 1-shot | 70.7 | 84.8 | 64.6 | 67.7 | 86 | | | MBPP+ | 3-shot | 71.4 | 73.8 | 72.2 | 69.8 | 87 | | | CRUXEval-I | 1-shot | 67.5 | 74.0 | 62.1 | 63.9 | 88 | | | CRUXEval-O | 1-shot | 79.1 | 83.5 | 76.4 | 74.9 | 89 | | | MultiPL-E HumanEval | 0-shot | 59.5 | 60.5 | 45.9 | 45.7 | 90 | | | MultiPL-E MBPP | 0-shot | 56.7 | 58.8 | 52.5 | 50.6 | 91 | | | BigCodeBench | 0-shot | 70.1 | 61.7 | 63.0 | 62.9 | 92 | | | LiveCodeBench v6 | 1-shot | 30.8 | 26.3 | 24.8 | 24.9 | 93 | | | SWE-Bench (AgentLess) | 3-shot | 30.8 | 28.2 | 24.8 | 9.4* | 94 | | **Chinese** | C-Eval | 5-shot | 87.9 | 92.5 | 90.0 | 91.0 | 95 | | | CMMLU | 5-shot | 87.4 | 90.9 | 88.8 | 88.9 | 96 | | | C-SimpleQA | 5-shot | 61.5 | 77.6 | 70.9 | 68.0 | 97 | | **Multilingual** | GlobalMMLU | 5-shot | 76.6 | 80.7 | 81.9 | 82.0 | 98 | | | INCLUDE | 5-shot | 71.4 | 75.3 | 77.2 | 77.2 | 99 | | **Long Context** | NIAH-Multi | 32K | 99.3 | 99.8 | 99.7 | 85.6* | 100 | | | | 64K | 99.9 | 100.0 | 98.6 | 85.9* | 101 | | | | 128K | 98.6 | 99.5 | 97.2 | 94.3* | 102 | | | | 256K | 96.7 | - | - | - | 103 | | | GSM-Infinite Hard | 16K | 37.7 | 34.6 | 41.5 | 50.4 | 104 | | | | 32K | 33.7 | 26.1 | 38.8 | 45.2 | 105 | | | | 64K | 31.5 | 16.0 | 34.7 | 32.6 | 106 | | | | 128K | 29.0 | 8.8 | 28.7 | 25.7 | 107 | 108 | > \* indicates the model may fail to follow the prompt or format. 109 | 110 | ### Post-training Model Evaluation 111 | 112 | Following our Post-Training Paradigm with MOPD and Agentic RL, the model achieves SOTA reasoning and agentic performance. 113 | 114 | 115 | 116 | | Benchmark | MiMo-V2 Flash | Kimi-K2 Thinking | DeepSeek-V3.2 Thinking | Gemini-3.0 Pro | Claude Sonnet 4.5 | GPT-5 High | 117 | | :----------------------------- | :-----------: | :--------------: | :--------------------: | :------------: | :---------------: | :--------: | 118 | | **Reasoning** | | | | | | | 119 | | MMLU-Pro | 84.9 | 84.6 | 85.0 | 90.1 | 88.2 | 87.5 | 120 | | GPQA-Diamond | 83.7 | 84.5 | 82.4 | 91.9 | 83.4 | 85.7 | 121 | | HLE (no tools) | 22.1 | 23.9 | 25.1 | 37.5 | 13.7 | 26.3 | 122 | | AIME 2025 | 94.1 | 94.5 | 93.1 | 95.0 | 87.0 | 94.6 | 123 | | HMMT Feb. 2025 | 84.4 | 89.4 | 92.5 | 97.5 | 79.2 | 88.3 | 124 | | LiveCodeBench-v6 | 80.6 | 83.1 | 83.3 | 90.7 | 64.0 | 84.5 | 125 | | **General Writing** | | | | | | | 126 | | Arena-Hard (Hard Prompt) | 54.1 | 71.9 | 53.4 | 72.6 | 63.3 | 71.9 | 127 | | Arena-Hard (Creative Writing) | 86.2 | 80.1 | 88.8 | 93.6 | 76.7 | 92.2 | 128 | | **Long Context** | | | | | | | 129 | | LongBench V2 | 60.6 | 45.1 | 58.4 | 65.6 | 61.8 | - | 130 | | MRCR | 45.7 | 44.2 | 55.5 | 89.7 | 55.4 | - | 131 | | **Code Agent** | | | | | | | 132 | | SWE-Bench Verified | 73.4 | 71.3 | 73.1 | 76.2 | 77.2 | 74.9 | 133 | | SWE-Bench Multilingual | 71.7 | 61.1 | 70.2 | - | 68.0 | 55.3 | 134 | | Terminal-Bench Hard | 30.5 | 30.6 | 35.4 | 39.0 | 33.3 | 30.5 | 135 | | Terminal-Bench 2.0 | 38.5 | 35.7 | 46.4 | 54.2 | 42.8 | 35.2 | 136 | | **General Agent** | | | | | | | 137 | | BrowseComp | 45.4 | - | 51.4 | - | 24.1 | 54.9 | 138 | | BrowseComp (w/ Context Manage) | 58.3 | 60.2 | 67.6 | 59.2 | - | - | 139 | | $\tau^2$-Bench | 80.3 | 74.3 | 80.3 | 85.4 | 84.7 | 80.2 | 140 | 141 | ----- 142 | 143 | ## 4. Model Architecture 144 | 145 |

146 | 147 |

148 | 149 | ### Hybrid Sliding Window Attention 150 | 151 | MiMo-V2-Flash addresses the quadratic complexity of long contexts by interleaving Local Sliding Window Attention (SWA) and Global Attention (GA). 152 | 153 | * **Configuration**: Stacks of $M=8$ hybrid blocks. Each block contains $N=5$ SWA layers followed by 1 GA layer. 154 | * **Efficiency**: SWA layers use a window size of 128 tokens, reducing KV cache significantly. 155 | * **Sink Bias**: Learnable attention sink bias is applied to maintain performance despite the aggressive window size. 156 | 157 | ### Lightweight Multi-Token Prediction (MTP) 158 | 159 | Unlike traditional speculative decoding, our MTP module is natively integrated for training and inference. 160 | 161 | * **Structure**: Uses a dense FFN (instead of MoE) and SWA (instead of GA) to keep the parameter count low (0.33B per block). 162 | * **Performance**: Facilitates self-speculative decoding, tripling generation speed and mitigating GPU idleness during small-batch RL training. 163 | 164 | ----- 165 | 166 | ## 5. Post-Training Technical Highlights 167 | 168 | MiMo-V2-Flash leverages a post-training pipeline designed to maximize reasoning and agentic capabilities through innovative distillation and reinforcement learning strategies. 169 | 170 | ### 5.1 Multi-Teacher On-Policy Distillation (MOPD) 171 | 172 | We introduce **Multi-Teacher On-Policy Distillation (MOPD)**, a new paradigm that formulates knowledge distillation as a reinforcement learning process. 173 | * **Dense Token-Level Guidance**: Unlike methods relying on sparse sequence-level feedback, MOPD utilizes domain-specific expert models (teachers) to provide supervision at every token position. 174 | * **On-Policy Optimization**: The student model learns from its own generated responses rather than a fixed dataset. This eliminates exposure bias and ensures smaller, more stable gradient updates. 175 | * **Inherent Reward Robustness**: Rewards are derived from the distribution divergence between student and teacher, making the process naturally resistant to reward hacking. 176 | 177 | ### 5.2 Scaling Agentic RL 178 | 179 | We significantly scale up the agentic training environments to improve intelligence and generalization. 180 | * **Massive Code Agent Environments**: We utilize real-world GitHub issues to create over 100,000 verifiable tasks. Our automated pipeline maintains a Kubernetes cluster capable of running over 10,000 concurrent pods with a 70% environment setup success rate. 181 | * **Multimodal Verifier for WebDev**: For web development tasks, we employ a vision-based verifier that evaluates code execution via recorded videos rather than static screenshots. This reduces visual hallucination and ensures functional correctness. 182 | * **Cross-Domain Generalization**: Our experiments show that large-scale RL training on code agents effectively generalizes to other domains, boosting performance in Math and General Agent tasks. 183 | 184 | ### 5.3 Advanced RL Infrastructure 185 | 186 | To support high-throughput RL training for large-scale MoE models, we implemented several infrastructure optimizations on top of SGLang and Megatron-LM. 187 | * **Rollout Routing Replay (R3)**: Addresses numerical precision inconsistencies in MoE routing between inference and training. R3 reuses the exact routed experts from rollout during the training pass, ensuring consistency with negligible overhead. 188 | * **Request-Level Prefix Cache**: In multi-turn agent training, this cache stores KV states and routed experts from prior turns. It avoids re-computation and ensures sampling consistency across turns. 189 | * **Fine-Grained Data Scheduler**: We extend the rollout engine to schedule fine-grained sequences instead of micro-batches. Combined with partial rollout, this significantly reduces GPU idleness caused by long-tail stragglers. 190 | * **Toolbox & Tool Manager**: A two-layer design using Ray actor pools to handle resource contention. It eliminates cold-start delays for tool execution and isolates task logic from system policies. 191 | 192 | ----- 193 | 194 | ## 6. Inference & Deployment 195 | 196 | MiMo-V2-Flash supports FP8 mixed precision inference. We recommend using **SGLang** for optimal performance. 197 | 198 | ### Quick Start with SGLang 199 | 200 | Following https://lmsys.org/blog/2025-12-16-mimo-v2-flash/, please use the compatible SGLang version as follows. 201 | 202 | ```bash 203 | pip install sglang==0.5.6.post2.dev8005+pr.15207.g39d5bd57a \ 204 | --index-url https://sgl-project.github.io/whl/pr/ \ 205 | --extra-index-url https://pypi.org/simple 206 | 207 | #Launch the server 208 | SGLANG_ENABLE_SPEC_V2=1 python3 -m sglang.launch_server \ 209 | --model-path XiaomiMiMo/MiMo-V2-Flash \ 210 | --served-model-name mimo-v2-flash \ 211 | --pp-size 1 \ 212 | --dp-size 2 \ 213 | --enable-dp-attention \ 214 | --tp-size 8 \ 215 | --moe-a2a-backend deepep \ 216 | --page-size 1 \ 217 | --host 0.0.0.0 \ 218 | --port 9001 \ 219 | --trust-remote-code \ 220 | --mem-fraction-static 0.75 \ 221 | --max-running-requests 128 \ 222 | --chunked-prefill-size 16384 \ 223 | --reasoning-parser qwen3 \ 224 | --tool-call-parser mimo \ 225 | --context-length 262144 \ 226 | --attention-backend fa3 \ 227 | --speculative-algorithm EAGLE \ 228 | --speculative-num-steps 3 \ 229 | --speculative-eagle-topk 1 \ 230 | --speculative-num-draft-tokens 4 \ 231 | --enable-mtp 232 | 233 | # Send request 234 | curl -i http://localhost:9001/v1/chat/completions \ 235 | -H 'Content-Type:application/json' \ 236 | -d '{ 237 | "messages" : [{ 238 | "role": "user", 239 | "content": "Nice to meet you MiMo" 240 | }], 241 | "model": "mimo-v2-flash", 242 | "max_tokens": 4096, 243 | "temperature": 0.8, 244 | "top_p": 0.95, 245 | "stream": true, 246 | "chat_template_kwargs": { 247 | "enable_thinking": true 248 | } 249 | }' 250 | ``` 251 | 252 | ### Notifications 253 | 254 | #### 1. System prompt 255 | 256 | > [!IMPORTANT] 257 | > The following system prompts are **HIGHLY** recommended, please choose from English and Chinese version. 258 | 259 | English 260 | 261 | ```plaintext 262 | You are MiMo, an AI assistant developed by Xiaomi. 263 | 264 | Today's date: {date} {week}. Your knowledge cutoff date is December 2024. 265 | ``` 266 | 267 | Chinese 268 | 269 | ```plaintext 270 | 你是MiMo(中文名称也是MiMo),是小米公司研发的AI智能助手。 271 | 272 | 今天的日期:{date} {week},你的知识截止日期是2024年12月。 273 | ``` 274 | 275 | #### 2. Sampling parameters 276 | 277 | > [!IMPORTANT] 278 | > Recommended sampling parameters: 279 | > 280 | > `top_p=0.95` 281 | > 282 | > `temperature=0.8` for math, writing, web-dev 283 | > 284 | > `temperature=0.3` for agentic taks (e.g., vibe-coding, tool-use) 285 | 286 | #### 3. Tool-use practice 287 | 288 | > [!IMPORTANT] 289 | > In the thinking mode with multi-turn tool calls, the model returns a `reasoning_content` field alongside `tool_calls`. To continue the conversation, the user must persist all history `reasoning_content` in the `messages` array of each subsequent request. 290 | 291 | ----- 292 | 293 | ## 7. Citation 294 | 295 | If you find our work helpful, please cite our technical report: 296 | 297 | ```bibtex 298 | @misc{mimo2025flash, 299 | title={MiMo-V2-Flash Technical Report}, 300 | author={LLM-Core Xiaomi}, 301 | year={2025}, 302 | url={https://github.com/XiaomiMiMo/MiMo-V2-Flash/blob/main/paper.pdf} 303 | } 304 | ``` 305 | 306 | ## 8. Contact 307 | 308 | Please contact us at [mimo@xiaomi.com](mailto:mimo@xiaomi.com), join our WeChat group below or open an issue if you have any questions. 309 | 310 |

311 | 312 | 313 | 314 | 315 |

316 | --------------------------------------------------------------------------------