Qwen4 发布:混合架构让本地推理速度达到 Qwen3.8-27B 的 4.8 倍
有人在 DGX Spark 上实测了刚出的 Qwen4:比密集版 Qwen3.8-27B 快 4.8 倍,代价是内存多 12GB。文章讲清了 QSA 混合架构和 n-gram 表的参数账,本地部署玩家可以参考这套 llama.cpp 测试方法。
Qwen4-35B-A3B 发布,是 Qwen3.6-35B-A3B 之后的又一混合架构紧凑模型。它在 40 层中的 30 层使用 Gated DeltaNet,其余 10 层从全门控注意力改为 Qwen Sparse Attention(QSA),这一设计此前只在 Qwen3.8-Flash-Next(125B)上试验过。
名义上的 35B 参数有误导性:它附带一个 20B 的 n-gram 表,核心权重加嵌入层实际约 55B。作者在 DGX Spark 上用 llama.cpp 跑了 Q4_K_M 4-bit 量化、8K 上下文的对比测试:Qwen4 生成速度约 55 tokens/s,密集模型 Qwen3.8-27B 为 11.5 tokens/s,快 4.8 倍;prompt 处理快 2.5 倍;峰值内存分别为 32.5 GB 和 20.2 GB。
Qwen4 发布仅一天,作者已考虑将其作为 DGX Spark 上本地部署的日常主力模型。对在有限显存下追求生成速度的本地部署用户,稀疏注意力加线性注意力的混合方案提供了一个比纯密集模型更快的选项。
Good morning, Qwen4! What a week!
Like Qwen3.6-35B-A3B, Qwen4 uses Gated DeltaNet in 30 of its 40 layers. In the other 10, Qwen4 moved from full gated attention to Qwen Sparse Attention (QSA).
Sure, Qwen3.8-Flash-Next used this architecture design previously, but Qwen4 now brings that more experimental design to a nice, compact 35B model (down from 125B in Flash-Next).
Btw the 35B may be a bit misleading as it uses a 20B n-gram table and you get about 55B for the core and embeddings.
I just ran Qwen4 and the good old dense Qwen3.8-27B on my DGX Spark using llama.cpp for some comparisons (8K context, and 4-bit Q4_K_M weights):
- Qwen4 generated about 55 tokens/s versus 11.5 for Qwen3.8-27B. That’s 4.8x as fast. - It processed prompts 2.5x as fast. - Peak RAM was 32.5 GB for Qwen4 and 20.2 GB for Qwen3.8-27B.
Qwen4-35B-A3B has only been out a day, but it might be my next daily driver when it comes to local models on the DGX Spark.
This report is categorized under AITOP's "Models" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to US-China foundation model benchmarks and commercialization comparison and AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Qwen4, Qwen, llama.cpp, open-source models.
Source attribution: curated from Sebastian Raschka (@rasbt).