Paper commentary
MUDDFormer: Breaking Residual Bottlenecks in Transformers via Multiway Dynamic Dense Connections
MUDD connections let each Transformer input stream read earlier layers in its own way
- Problem Residual connections cap what extra depth adds in Transformers, because one shared residual stream becomes overloaded. Earlier dense designs use static weights shared across positions and streams, which limits how much they can express.
- Method MUDDFormer uses MUDD connections that compute mixing weights from the current hidden state at each position. It splits each block's input into query, key, value and residual streams, and each stream gets its own dynamic dense connections.
- Results MUDDPythia-2.8B matches Pythia-6.9B in Pile perplexity, scoring 6.29 for both. It adds only 0.23% parameters and 0.4% computation over Pythia-2.8B.

Figure 2 . Architecture of Multiway Dynamic Dense Connections.
Original paper · CC BY 4.0 · Da Xiao, Qingye Meng, Shengping Li, Xingyuan Yuan · MUDDFormer: Breaking Residual Bottlenecks in Transformers via Multiway Dynamic Dense Connections · Original paper figure · Extracted the figure area from page 3 of the original PDF.Where residual streams run out
Residual connections let deep Transformers train, but they also cap what extra depth can add. Adding layers should help in principle, and experiments on Transformers support that only up to a point. Beyond that point the returns shrink, and Pre-Norm, the usual way to keep training stable, can make hidden states in deep layers look alike. For popular open-weight LLMs, a large fraction of layers can be removed with only minimal loss in performance.
A second limit comes from how Transformers carry out in-context tasks, through circuits of attention heads and MLPs spread across layers. Each layer writes to and reads from subspaces of the residual stream, so that one stream serves as the shared communication channel. That shared stream can become overloaded, which makes the distant-layer circuits needed for hard tasks difficult to form.
Dense connections, where each layer reads the outputs of all earlier layers, were proposed as a remedy.
Earlier dense designs show the idea has value: DenseNet for CNNs, Deep Transformers for encoder-decoder models, and DenseFormer for decoder-only models. Their connection weights are static, either fixed or learned, and shared across sequence positions and across a block's input streams. The authors argue that this rigidity severely limits how much these models can express in Transformers.
Making dense weights dynamic
The key idea is to keep dense connections but compute their weights from the current hidden state instead of fixing them. The weights then differ across positions and across the four input streams of each block, so each stream can read earlier layers in its own way. The authors expected this to help because the query, key, value and residual inputs of a block play different roles and should not all receive the same mix.
Start from the static case: layer i takes a weighted sum of the embedding and every earlier block output, using one trainable scalar per earlier layer. Dynamic dense connections turn each scalar into a vector with one entry per sequence position, so the mix varies along the sequence. The mixing matrix \(A_i\) has shape \(T\times(i+1)\), and the layer input is \(X^i=\sum_{j=0}^{i}A_{ij}\odot X_j\), where each column of \(A_i\) scales the matching earlier output at each position.
A small MLP produces \(A_i\) from the block output \(X_i\), applied position by position. It computes \(A_i(X_i)=\mathrm{GELU}(\mathrm{RMSNorm}(X_i)W_1)W_2 + a_i\), where RMSNorm stabilizes training and \(a_i\) is a learnable static prior. W1 has shape D by (i+1) and W2 has shape (i+1) by (i+1), so the generator grows with depth. Viewed as attention, the current state acts as a query over earlier layers, but the keys are fixed parameters, there is no softmax and no value projection.
Hyper-Connections also mixes states across layers with static and dynamic weights, but it has no explicit all-to-all dense connectivity. DenseFormer uses static learnable weights, so MUDD differs by making the weights depend on the hidden state at each position. The authors also note that none of these approaches decouples a block's four input streams.
Four streams and a re-allocated FFN
A standard Transformer block feeds one input into the query, key, value and residual slots of its multi-head attention. MUDDFormer splits that single input into four streams, X^Q, X^K, X^V and X^R, so each stream can receive its own dense connectivity. Each stream gets its own DA module, and the attention then runs on layer-normed query, key and value streams with the residual stream added at the end.
The block output then passes through the FFN with the usual residual layout, giving X'_A = MHA(LN(X^Q), LN(X^K), LN(X^V)) + X^R followed by FFN(LN(X'_A)) + X'_A.
The authors hypothesize that the four streams play divergent roles, so they benefit from differentiated dense connectivity. In code, the four DA modules share one computation: a generate_dw step produces the weights, and a DA step mixes the earlier layer outputs for each of the four streams. The full MUDDFormer combines static, dynamic and multiway dense connections, and its output is the residual stream of the last layer, X^R_L.
Because each DA module's hidden dimension grows with depth, the extra parameters and computation vary from layer to layer.
Upper layers can process more information than lower layers, so MUDDFormer re-allocates FFN width toward depth. The FFN hidden dimension grows linearly from 0.5 D_f at the bottom to 1.5 D_f at the top, where D_f is the original FFN hidden dimension. The total number of parameters stays unchanged, so this shifts capacity across layers rather than adding parameters.
At initialization, W1 and W2 start from N(0, 1/D) and 0, and each static weight a_ii starts at 1, so MUDDFormer behaves like a Transformer at the start. The authors found this starting point critical for good performance. For deep narrow models, the PrePostDANorm variant places RMSNorm before and after the DA module and adds a residual connection after the post-norm.
The authors used this variant for the DeepNarrow scaling runs and for the MUDDViT model.
Scaling against Transformer++ and dense baselines
The scaling study builds on Transformer++, the Llama-style baseline with rotary embeddings and a SwiGLU MLP, so every method is compared on the same modern base. The authors also include the original GPT-3 style Transformer as a reference curve, and the baseline details sit in Appendix D.2. Training uses context length 2048 and a token budget set to roughly match Chinchilla scaling laws.
DenseFormer and Hyper-Connections beat Transformer++, DDFormer beats them by making the dense weights dynamic, and MUDDFormer improves on DDFormer by making the connections multiway. The gain over Transformer++, written as ΔL_MUDD, stays stable as the model scales, while Transformer++'s own gain over Transformer, ΔL++, is smaller beyond 834M parameters.
The DeepNarrow models trade width for depth, which tests whether MUDD still helps when layers are added at the cost of width. The DeepNarrow configurations include 34 layers with width 1280 and 42 layers with width 1536. Transformer++ shows diminishing returns beyond 24 layers, with almost coincident scaling curves. MUDDFormer DeepNarrow keeps gaining up to 42 layers.
The authors read this as MUDD connections easing the depth bottleneck by enhancing cross-layer information flow.

