← Deep dives

Deep dives · 2026-12-04 · Advanced · By bombong

Redesigning residual connections: DenseFormer, Hyper-Connections, DCA

In transformers, the residual connection was a pathway that stacked layer outputs by adding them in a fixed way. Recent research is redesigning this pathway with learned aggregation along the depth axis and with multiple parallel streams. This article summarizes what depth-axis aggregation (DenseFormer, DCA) and the Hyper-Connections family gain and what they trade off.

Contents
Key points
  • Along the sequence axis, attention mixes information based on content. The standard residual connection does not do this along the depth axis. It only stacks layer outputs through fixed addition.
  • Redesign approaches fall into three broad groups: aggregating previous layers with learned weights (DenseFormer and others), applying attention over previous layers (DCA, AttnRes and others), and widening the residual pathway into multiple streams (Hyper-Connections).
  • In Hyper-Connections, mixing streams without constraints makes training unstable. mHC therefore restricts the mixing matrix to a doubly stochastic matrix to preserve signal magnitude, and follow-up work addresses the problem that this constraint is too tight or too costly.
  • Recent work either addresses the bottleneck where adding streams yields diminishing gains by widening the read/write interface (GHC, TPHC), or removes components to cut training cost (SimpleHC).
  • In practice, memory access and parallelization costs must be weighed alongside gains in expressiveness. Even the same operation can have different real-world efficiency depending on how well it fits the hardware.

Why residual connections are being revisited

A residual connection is a structure in which each layer does not replace its input entirely but instead 'adds' its computed result to the input. Even if a layer learns nothing, the input passes unchanged to the next layer (identity mapping), so signals and gradients do not vanish even when layers are stacked deep. For this reason, residual connections were long regarded as little more than plumbing for training deep models.

The residual stream duality study paper agrees with the recent view that the residual pathway is not just optimization plumbing but part of how the model represents information, and it organizes this design space along two axes. A decoder develops information in two directions: one is token position (the sequence axis), and the other is layer depth (the depth axis). Along the sequence axis, self-attention mixes information adaptively based on content. In contrast, the residual stream along the depth axis usually just adds layer outputs in a fixed way.

This asymmetry is the starting point for the redesign. A speaker recognition study paper also points out that the standard identity mapping limits information flow to a single path, constraining representational capacity. So what if the model also learned, along the depth axis, 'which layer's information to take and how much'? This is the question shared by the studies covered in this article.

Core idea: giving the depth axis the ability to choose

As an analogy, the standard residual connection is like continually appending each meeting's notes to a single notebook. The attendees of the next meeting receive only that one notebook. They cannot pick which earlier meetings mattered, and all the notes are mixed together with equal weight. The redesign approaches can be seen as three ways of changing this notebook.

The first is to blend notes from previous meetings in learned proportions and hand them over. The duality study paper notes that ELC-BERT and DenseFormer have already shown that learned aggregation along the depth axis can outperform uniform residual accumulation. The second is for attendees to pose a question and look up the earlier notes they need. The same study groups Vertical Attention, DeepCrossAttention (DCA), MUDDFormer and Attention Residuals (AttnRes) as examples that go further toward explicit attention-based routing over previous layers. The third is to expand the notebook into several notebooks and, at each meeting, have some content copied between them. This is Hyper-Connections (HC), which widens the residual pathway into several parallel streams and mixes between streams using a residual matrix paper.

An observation from the duality study paper ties this picture together. If you fix one token position and treat the layer index as the ordering variable, causal residual attention reads along the depth direction are the same operation as short sliding-window attention (ShortSWA) along the sequence axis. Only the axis differs. In other words, 'depth-axis attention' is less a new operation than familiar attention placed on a different axis.

Three approaches to residual redesign

Depth-axis weighted aggregationDenseFormer·ELC-BERT

  • Combines previous layer outputs in learned proportions
  • Can beat uniform accumulation

Depth-axis attentionDCA·AttnRes·MUDDFormer

  • Routes to previous layers via attention
  • Same operation as short-window attention

Multiple streamsHyper-Connections·mHC

  • Residual pathway split into multiple streams
  • Unstable if mixing is unconstrained

공통 All of them learn, along the depth axis, which layers' information to use and how much

Three ways to replace the fixed addition of the standard residual connection. Representative examples follow the duality study's summary.

How it works: Hyper-Connections and mHC

A single Hyper-Connections layer can be viewed roughly as three steps. First, from the residual state widened into N streams, it reads a single input as a weighted sum and feeds it into the sublayer (attention or FFN). The sublayer's output is then written back into each stream at a set proportion. Separately, a residual matrix mixes content between streams. The standard residual connection is the special case of this structure with one stream and no mixing.

