Hyper-connections and manifold-constrained hyper-connections (mHC) give the residual stream multiple paths. How should those paths mix?
Our rabbit token passes through dozens of layers. Attention adds context, feed-forward adds what it has learned, and both write into the same running vector.
Late layers read almost the same thing
With pre-norm, the stream keeps every update and keeps growing. Each new update is about the same size, so it moves a larger and larger vector by less and less.
Each point compares one layer's input with the next layer's. Late in the stack, a layer's update barely changes what the next one reads. Illustrative: a toy stack where every update is a random vector of the same size.
By the last layers, each one reads almost what the previous one read. Their extra depth adds little. The Hyper-Connections authors saw the same pattern in a real 1-billion-parameter pre-norm model.
Post-norm avoids this by rescaling the stream after every layer, but then the training signal fades on its way back through all those norms. One stream forces a trade between the two.
Just use a bigger embedding size?
We could give each token more numbers: a larger embedding size. That leaves room for updates to stay distinct, but it is simply a bigger model. Every layer’s matrices have a row and a column for each of those numbers.
A bigger embedding size makes every layer's matrices bigger. Carrying several streams keeps the layer as it was.
Three times the embedding size means nine times the weights, and nine times the work, in every layer. Can we give the stream more room without paying for a bigger model? Carry three streams between layers, but let each layer still read and write one vector of the usual size.
Left: the usual stack, with one residual stream. Right: the same layers carrying three. Each layer still reads one vector and writes one update.
We start with copies of the token vector. As layers add different amounts to each copy, the streams can grow apart.
What should the layer read?
Attention or feed-forward still needs one vector per token. Which stream should we give it?
We can let the model learn a weight for each stream, then add the weighted vectors together.
Choose the layer input
Interactive
Choose one stream, then try combining them. Either way, the result is a single layer input of the usual size.
Where should the layer output go?
The layer calculates one layer output. We can add it to every stream, but give each its own write weight.
Each stream gets its own weighted share of the layer output.
One stream receives a small change; another receives more. We run the layer once and use its output in several places.
Let the streams share information
So far, each stream has kept its own path. We could also let them exchange information.
A small learned matrix does that. Each row combines the incoming streams into one outgoing stream.
Let the streams exchange information
Interactive
These learned reads, writes and connections between streams are called hyper-connections. Their weights can also change with the token being processed.
Here is how the pieces fit together:
Read from the streams, process one vector, then add the weighted layer output to the mixed streams.
The layer still processes one input and produces one output. We carry more streams between layers, so storing and mixing them adds some work.
Back to the late layers
At the start, every late layer read almost the same vector, because one growing stream absorbed every update.
Now a layer can read its own combination of the streams, and write its output mostly into one of them. The next layer no longer has to read what this one just read. The Hyper-Connections authors measured this in the same 1-billion-parameter model: with hyper-connections, the inputs of neighbouring layers were much less alike.
The streams still carry every update forward, as the residual stream did, so the learning signal keeps its path back. Or does it?
Haven’t we seen this before?
The residual stream made deep networks trainable because it changed nothing. It passed the stream on with a factor of 1, so the learning signal could reach the first layer however deep the stack.
Mixing puts a learned matrix back on that path. Now the stream is multiplied at every layer, as in a plain stack, and the effect compounds. Rows that add up to just 1.15 add 15% at each layer.
Rows that add up to 1.15 grow the streams about 163 times in 40 layers. With every row and column adding up to 1, they never grow.
The learning signal travels back along the same path and meets the same matrices. Slightly too large, and it explodes; slightly too small, and it fades away. In giving the stream more freedom, we have brought back the problem the residual stream was there to solve.
Put the identity back
In the mixing example, the Keep separate option passes every stream through unchanged, just like the original residual stream. That is safe, but the streams share nothing. Can we share information and stay safe?
Manifold-constrained hyper-connections (mHC) allow only matrices whose weights are non-negative and whose rows and columns each add up to one. Such a matrix only moves values between streams: their total passes through unchanged, as on the original residual stream.
One number from each stream. Rows that add up to 1.15 grow the total by 15%; with mHC the values move between streams, but their total stays the same.
Multiply two of these matrices and the result follows the same rule, so it holds through any number of layers, forwards and backwards. That is the flat green line in the growth figure above.
The Mix streams example follows this rule, and the layer output can still add something new.
DeepSeek-V4 uses mHC to carry four streams through every layer.
With the identity restored, can we also scale the one skip path we already have? Next, residual scaling (coming soon).
Sources and assumptions
Hyper-Connections, Sections 2–3 and Appendix J: stream expansion, weighted reading, residual mixing, weighted writing and input-dependent coefficients. Streams start as copies; the final streams are summed before the output projection.
Hyper-Connections, Figure 3: cosine similarity between each layer’s input and earlier layers’ inputs in OLMo-1B. The pre-norm model shows high similarity between adjacent layers, which the authors call representation collapse; with hyper-connections it is much lower. The paper gives the result as a plot without numbers, so the first figure here uses a toy instead.
mHC, Section 4: doubly stochastic residual mixing, constrained read/write coefficients and efficient implementation. The constraint on the mixing matrix concerns the skip paths, not the full block including its layer output. Its abstract gives the motivation used here: unconstrained hyper-connections compromise “the identity mapping property intrinsic to the residual connection”, causing training instability. A product of such doubly stochastic matrices is doubly stochastic, and so is its transpose, which carries the learning signal back.
The first figure compares, in a toy 32-layer pre-norm stack with 64 numbers per token, each layer’s input with the next layer’s; every update is a random vector the size of the starting token. The weight comparison assumes a layer’s matrices have a row and a column for each number in the token vector. The growth figure repeats mixing alone, without layer outputs, on the article’s three streams. The total figure mixes one hand-picked number from each stream. The other diagrams use the same three streams. Read and mixing controls calculate each displayed coordinate. The writing diagram scales one fixed layer output. Norm and layer calculations are represented by their boxes. The size label shows the selected model’s token width.