Residual Connections · September 2024
Hyper-Connections
intermediate
Replace the single residual stream with a small bank of parallel streams plus learned read/write matrices, letting different sublayers route information through different channels.
§ 1 · Premise
The single residual stream is a contested communication channel
Every transformer block reads from and writes to the same residual stream . Attention and FFN sublayers across all layers compete for the same coordinates; information laid down by layer 5 has to coexist with information written by layer 50 in the same vector space.
Two interpretability findings sharpen the bottleneck. First, the superposition phenomenon documented by Elhage et al. 2022: trained networks store many more features than in approximately orthogonal subspaces, relying on activation sparsity to prevent interference (Anthropic “Toy Models of Superposition”, §2). Second, the “gradient-vanishing-and-representation-collapse trade-off” identified by Zhu et al. themselves (Zhu et al. 2024, §2): Pre-Norm stacks have a favorable gradient but suffer representation collapse at depth (late-layer activations become near-identical, a phenomenon also flagged for the “wide” residual stream in the BERT literature), while Post-Norm has richer per-layer representations but degrading gradient flow.
The single-stream design forces every layer onto the same trade-off curve. Hyper-Connections ask: what if there were parallel residual streams, with each sublayer learning to read from and write to particular linear combinations of those streams?
A network with streams can — at the limit — decouple gradient flow from representation storage: one stream can serve as a “fast” identity-dominated channel where gradients flow nearly unobstructed, while another can serve as a “slow” sublayer-dominated channel that accumulates richer per-layer transformations. The trade-off becomes a design space the network can navigate via learned mixing.
§ 2 · Derivation
streams, a depth-rate matrix, and a per-layer read/write decomposition
Maintain a stack of parallel residual streams at every layer . Each stream is a -vector that, at , would be the standard residual stream. The Hyper-Connection block for sublayer is parameterized by learned coefficient vectors and a depth-rate matrix (Zhu et al. 2024, §3.1, Equations 5–7).
Read step. Collapse the streams into a single -vector that the sublayer can compute on:
The read coefficient is a length- vector that mixes the streams. With , the sublayer sees stream 0 only; with , it sees the average; in general, the network learns its own per-layer mix.
Sublayer compute. Run the standard sublayer on the read vector:
is unchanged — attention, FFN, or any other sublayer — operating on the read vector.
Write step. Update the stream stack. This is where the construction departs from any trivially flattened residual:
The first term is a depth-rate-matrix update on the stream stack — each output stream is a learned linear combination of all input streams. The second term writes the sublayer output to the streams in a learned mix . Together, the two terms generalize the standard residual update.
Recovery of the standard residual at . Set . Then , , and — the standard residual block (Zhu et al. 2024, §3.2). The construction is a strict generalization: every standard transformer is a Hyper-Connection transformer at .
Initialization for stability. Zhu et al. (§3.3) initialize — each stream is initially carried forward unmixed — and to a small uniform distribution that spreads sublayer writes roughly evenly across streams. The read is initialized so layer reads predominantly from one stream, with the assignment cycling through streams across consecutive layers. This makes the network start close to independent residual stacks running in parallel, with the network learning mixing over time. The initialization is what keeps gradient norm controlled at init despite the expanded state space.
Static variant: are fixed parameters. In Static Hyper-Connections (SHC), the read/write coefficient vectors and the rate matrix are learnable but per-layer constants — the same routing applies to every token at layer . The Dynamic variant (dynamic-hc entry) makes these coefficients per-token; this entry focuses on SHC.
Parameter and memory cost. Per layer, SHC adds scalars (), against in the attention and FFN. For and , that is scalars vs weights — six orders of magnitude smaller. Activation memory, however, is × the residual stream’s footprint: storing instead of . For , that is a 4× overhead on the activation checkpoint cost during training — non-negligible at frontier scale.
Gradient flow. The gradient of with respect to unfolds as a product of the rate matrices, plus mixed terms from the write contributions:
With at initialization, the leading term is the identity matrix — the same gradient-friendly property the standard residual relies on, lifted to the -stream state. The network learns to deviate from only as the loss demands.
§ 3 · Reference implementation
Static Hyper-Connection block, sketch
def shc_block(H, sublayer, a_r, a_w, B):
# H: (B, T, n, d) — stack of n parallel residual streams
# a_r, a_w: (n,) — per-layer read and write coefficients
# B: (n, n) — depth-rate matrix (init to identity)
r = (a_r[None, None, :, None] * H).sum(dim=-2) # (B, T, d) read
u = sublayer(r) # (B, T, d) sublayer compute
H = torch.einsum("ij,btjd->btid", B, H) # (B, T, n, d) rate-mix update
H = H + a_w[None, None, :, None] * u[..., None, :] # broadcast-write across streams
return H
The construction wraps a standard sublayer (sublayer) — attention or FFN — without modifying
its internals. The new state object is the -tall stream stack rather than the
residual vector.
§ 4 · Empirical evidence
What the paper reports and what surrounds it
Headline language-modeling results (Zhu et al. 2024, §4.2, Table 1): on a 1.3B-parameter dense LM trained on 100B+ tokens, SHC with reduces validation perplexity by 0.6 over the matched Pre-Norm baseline at equal parameter count. The improvement grows with : gives 0.3, gives 0.6, gives 0.7 (with diminishing returns past ). DHC (dynamic) adds another 0.2 over SHC at .
Depth-stability ablation (§4.3, Figure 4): a 96-layer Pre-Norm baseline diverges twice in five seeds during training; the matched SHC- run trains stably in all five seeds and reaches lower final loss. The paper attributes this to the depth-rate matrix’s ability to “siphon” perturbations into a particular stream rather than letting them propagate through the single residual everywhere.
MoE scaling (§4.4, Table 3): on a 7B-active / 71B-total MoE, SHC retains the same +0.5 perplexity improvement over Pre-Norm at matched compute. The benefit is not specific to dense architectures.
Vision (§4.5): the paper also trains ViT and DiT models with SHC and reports consistent improvements over Pre-Norm baselines on ImageNet classification and class-conditional image generation. The cross-modality consistency strengthens the claim that the mechanism is general.
Independent thread: representation collapse and feature reuse. The Hyper-Connection paper’s diagnosis — that single-stream Pre-Norm suffers from representation collapse at depth — has parallel support in earlier work. Liu et al. 2024, “DenseFormer”, report that dense connections between residual streams across layers improve depth-stability and final loss in a way mechanistically similar to the depth-rate matrix construction (§3, arXiv 2402.02622). Highway Networks (Srivastava et al. 2015, §2) anticipate the same concept at depth-1 with gated convex combinations on a single stream; Hyper-Connections is the generalization to a stream-stack with learned linear mixing.
Production status. No publicly documented production release as of May 2026 uses Hyper- Connections. Per the closed-model policy, no claim is made about whether labs that publish limited architecture details have tested the construction internally. The parameter overhead is genuinely small and the implementation lift is modest (the depth-rate matrix is the new machinery, and it is 16 scalars at ); the activation-memory overhead during training ( at ) is the practical obstacle at frontier scale.
No frontier-scale reproduction. The Zhu et al. experiments cap at 7B-active MoE. Independent replication at 70B+ has not appeared in any open release. The strongest available evidence is the paper’s own scaling sweep plus the cross-modality consistency on vision.
For the dynamic (per-token) variant of the construction, see Dynamic Hyper-Connections.
Lineage
- Predecessors
- The Residual StreamResidual
- Successors
- Dynamic Hyper-ConnectionsDHC / mHC
Cite
BibTeX entry for the original paper
@article{arxiv2409_19606,
title = {Hyper-Connections},
author = {Defa Zhu and others (ByteDance Doubao)},
year = {2024},
eprint = {2409.19606},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2409.19606}
} Or cite the paper directly: arXiv:2409.19606.
Export
BibTeX
@article{arxiv_2409_19606,
title = {Hyper-Connections},
author = {Defa Zhu et al. (ByteDance Doubao)},
year = {2024},
eprint = {2409.19606},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2409.19606}
} CSL JSON
{
"id": "arxiv_2409_19606",
"type": "article-journal",
"title": "Hyper-Connections",
"author": [
{
"literal": "Defa Zhu et al. (ByteDance Doubao)"
}
],
"issued": {
"date-parts": [
[
2024
]
]
},
"URL": "https://arxiv.org/abs/2409.19606",
"number": "2409.19606",
"source": "arXiv"
} RIS
TY - JOUR
TI - Hyper-Connections
AU - Defa Zhu et al. (ByteDance Doubao)
PY - 2024
JO - arXiv
AN - arXiv:2409.19606
UR - https://arxiv.org/abs/2409.19606
ER -