The problem is mixing. The spectral-sphere constraint study paper and the TBP study paper explain that unconstrained mixing breaks the identity mapping property inherent to residual connections and makes training unstable. When the mixing matrices of successive layers are multiplied and accumulate, the signal can gradually grow or shrink.

Manifold-Constrained Hyper-Connections (mHC) restricts the mixing matrix to a doubly stochastic matrix (a matrix whose entries are all non-negative and whose rows and columns each sum to 1). Such a matrix only redistributes the streams' content and does not increase or decrease the total amount. The speaker recognition study paper enforces this constraint with Sinkhorn-Knopp iteration (a procedure that alternately normalizes rows and columns), and explains that it preserves signal strength and feature means, stabilizing gradients and reducing signal degradation. The study reported that replacing the residual connections of ECAPA-TDNN, ResNet-34, Res2Net and E-Res2Net with mHC consistently improved performance for all architectures on VoxCeleb1. It is an example of the same principle working outside language models.

Flow of one Hyper-Connections layerWidened residual state → Read; Read → Sublayer; Sublayer → Write; Widened residual state → Stream mixing; Stream mixing → Next-layer state; Write → Next-layer state(Add); Doubly stochastic constraint → Stream mixing(Constraint)Widened residualstateN streamsReadWeighted sum ofstreamsSublayerAttention / FFNWriteAt per-streamproportionsStream mixingResidual matrixNext-layer stateDoubly stochasticconstraintmHC·Sinkhorn-KnoppAddConstraint
Flow of one Hyper-Connections layer The top row is the path that reads from the streams, passes through the sublayer and writes back; the bottom row is the path that mixes streams with each other. mHC applies a doubly stochastic constraint to the mixing matrix.

How the field developed: refining mHC's constraint and widening the interface

The first line of post-mHC research concerns 'how to impose' the doubly stochastic constraint. The spectral-sphere constraint study paper identifies three limitations of this constraint: identity degeneration, where the learned matrix stays near its identity initialization and exchange between streams decreases; an expressiveness bottleneck, where the matrix's subdominant spectrum cannot be freely adjusted, so differences between streams cannot be selectively preserved or reduced; and inefficiency, where Sinkhorn-Knopp iteration is unstable or the cost of permutation-matrix-based parameterization grows factorially. The study avoids these problems with s²HC, which places the residual matrix on a spectral-norm sphere.

The TBP study paper solves the same problem by a different route. mHC-lite, which enforces the exact constraint through convex combinations of permutation matrices, pays factorial complexity, while KromHC, which reduces cost with Kronecker products, uses only part of the structure of the full set of doubly stochastic matrices (the Birkhoff polytope). TBP builds exact doubly stochastic matrices with (n-1)² degrees of freedom without iterative normalization, keeping full expressiveness, and reportedly showed competitive performance and better stability in language model pretraining. cmHC paper addresses 'how much to mix.' If the matrix stays near the vertices of the polytope, the streams flow almost independently (under-mixing); if it clusters near the center, the streams become indistinguishable (over-mixing). cmHC geometrically contracts the polytope inward to prevent under-mixing, and applies weaker contraction in shallow layers to prevent over-mixing.

The second line concerns the read/write interface. GHC paper sees a bottleneck in the fact that even when HC widens the streams, each branch still reads only a single stream mixture and writes one output vector to all streams, changing only the proportions. It therefore splits branches into groups by attention head or FFN channel, lets each group read a different stream mixture, and aggregates each group's output into the streams with learned weights. The study reported that, in dense and MoE models, it improved training efficiency by 35% over Pre-Norm and by 10% over Identity Hyper-Connections (IHC) with almost no added parameter or memory access overhead, and that it overcame the diminishing gains seen as streams are added.

Where the field is heading

Recent work moves in two broad directions: scalability and simplification. TPHC paper cites, as one reason mHC gains little beyond 4 streams, the fact that the sublayer writes a single output to all streams. As a fix, it ties the tensor parallelism (TP) shards of model parallelism to HC streams, sending a different stream mixture to each shard and writing the per-shard outputs back while keeping them separate. On an 8B model, it takes only 9% more training time than mHC with 4 streams, and increasing streams from 4 to 16 raised training time by 19%. When a 1.1B model was trained on 100 billion (100B) tokens, validation loss was 0.7–1.0% lower than mHC with the same number of streams, and average zero-shot accuracy across six commonsense reasoning benchmarks was 0.3–0.7 percentage points higher.

