SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment
SmallThinker 是一种专为本地部署设计的大型语言模型系列,通过创新的架构和优化技术,实现了在资源受限的设备上高效运行。
更新于 2025-08-08。作者:Yixin Song、Zhenliang Xue、Dongliang Wei、Feiyang Chen、Jianxiang Gao、Junchen Liu、Hangyu Liang、Guangshuo Qin、Chengrong Tian、Bo Wen、Longyu Zhao、Xinrui Zheng、Zeyu Mi、Haibo Chen。
中文摘要
尽管前沿的大型语言模型(LLMs)持续推动能力边界,但它们的部署仍然局限于由GPU驱动的云基础设施。我们挑战这种模式,推出了SmallThinker系列LLMs,这些模型是针对本地设备的独特限制——计算能力弱、内存有限和存储速度慢——原生设计,而非适应性改造。与传统方法主要压缩为云构建的现有模型不同,我们从底层架构SmallThinker,使其能够在这些限制中茁壮成长。我们的创新在于一个部署感知架构,它将限制转化为设计原则。首先,我们引入了一种两级稀疏结构,结合了细粒度的专家混合(MoE)与稀疏前馈网络,大幅降低计算需求,同时不牺牲模型容量。其次,为了克服慢速存储的I/O瓶颈,我们设计了一个预注意力路由器,使我们的协同设计的推理引擎在计算注意力时能够从存储中预取专家参数,从而有效地隐藏存储延迟,否则这种延迟会严重削弱设备上的推理能力。第三,为了提高内存效率,我们利用NoPE-RoPE混合稀疏注意力机制,大幅削减KV缓存需求。我们发布了SmallThinker-4B-A0.6B和SmallThinker-21B-A3B,这两个模型实现了最先进的性能分数,甚至超过了更大的LLMs。值得注意的是,我们的协同设计系统基本上消除了对昂贵GPU硬件的需求:通过Q4_0量化,这两个模型在普通消费级CPU上每秒超过20个token,分别消耗1GB和8GB的内存。SmallThinker可在hf.co/PowerInfer/SmallThinker-4BA0.6B-Instruct和hf.co/PowerInfer/SmallThinker-21BA3B-Instruct公开获取。
英文摘要
While frontier large language models (LLMs) continue to push capability boundaries, their deployment remains confined to GPU-powered cloud infrastructure. We challenge this paradigm with SmallThinker, a family of LLMs natively designed - not adapted - for the unique constraints of local devices: weak computational power, limited memory, and slow storage. Unlike traditional approaches that mainly compress existing models built for clouds, we architect SmallThinker from the ground up to thrive within these limitations. Our innovation lies in a deployment-aware architecture that transforms constraints into design principles. First, We introduce a two-level sparse structure combining fine-grained Mixture-of-Experts (MoE) with sparse feed-forward networks, drastically reducing computational demands without sacrificing model capacity. Second, to conquer the I/O bottleneck of slow storage, we design a pre-attention router that enables our co-designed inference engine to prefetch expert parameters from storage while computing attention, effectively hiding storage latency that would otherwise cripple on-device inference. Third, for memory efficiency, we utilize NoPE-RoPE hybrid sparse attention mechanism to slash KV cache requirements. We release SmallThinker-4B-A0.6B and SmallThinker-21B-A3B, which achieve state-of-the-art performance scores and even outperform larger LLMs. Remarkably, our co-designed system mostly eliminates the need for expensive GPU hardware: with Q4_0 quantization, both models exceed 20 tokens/s on ordinary consumer CPUs, while consuming only 1GB and 8GB of memory respectively. SmallThinker is publicly available at hf.co/PowerInfer/SmallThinker-4BA0.6B-Instruct and hf.co/PowerInfer/SmallThinker-21BA3B-Instruct.
解读
一句话总结
SmallThinker 是一种专为本地部署设计的大型语言模型系列,通过创新的架构和优化技术,实现了在资源受限的设备上高效运行。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:当前大型语言模型(LLM)的部署局限于强大的云基础设施,难以在本地设备上运行。
- 现有方案不足:现有方案主要针对云环境设计的模型进行压缩或剪枝,牺牲了模型能力以适应本地设备。
- 研究目标:设计并实现一套适合本地部署的大型语言模型,同时保持高性能。
问题2:论文的核心创新点是什么?
- 技术创新:提出了一种部署感知的架构,将本地设备的限制转化为设计原则。
- 方法改进:引入了两级稀疏结构、预注意力路由器、NoPE-RoPE 混合稀疏注意力机制等。
- 优势:在保持模型能力的同时,显著降低了计算需求、内存使用和存储延迟。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个基准测试中评估 SmallThinker 的性能。
- 性能提升:SmallThinker-21B-A3B 和 SmallThinker-4B-A0.6B 在 MMLU 等基准测试中取得了最先进的性能。
- 对比结果:与基线模型相比,SmallThinker 在速度和准确性方面都有显著提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于智能手机、笔记本电脑等本地设备,为用户提供强大的 AI 功能。
- 实施建议:利用 SmallThinker 的轻量级特性,将 AI 功能扩展到更广泛的设备。
- 局限与展望:未来将扩大预训练数据集,并实施 RLHF 以进一步提升模型质量。