多分支 Transformer
研究论文 · 2026/11/18
本文提出多分支Transformer(MBT),通过并行组合完整Transformer块来扩展语言模型。MBT在共享初始层后并行执行独立参数化的分支,再经共享最终层融合输出。在0.8B至2.1B参数的预训练实验中,双分支宽浅MBT在匹配参数和训练计算预算下优于顺序Transformer,平衡MBT进一步提升且随分支数增加保持质量。为提升长上下文推理效率,作者引入Joint-KV构建共享KV缓存,最终方案结合平衡MBT与Joint-KV,在单H200 GPU上减少34%的KV缓存存储并提升51.4%的解码吞吐量,缩放曲线表明标准Transformer需多1.26倍训练计算才能达到相同验证损失。
该研究提出了一种新的模型扩展维度——分支,在匹配计算预算下提升建模质量,并通过Joint-KV显著优化长上下文推理效率,为语言模型 scaling 提供了实用新路径。
Transformer language models are commonly scaled by making their blocks wider or stacking them deeper. In this work, we explore a complementary path: branching, the parallel composition of full Transformer blocks. We introduce the Multi-Branch Transformer (MBT), which processes the input through shared initial layers, executes independently parameterized branches of sequential blocks in parallel, and fuses their outputs before shared final layers. At comparable training compute, we study three MBT variants: Wide-Shallow preserves block width, Narrow-Deep preserves sequential depth, and Balanced interpolates between them. In controlled pretraining experiments at four mixture-of-experts scales (0.8B to 2.1B total parameters), 2-branch Wide-Shallow MBTs consistently outperform sequential Transformers under matched parameter and training-compute budgets. Balanced MBTs improve further and retain comparable quality as the number of branches increases. To improve inference efficiency at long contexts, we introduce Joint-KV, which constructs a shared KV cache from branch representations at each depth. Our final recipe combines Balanced MBTs with Joint-KV, supported by an inference engine that exploits branch grouping and shared-cache reuse. Fitted scaling curves indicate that standard Transformers require up to 1.26x as much training body compute to match our final models' validation loss. These models reduce full-model KV-cache storage by up to 34% and deliver up to 51.4% higher decoding throughput on a single H200 GPU. Ablation studies show that branching yields gains beyond changes in width and depth, enables an effective KV-sharing strategy (Joint-KV), remains robust across fusion functions, and performs best in the middle layers. These findings show that branching offers a practical path for scaling language models toward both better modeling quality and faster inference.