Figure 4 . Depth scaling of MUDDFormer and Transformer++.
Original paper · CC BY 4.0Because MoE also uses dynamic weights, the authors asked whether MUDD adds anything on top of sparse experts. Compared with the same Transformer++-405M, MUDDFormer-405M achieves a loss reduction of about 50 percent of the MoE's gain, which is 4.4 times larger. MUDD gives a larger gain on the MoE model, with ΔLoss of -0.0641, than on the dense model, with ΔLoss of -0.0596.
Downstream accuracy against Pythia
The authors trained MUDDPythia-1.4B and MUDDPythia-2.8B on 300B tokens of Pile, keeping Pythia's architecture and training recipe apart from the MUDD connections. Evaluation covers Pile and FLAN perplexity, plus zero-shot and five-shot accuracy on LAMBADA, PIQA, WinoGrande, ARC, SciQ, LogiQA, BoolQ, HellaSwag and RACE. The benchmarks follow the Pythia suite, with BoolQ, HellaSwag and RACE added for commonsense reasoning and reading comprehension.
MUDDPythia-2.8B reaches 6.29 Pile perplexity, the same as Pythia-6.9B. Against Pythia-2.8B, MUDDPythia-2.8B raises the zero-shot average accuracy from 53.1 to 55.0. Pythia-6.9B averages 55.1 in zero-shot, and the authors put its compute at 2.46× that of MUDDPythia-2.8B. MUDDFM-2.8B scores 56.9 zero-shot, compared to 56.5 for Pythia-12B.

Table 3 . Zero-shot and five-shot downstream evaluations results.
Original paper · CC BY 4.0In five-shot evaluation, MUDDPythia-2.8B averages 57.0, on par with the 57.2 of Pythia-12B. The authors put Pythia-12B at 4.29× the compute of MUDDPythia-2.8B. The five-shot gain is 2.9 points over Pythia-2.8B, larger than the 1.9-point zero-shot gain. The authors tie this stronger in-context result to the multiway streams on the query, key and value.
On the FLAN subset, MUDDPythia-2.8B reaches a perplexity of 7.50, compared to 7.85 for Pythia-6.9B. The authors also note that the gains are larger at 2.8B than at 1.4B in both zero-shot and five-shot settings.
The next section asks what changes inside the trained model, starting with representation collapse. Pythia shows progressive collapse with similarity above 0.97 in later layers, while MUDDPythia keeps inputs more distinct.
What changes inside the trained model
To test whether the gains come from less representation collapse, the authors compared Pythia-2.8B with MUDDPythia-2.8B on 1024 Pile validation sequences of length 2048. Cosine similarity is measured between the inputs of adjacent layers, and Pythia's later-layer inputs reach above 0.97 similarity. MUDDPythia keeps its layer inputs more distinct, most clearly in the value stream.
The authors credit input stream decoupling together with stream-specific aggregation, which lets the DA modules combine distinct value streams for each layer at each position.
The authors illustrate this with V-composition circuits, which show how a value output moves information between positions. In Transformer, the VO stream is coupled with a residual stream that other information flows into and pollutes. In MUDDFormer, the VO stream runs straight through and stays decoupled from the residual stream. The authors say MUDD has a similar effect on Q/K-composition circuits, but Figure 7 only shows the V-composition case.

