Skip to content

mHC: Manifold-Constrained Hyper-Connections

mHC is DeepSeek’s reworking of Hyper-Connections (HC), an architectural primitive that widens the residual stream into multiple parallel streams with learnable mixing matrices. Vanilla HC trains unstably at scale because the per-layer mixing matrices are unconstrained, so the composite mapping across depth violates the identity-mapping property of standard residual connections and produces signal/gradient explosions (Amax gain magnitudes up to ~3000 observed empirically). mHC constrains the residual mixing matrix to the Birkhoff polytope (doubly stochastic matrices) via a differentiable Sinkhorn–Knopp projection inside the forward pass, which is non-expansive and closed under composition, recovering identity-mapping-like behavior across arbitrary depth. With aggressive TileLang kernel fusion, selective recomputation, and a DualPipe-aware communication schedule, the n=4 variant adds only 6.7% training overhead while beating both the baseline and HC on downstream benchmarks at 3B/9B/27B and on a 1T-token run. The result reads as DeepSeek arguing that residual-stream width should become a first-class scaling axis alongside FLOPs and tokens.

  • Unconstrained HC breaks the identity-mapping property across composed layers, producing forward/backward signal gains with peaks near 3000× and visible loss spikes around 12k steps in 27B training [§3.1, Fig. 2, Fig. 3].
  • Constraining the residual mixing matrix to the Birkhoff polytope of doubly stochastic matrices guarantees spectral norm ≤ 1 and closure under composition, so the composite mapping across any depth remains non-expansive [§4.1].
  • The projection is implemented as 20 Sinkhorn–Knopp normalization iterations on an exponentiated logit matrix, which converges to a doubly stochastic matrix and is differentiable end-to-end [§4.2, Eq. 9].
  • mHC additionally constrains the read-in and write-out mappings (H_pre, H_post) to be non-negative to prevent sign-cancellation across streams [§4.1].
  • With kernel fusion (TileLang), selective recomputation of mHC intermediates in the backward pass, and DualPipe schedule extensions, the n=4 mHC adds only 6.7% wall-clock overhead vs. the dense baseline at the 27B scale [§4.3, abstract].
  • At 27B parameters, mHC beats the baseline on all 8 downstream benchmarks and beats HC on most, with notable +2.1% on BBH and +2.3% on DROP vs. HC [Table 4, §5.2].
  • Relative loss improvement of mHC over baseline is maintained as compute scales from 3B → 9B → 27B with only marginal attenuation, and holds throughout a 1T-token run on the 3B model [§5.3, Fig. 6].
  • In the trained model, mHC’s composite gain magnitude stays bounded around ~1.6 vs. HC’s ~3000, a three-orders-of-magnitude reduction in propagation amplification [§5.4, Fig. 7].

mHC keeps the Hyper-Connections skeleton — at each layer the residual stream is expanded by a factor n into n parallel streams, with three learned linear maps modulating it: a read-in H_pre (n → 1) producing the layer input, a write-out H_post (1 → n) folding the layer output back, and a residual mixing matrix H_res (n × n) that updates the stream itself. The new piece is that H_res is required to live on the Birkhoff polytope (the manifold of n×n doubly stochastic matrices). Each forward pass computes the dynamic + static coefficients exactly as in HC, exponentiates them, and runs 20 iterations of Sinkhorn–Knopp normalization (alternating row and column rescaling to sum to 1). H_pre and H_post are likewise restricted to non-negative entries via a sigmoid/softmax-style parameterization.

Because doubly stochastic matrices have spectral norm bounded by 1 and are closed under multiplication, the depth-composed mapping H_res_{L} … H_res_{l+1} remains non-expansive at every depth — this is the identity-mapping property the paper sets out to recover. The systems work is heavy: a fused TileLang kernel implements the Sinkhorn iteration (and a custom backward kernel that recomputes intermediates on-chip rather than materializing them), residual-merge kernels are fused to cut memory I/O from O(n²d) reads to O(nd), the n-stream activations are discarded after the forward pass and recomputed in blocks aligned to pipeline stages, and the DualPipe schedule is extended to overlap the extra cross-stage communication with attention and FFN compute on a dedicated high-priority stream.

Headline numbers are from a 27B MoE backbone in the DeepSeek-V3 family, with n=4 expansion. On downstream benchmarks the baseline scores BBH 43.8 / DROP 47.0 / GSM8K 46.7 / MMLU 59.0; HC lifts those to 48.9 / 51.6 / 53.2 / 63.0; mHC further pushes to 51.0 / 53.9 / 53.8 / 63.4, and outperforms the baseline on every one of the 8 reported tasks [Table 4]. Final pretraining loss is 0.021 lower than baseline, and the loss-spike behavior plus the ~3000× Amax gain that HC produces at scale is fully suppressed (mHC stays around 1.6× even at maximum composite depth) [Fig. 5, Fig. 7]. Compute scaling (3B / 9B / 27B with proportional tokens) and token scaling (3B trained on 1T tokens) both preserve the mHC-over-baseline gap with only mild attenuation, and an in-house large-scale run is reported as confirming the same trend without disclosed numbers [§5.3, §5.4]. The systems overhead is the key practicality claim: 6.7% additional wall-clock at n=4 on the 27B configuration, which the authors argue is small enough that residual-stream width is now a usable scaling axis.

The framing matters as much as the technique: DeepSeek is arguing that the residual stream itself — a thing the field has treated as a fixed scalar add for ten years — is a tunable design dimension that scales independently of FLOPs and data, and they are betting on it for V4 (per the @teortaxestex thread that surfaced this). Mechanistically the Birkhoff/Sinkhorn move is a clean instance of “constrain the matrix family to one with the property you want, then make the projection differentiable and fused” — the same playbook as orthogonal-init / spectral-norm regularization, applied to a new place in the architecture, and the math (closure under composition implying preserved spectral bound at any depth) is unusually crisp for a deep-learning architecture paper. For Luma this is most directly relevant when thinking about depth/width tradeoffs in DiT-style backbones: if mHC really lets you trade a 6.7% throughput hit for a meaningful and scale-preserving loss improvement, it’s a candidate primitive to swap in. The Sam-channel framing — “aligned with MoEs but maybe better” — is half right: mHC is orthogonal to MoE (the experiments are on MoE backbones), but both are macro-design moves that decouple a capacity axis from per-token FLOPs. A follow-up mHC-lite has already appeared questioning whether 20 SK iterations are needed; worth tracking.