SimpleHC paper goes the other way, removing components. The study observes that HC is increasingly being adopted in frontier language models, but its components are poorly understood and its training overhead is not small. Its analysis found that 'learned read/write gates without mixing' and 'unconstrained mixing with fixed gates' each matched mHC's performance on their own. It also found that repeatedly accessing the widened residual state was itself a major overhead. It therefore removed residual mixing and changed the execution scheme to share memory access; at the largest scale, total training time was only 2.4% higher than with a plain residual connection. Scaling from 15B to 30B MoE models, it maintained performance comparable to mHC.

On the depth-axis attention side, Multi-Stream Attention Residuals (MSAR, paper) stands out. It views AttnRes as single-head softmax attention over the depth axis and widens it to multiple heads, like multi-head attention along the sequence axis. A distinctive feature is that it does not continuously store or pass around the multi-stream state, expanding it only when needed. At 18B and 28B MoE scale, it outperformed standard residual, mHC and AttnRes on all 12 downstream benchmarks, and in scaling law experiments its compute speedup to reach the same loss was 1.58x over standard residual (AttnRes 1.35x, mHC 1.30x).

Compute speedup at equal loss

MSAR
AttnRes
mHC
Compute speedup to reach the same loss relative to the standard residual connection, from the MSAR study's scaling law experiments.

Limitations and open issues: when to use it and what to watch for

The first issue is that the same operation can still have different system costs. The duality study paper stresses that even though depth-axis attention and sequence-axis ShortSWA are the same at the operation level, they are not symmetric at the system level. In large autoregressive models, a sequence-axis layout, which can reuse token-side sliding-window kernels, KV cache layouts and chunked execution, usually fits the hardware better. The overhead of 'repeated access to the widened state' that SimpleHC paper identified belongs to the same picture. Deciding on adoption from a paper's performance tables alone can lead to surprises in actual training throughput.

Second, what drives the performance is still being worked out. SimpleHC's analysis showed that either gating or mixing alone may be enough, and cmHC paper showed that both too little and too much mixing are problems. In other words, the simple intuition that 'more streams and more mixing is better' does not hold. As TPHC paper and GHC paper show, adding streams alone yields diminishing gains, and the read/write interface needs to widen along with them.

Third, this family does not address other weaknesses of residual connections. A gradient residual study paper shows that standard residual connections struggle to approximate rapidly changing high-frequency functions, and proposes residuals that use gradient information as a remedy. However, on typical image classification and segmentation it performed similarly to standard residuals, so it is safest to assume that the gains of any redesign depend on the nature of the task.

As practical decision criteria: if the goal is better loss per unit of compute in large-scale pretraining, the mHC family, which has many validation cases, or approaches like MSAR are worth looking at first. If you cannot afford to add load to the training infrastructure, start with a simple variant like SimpleHC that quantifies its overhead. Common mistakes are adding stream mixing without constraints and making training unstable, increasing the number of streams while leaving the interface unchanged, and not measuring tensor parallelism and memory access costs.

Checklist before adopting a residual redesign

Stability

  • Is stream mixing constrained (e.g., doubly stochastic)?
  • Have you checked that mixing is neither too little nor too much?

Scalability

  • Did you widen the read/write interface along with the number of streams?
  • Did you measure whether gains diminish as streams are added?

System cost

  • Did you measure the memory access overhead of the widened state?
  • Does it fit your tensor parallelism and KV cache setup?
  • Did you compare actual training throughput rather than paper numbers?
The issues discussed in the article, organized as items to check before adoption.

Further reading

To get the overall map first, start with the residual stream duality study paper. It lays out in one place where DenseFormer, DCA, AttnRes and HC sit from the two-axis perspective, and why operations and hardware efficiency are separate matters.

Next, to understand the motivation behind the mHC family, read the spectral-sphere constraint study paper followed by cmHC paper. The former covers why the doubly stochastic constraint can be too tight, and the latter covers why the right amount of mixing matters. To compare parameterization methods, the TBP study paper summarizes its differences from mHC-lite and KromHC.

If you are looking at application to real large-scale training, read SimpleHC paper, TPHC paper and MSAR paper together. All three report gains directly against training time or compute, so cost and performance can be compared side by side. If you are curious about applications outside language models, the study that applied mHC to speaker recognition paper is short and easy to read.

Related terms

Transformer Attention DeepCrossAttention MoE Model parallelism Pre-training Scaling laws Backpropagation

References

Foundational papers

Recent research

Written by AI from the listed references and reviewed. Please check the original sources for details.