Figure 7 . Illustrative V-composition circuits in Transformer vs. in MUDDFormer. Colored circles are MHA’s inputs of the query (yellow), key (red), value (green) and residual (black) streams and output (blue). LayerNorms and MLPs are omitted.
Original paper · CC BY 4.0Transformer models often show null attention, where heads default to attention sinks on the first tokens when no relevant token is found. The authors call a head active at a position when its maximum attention weight does not fall on the first two positions or on the tokens <bos>, '.' and newline. They average the activation ratio over all heads of each layer and over all sequence positions, and plot it in Figure 8.
In Pythia, most heads stay inactive beyond the first few layers, which limits their contribution to the model. The authors credit this revival of attention heads to the multiway dense connections on the Q, K and V streams of the MHA modules, which they link to better in-context learning. Figure 8 and the head-level patterns in Appendix G support the claim, but the paper's attribution to the Q, K and V streams is not isolated by a separate test here.
What the extra connections cost
MUDD adds its cost in two places, the W1 and W2 weights of each DA module and the FLOPs spent generating weights and aggregating layers. The extra parameters count W1 and W2 of the DA modules against the whole model, and the extra FLOPs cover weight generation and cross-layer aggregation. For MUDDPythia-2.8B the authors report 0.23% extra parameters and 0.4% extra computation.
Both ratios grow with the rectified depth-to-width ratio η = (L+3)/D, so deep and narrow models pay more. The FLOP ratio falls as the sequence length grows relative to width, ρ = T/D, because the aggregation cost is amortised over longer sequences.
Measured overhead is larger than these analytical ratios, so the authors timed training and inference directly. Training throughput is 89.8% of Transformer++ at 1.3B, 84.0% at 2.8B and 95.6% at 6.9B. Inference speed is 88.1%, 90.0% and 94.0% of Transformer++ at the same sizes. The authors say the overheads come mainly from many small operations and extra I/O introduced by the DA modules.
These timings use untrained Transformer++ (Llama) models, trained on TPU v5p-128 pods and run on an A100 80G, so they are separate from the trained Pythia runs.

Table 4 . Training throughput and inference speed comparison be- tween Transformer++ and MUDDFormer.
Original paper · CC BY 4.0The authors measured throughput on untrained models, with a context length of 2048 and a batch size of 2M tokens. They didn't write custom Pallas or Triton kernels, and they used torch.compile to accelerate both models. The authors believe kernel fusion could speed up the model further, and they leave that for future work.
Which streams matter in ablations
The ablations start from Transformer++ at 11.68 perplexity and add the four components one at a time. Static dense connections bring perplexity down to 11.44, and dynamic dense connections lower it further to 11.09. Multiway static dense connections reach 11.27, and multiway dynamic dense connections reach 10.83. Parameter re-allocation brings the full MUDDFormer to 10.77, but on Transformer++ it raises perplexity to 11.93.

Table 5 . Ablations of MUDDFormer’s components.
Original paper · CC BY 4.0To isolate the multiway part, the authors swap one stream's dense connection for a plain residual connection at a time. Removing the query stream's dense connection gives 10.89, and removing the key stream's gives 10.90. Removing the value stream's gives 11.05, and removing the residual stream's gives 11.14, the highest of the four. The text says the value stream benefits most, yet the residual row of Table 5 is the worst.
Each removal leaves perplexity above the full model's 10.77.
Dense connectivity is the costly part, so the authors approximate it with sparser patterns. MUDDFormer-k×p aggregates every k-th block and inserts DA modules after every p blocks. MUDDFormer-SWn lets each DA module read only the previous n blocks plus the embeddings. Moving from MUDDFormer-1×1 to 2×2 lifts relative training speed from 89.8% to 97.8%.
Relative inference speed rises from 88.1% to 93.4% in the same move, for only a 0.18 increase in perplexity. The authors read the weaker SW8 trade-off as a sign that long-range cross-layer links matter.
MUDD on ImageNet-1k with ViT
The authors also apply MUDD connections to ViT-S/16, an encoder-only Transformer, for image classification on ImageNet-1k. They build on the Big Vision codebase and train with AdamW, a learning rate of 0.003, and a batch size of 4096. Training uses 10000 warmup steps followed by cosine decay to 0, with RandAugment at level 10, Mixup of 0.2 and dropout rate of 0.1.
ViT-S/16 serves as the baseline, and MUDDViT-S/16 adds MUDD connections to that same model. They also compare against ViT-M/16, which is 1.72× larger, with its architecture listed in Table 8.

