开源权重大语言模型的架构:MoE、混合层、三元权重
The architecture of open-weight LLMs: MoE, hybrid layers, ternary weights

原始链接: https://www.silasdata.com/llm-playground-inside-architectures/

本研究比较了可在 8GB GPU 上运行的开源大语言模型架构,考察每种设计对性能与权衡的影响。稠密 Transformer 仍是基线:所有参数都参与计算,生成成本随模型规模和 KV 缓存内存增长。为降低成本,架构采用分组查询注意力、滑动窗口、潜在注意力、MoE 稀疏性、混合循环/卷积层、逐层嵌入、量化和三元权重。MoE 模型参数众多但每 token 只激活少量,将瓶颈转向内存带宽。混合模型用固定状态或短卷积层替代大多数注意力层以限制缓存增长,但检索可能下降。小模型通过大量训练、蒸馏和额外嵌入表提升容量。量化和三元权重可减少内存并加速生成。运行时行为取决于 VRAM、RAM、PCIe 带宽、上下文大小、预填充批处理和解码内存带宽;当模型超出 VRAM 时,权重可运行在 CPU 或共享内存上。下一篇将控制条件下对这些预期进行基准测试。

``` Hacker News 新 | 过往 | 评论 | 提问 | 展示 | 工作 | 提交 登录 开放权重大语言模型的架构:MoE、混合层、三元权重 ( silasdata.com ) 5 分 作者 silasyl 2 小时前 | 隐藏 | 过往 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索: ```
相关文章

原文

The Architectures

Over the last few years, research on large language models has exploded, and with it came a wave of new architectures, techniques and design tricks. The variety of models available at the end of 2026 is far greater than what existed only a year ago.

The idea of this study is to understand how these different architectures affect performance, what each of them gains and what each gives up. These are exactly the questions an AI engineer faces when designing a solution around a model. All the models used here were selected to run on a computer with an 8 GB GPU, and together they try to cover the range of architectures found in today’s open-source landscape.

ModelParameters (total / active)ArchitectureWeightsDate of Release
Llama 3.1 8B8.0B / 8.0BDense, attention (GQA)Q4_K_MJul/2024
Llama 3.2 3B3.2B / 3.2BDense, attention (GQA)Q8_0Sep/2024
Qwen2.5 7B7.6B / 7.6BDense, attention (GQA)Q4_K_MSep/2024
Qwen3-VL 4B4.4B / 4.4BDense, attentionQ8_0Sep/2025
Qwen3.6-35B-A3B35B / 3BMoE, Gated DeltaNet + attention (30 + 10 layers)UD-Q4_K_XLApr/2026
Gemma 3 4B4.3B / 4.3BDense, local + global attentionQ8_0Aug/2025
Gemma 4 E4B~8B / 4.5B effectiveDense, attention, per-layer embeddingsUD-Q4_K_XLApr/2026
Phi-4-multimodal5.6B / 5.6BDense, attentionQ4_K_MFeb/2025
gpt-oss-20b21B / 3.6BMoE, local + global attentionMXFP4 (original)Aug/2025
Nemotron 3 Nano Omni30B / 3BMoE, Mamba-2 + attentionUD-Q4_K_XLApr/2026
LFM3 1.7B1.7B / 1.7BDense, short convolutions + local and global attention (13 + 5 + 6 layers)BF16 (original)Oct/2026
Ternary Bonsai 2 27B27B / 27BDense, recurrent + attention (48 + 16 layers), ternary weightsPTQ1_0 (~1.6 bits)Sep/2026

The Dense Transformer

Every model in this study descends from the same origin, the Transformer [1]. In its original form it is a stack of identical blocks, each made of an attention layer, where every token gathers information from the tokens before it, and a feed-forward network (FFN), which then transforms each token on its own. The model is dense: every parameter takes part in the computation of every token.

For several years, progress came mostly from making this structure larger. The scaling laws [2], and later the Chinchilla results [3], showed that loss falls predictably as parameters and training data grow, and models moved from billions to hundreds of billions of parameters. The architecture itself barely changed. What changed was the bill, and it arrives in two forms.

The first, the weights, are the learned parameters of the model: the projection matrices of the attention layers and, above all, the matrices of the FFNs, which hold most of the parameters. In a dense model, generating a token means reading every one of these weights once, so both the memory footprint and the cost per token grow with the model’s size. The second, the KV cache memory, is less visible and grows while the model is being used. To avoid recomputing the whole past at every step, attention stores the keys and values of every previous token in this cache, whose size per token is

KV bytes per token=2×nlayers×nkv heads×dhead×bytes per value\text{KV bytes per token} = 2 \times n_{\text{layers}} \times n_{\text{kv heads}} \times d_{\text{head}} \times \text{bytes per value}
联系我们 contact @ memedata.com