MiniCPM4:面向终端设备的超高效大语言模型

MiniCPM4: Ultra-Efficient LLMs on End Devices

MiniCPM Team (OpenBMB) MiniCPM Team (OpenBMB) · OpenBMB · 2025-06-09 · arXiv:2506.07900 ↗ · 被引 44

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

本文介绍了 MiniCPM4,一种专为终端设备设计的高效大语言模型。我们通过在模型架构、训练数据、训练算法和推理系统四个关键维度上的系统创新实现了这一效率。具体而言,在模型架构方面,我们提出了 InfLLM v2,一种可训练的稀疏注意力机制,可加速长上下文处理中的预填充和解码阶段。在训练数据方面,我们提出了 UltraClean,一种高效准确的预训练数据过滤和生成策略,以及 UltraChat v2,一个全面的监督微调数据集。这些数据集使得仅使用 8 万亿训练令牌就能实现令人满意的模型性能。在训练算法方面,我们提出了 ModelTunnel v2 用于高效的预训练策略搜索,并通过引入分块展开以实现负载均衡的强化学习以及数据高效的三元 LLM BitCPM,改进了现有的后训练方法。在推理系统方面,我们提出了 CPM.cu,它集成了稀疏注意力、模型量化和推测采样,以实现高效的预填充和解码。为了满足多样化的设备端需求,MiniCPM4 提供两个版本,参数分别为 0.5B 和 8B。此外,我们构建了一个混合推理模型 MiniCPM4.1,它可以在深度推理模式和非推理模式下使用。评估结果表明,MiniCPM4 和 MiniCPM4.1 在基准测试中优于同等规模的开源模型,其中 8B 变体在长序列理解和生成方面显示出显著的加速效果。

This paper introduces MiniCPM4, a highly efficient large language model (LLM) designed explicitly for end-side devices. We achieve this efficiency through systematic innovation in four key dimensions: model architecture, training data, training algorithms, and inference systems. Specifically, in terms of model architecture, we propose InfLLM v2, a trainable sparse attention mechanism that accelerates both prefilling and decoding phases for long-context processing. Regarding training data, we propose UltraClean, an efficient and accurate pre-training data filtering and generation strategy, and UltraChat v2, a comprehensive supervised fine-tuning dataset. These datasets enable satisfactory model performance to be achieved using just 8 trillion training tokens. Regarding training algorithms, we propose ModelTunnel v2 for efficient pre-training strategy search, and improve existing post-training methods by introducing chunk-wise rollout for load-balanced reinforcement learning and data-efficient tenary LLM, BitCPM. Regarding inference systems, we propose CPM.cu that integrates sparse attention, model quantization, and speculative sampling to achieve efficient prefilling and decoding. To meet diverse on-device requirements, MiniCPM4 is available in two versions, with 0.5B and 8B parameters, respectively. Furthermore, we construct a hybrid reasoning model, MiniCPM4.1, which can be used in both deep reasoning mode and non-reasoning mode. Evaluation results demonstrate that MiniCPM4 and MiniCPM4.1 outperform similar-sized open-source models across benchmarks, with the 8B variants showing significant speed improvements on long sequence understanding and generation.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 23)

阅读逐段中英对照全文 →