Table 9 . ViT for ImageNet-1k classification results.
Original paper · CC BY 4.0Table 9 reports validation loss and top-1 accuracy at epochs 90 and 300. The validation loss of MUDDViT-S/16 is 0.871, compared with 0.993 for ViT-S/16. At epoch 300, MUDDViT-S/16 reaches 78.1 against 76.0 for ViT-S/16, so it leads by 2%.
The gain from MUDD shrinks as training continues, and the authors attribute this to repeated passes over the same dataset. They suggest those repeated passes diminish the extra expressive capacity that MUDD connections add. They didn't test other datasets or longer schedules, so the trend beyond epoch 300 remains open.
The attention and weight visualizations in Appendix G cover MUDDPythia-2.8B, not the ViT model.
Limitations of the evidence and the cost of MUDD
The efficiency numbers come from a different setup than the downstream results, so they don't line up one to one. The authors trained the downstream models with Pythia architecture, but they measured speed on untrained Transformer++ models. Those untrained models are 1.3B, 2.8B and 6.9B versions of Pythia 1.4B, 2.8B and 6.9B. Training throughput of MUDDFormer is below Transformer++ at all three sizes, from 1147 to 1030 K tokens/s at 1.3B.
The lowest relative training throughput is 84.0% at the 2.8B size, where MUDDFormer reaches 575 K tokens/s against 684. The authors say these overheads are larger than the theoretical estimates in Table 1 and are not negligible.
The overheads come mostly from many small operations and extra I/O introduced by the DA modules. The timings use no Pallas or Triton custom kernels, and the authors believe kernel fusion could speed things up. They leave kernel fusion to future work. The paper reports one relative training speed per model, and it doesn't measure how this changes at larger scales.
Sparse variants trade quality for speed, and fully dense connectivity gives the best perplexity. The authors leave combining MUDD with within-layer optimizations such as efficient or linear attention for future work.
On the vision side, the evidence is one comparison, ViT-S/16 against MUDDViT-S/16 on ImageNet-1k. The authors think repeated passes over the same dataset reduce the extra capacity MUDD adds. The vision results therefore don't show whether the gain holds on other datasets or longer schedules.
Paper info
- Authors
- Da Xiao, Qingye Meng, Shengping Li, Xingyuan Yuan
- Venue
- arXiv · Preprint
- First published
- 2025-2-13
- Added
- 2026-10-29
- Updated
- 2025-5-28
- Version
- v2
- arXiv
- 2502.12170
- Category
- cs.LG · cs.AI · cs.CL
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
We propose MUltiway Dynamic Dense (MUDD) connections, a simple yet effective method to address the limitations of residual connections and enhance cross-layer information flow in Transformers. Unlike existing dense connection approaches with static and shared connection weights, MUDD generates connection weights dynamically depending on hidden states at each sequence position and for each decoupled input stream (the query, key, value or residual) of a Transformer block. MUDD connections can be seamlessly integrated into any Transformer architecture to create MUDDFormer. Extensive experiments show that MUDDFormer significantly outperforms Transformers across various model architectures and scales in language modeling, achieving the performance of Transformers trained with 1.8X-2.4X compute. Notably, MUDDPythia-2.8B matches Pythia-6.9B in pretraining ppl and downstream tasks and even rivals Pythia-12B in five-shot settings, while adding only 0.23% parameters and 0.4% computation. Code in JAX and PyTorch and pre-trained models are available at https://github.com/Caiyun-AI/MUDDFormer .
Quote from the paper
Da Xiao, Qingye Meng, Shengping Li, Xingyuan Yuan (2025). MUDDFormer: Breaking Residual Bottlenecks in Transformers via Multiway Dynamic Dense Connections. arXiv:2502.12170v2. https://arxiv.org/abs/2502.12170v2
BibTeX
@misc{xiao2025muddformer,
title = {{MUDDFormer: Breaking Residual Bottlenecks in Transformers via Multiway Dynamic Dense Connections}},
author = {Da Xiao and Qingye Meng and Shengping Li and Xingyuan Yuan},
year = {2025},
eprint = {2502.12170},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2502.12170v2}
}