Manuscript Offprint

arXiv:2611.02436

M3Former: Fine-Grained Cross-Layer Mixing for Transformers

Jiasong Han, Yunkai Chai, Tong Zhu, Hengyu Zhang, Wei Fang, Jintao Wang, Guoqi Li, Yu Cheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Residual connections give each Transformer block access to all earlier layers only through one fixed sum, broadcast to all of the block's inputs. This broadcast bottleneck imposes three constraints: the query, key, value and residual inputs of a block, which we call its roles, read the same vector; all hidden dimensions within a role share one set of weights over earlier layers; and every earlier layer has the same fixed weight for every token. We propose the Multi-Role Multi-Group Mixing Residual (M3), which removes all three: every role, and every group of hidden dimensions within a role, reads its own token-dependent mixture of all earlier layers. M3 starts as an exact residual connection and adds as little as 1.4% parameters and 1.8% FLOPs. From 100M to 1.4B parameters, M3Former outperforms the Transformer and coarse-grained cross-layer connections at every size, matching a Transformer 1.19−1.34×1.19-1.34\times the size of the one it modifies, trained with 1.4−1.8×1.4-1.8\times the compute. Relaxing only some of the constraints recovers only part of this gain. M3Former also improves sparse mixture-of-experts models of up to 4.6B parameters and trains more stably in deeper networks. Code: github.com/Kingchet10/m3former.

1 Introduction

Residual connections (He et al., 2016) allow Transformers (Vaswani et al., 2017) to be trained at great depth. Each block adds its output to a running sum, and the next block reads this sum as its input. In a pre-norm Transformer, the input of a block is thus the token embedding plus the updates of all earlier blocks. This running sum, often called the residual stream, is the only path through which a block can use what earlier layers have computed (Elhage et al., 2021). Although language models have grown to billions of parameters (Brown et al., 2020; Kaplan et al., 2020; Hoffmann et al., 2022), nearly all of them still connect their blocks in this way.

Every block reads only this sum and broadcasts it to all of its inputs, although the readers of the stream need different information. The broadcast constrains a block in three ways (Figure 2a). (1) Roles: queries and keys decide where to attend, values decide what to move, and the residual path carries the state that the block updates (Vaswani et al., 2017; Elhage et al., 2021), yet all four read the same vector. (2) Groups: different subspaces of the stream carry different features (Elhage et al., 2021), and heads and layers specialize in different functions (Voita et al., 2019; Clark et al., 2019b; Tenney et al., 2019; Jawahar et al., 2019), yet all hidden dimensions of a role share one set of weights over earlier layers. (3) Layer weights: every earlier layer enters the sum with the same fixed weight for every token, so a block cannot emphasize the layers it needs; in pre-norm models the growing sum dilutes each layer (Kimi Team, 2026), and many deep layers can be removed with little loss (Gromov et al., 2024). We call these constraints the broadcast bottleneck.

Cross-layer connections relax these constraints one at a time, and each relaxation has improved language modeling. Most relax (3), with static (Wang et al., 2019; Pagliardini et al., 2024) or token-dependent weights over earlier layers (Zhu et al., 2025a; Xie et al., 2025; Kimi Team, 2026); some also relax (1) by forming the query, key and value from separate mixtures (Heddes et al., 2025; Xiao et al., 2025), or (2) by splitting the hidden state into fractions, heads or streams (Zhu et al., 2025b; Luo et al., 2026; Qin et al., 2026). None

Figure

Figure 1: Validation loss at 20 training tokens per parameter (active parameters for mixture-of-experts models). In the bars: losses; red: change of M3Former relative to the Transformer; hatched: diverged run; white slash: bar cut off at the top. Each panel spans 0.12 in loss, the last 0.06.

relaxes all three (Table 1). Yet every group of every role needs different information from different earlier layers, and this need changes from token to token; keeping any one constraint still forces some of them to share a mixture, so removing the bottleneck requires relaxing all three together.

In this work, we propose the Multi-Role Multi-Group Mixing Residual (M3), which relaxes all three constraints jointly: every role of a block, and every group of hidden dimensions within a role, combines all earlier layers with its own weights, generated from the current token (Figure 2). Because it starts as an exact residual connection, M3 can replace the residual connections of a Transformer without other changes; we call the result M3Former.

We pre-train M3Former, the Transformer and coarse-grained cross-layer connections from 100M to 1.4B parameters under one recipe, together with mixture-of-experts models of up to 4.6B parameters, and make three contributions:

  • Problem. We identify the broadcast bottleneck, three constraints that the residual connection places on how a block reads earlier layers, and show that each of them limits the Transformer: relaxing only one or two recovers only part of the gain (§5.1).

  • Method. We propose M3, in which every role–group pair of a block reads its own token-dependent mixture of all earlier layers. One small generator produces all 4G mixtures, and a fused kernel computes them in a single pass over the history. The resulting M3Former starts exactly as the standard Transformer and adds as little as

1.4% parameters and 1.8% FLOPs.

  • Evidence at scale. At 20 tokens per parameter, M3Former matches a Transformer 1.19–1.34× the size of the one it modifies (Figure 3) and outperforms attention residuals from 100M to 1.4B and MUDDFormer from 100M to 700M (Figure 1). It also improves mixture-of-experts models of up to 4.6B parameters, and it trains to completion at 1.4B, where MUDDFormer diverges under the same recipe, and stays ahead when both use PrePostNorm.

References (22)