The residual connections inside every model you call through an API have barely changed since the 2015 ResNet paper. DeepSeek’s new mHC paper proposes to redesign them, and my first reaction was that this is the least glamorous layer of the stack to attack, and that’s a point in its favor. Moulik Gupta wrote a long walkthrough of it on Towards Data Science, and this is my take from the side that ships features on top of these models instead of training them.
How residual connections compare to the replacements
The standard design is one line of math: the next layer receives x + F(x). The bare x is the whole trick. It’s an unmodified path from the first layer to the last, so gradients can flow backward through the stack without vanishing, and it’s why the original paper could train 152-layer networks when deeper plain stacks were degrading. The cost showed up much later, at LLM scale: every layer reads and writes one shared stream of fixed width, so the stream itself becomes the information bottleneck. The usual fixes, bigger blocks or more layers, multiply the compute bill.
ByteDance’s Hyper-Connections, from 2024, widen that stream. You run n parallel streams instead of one, with n set to 4 in the experiments. Small learned matrices condense the wide state down to normal size before the attention and MLP blocks, then expand it back after, and a residual mapping matrix mixes information across the streams on the way up. Capacity rises without touching the heavy layers. The failure is the mixing matrix: it’s unconstrained, so it can learn to scale features up, and depth compounds that. The paper measured signal amplification around 3,000x in stacked HC layers, and gradient norms went erratic roughly 12k steps into training. Wider streams also mean more memory traffic, and on modern GPUs that traffic often costs more than the arithmetic.
mHC keeps the wide streams and constrains the matrix instead. The three update rules side by side:
// standard residual
x_next = x + F(x)
// hyper-connections
x_next = H_res @ x + H_postT @ F(H_pre @ x)
// mHC: same shape, but H_res is projected onto
// the Birkhoff polytope before useThe Birkhoff polytope is the set of doubly stochastic matrices (rows and columns each sum to 1). A doubly stochastic matrix can mix but not amplify, since its spectral norm is capped at 1. Products of these matrices stay in the same family, so the bound survives being compounded across a hundred layers. The projection uses the Sinkhorn-Knopp algorithm from 1967, which rescales rows and columns until they sum to 1, with a cap of 20 iterations. Where HC’s compounded gain hit about 3,000, mHC measured about 1.6. The rest of the paper is systems work: fused kernels written in TileLang, intermediate tensors thrown away and recomputed in the backward pass, wide-stream communication overlapped with attention compute. Reported total training overhead at the 27B model: 6.7%. The math fix alone would have died in memory traffic, so the kernels are doing half the job.
What I’d pick for which kind of project
If you call a hosted model for store features, which is most of the AI work on WooCommerce sites right now, you don’t pick an architecture at all. You pick a model, and the architecture arrives baked in as quality per dollar. mHC’s gains in the paper were steadiest on reasoning benchmarks like BBH and DROP, so for review summaries or product copy, a standard model is already past what the feature needs. For anything that chains steps over a catalog, a model trained this way should eventually return better answers at the same size, and the cost of running it is what bites first. That’s what I wrote about earlier.
If you fine-tune or run local models, the choice is real. At small scale, unconstrained Hyper-Connections train fine and are simpler to implement, and I’d use them if I wanted the wider stream at all. At 27B, DeepSeek’s own data says the unconstrained version stops being viable, so the constraint is what makes the capacity usable. And if you want the 6.7% figure, you need the custom kernels and the schedule changes. A plain PyTorch implementation of the same math will cost you far more in throughput and memory.
The paper also shows the loss advantage holding across 3B, 9B and 24B variants, so it scales at least that far. MATH was the one benchmark where mHC didn’t beat the plain baseline.
What I take from it for my own work
The winning move was a constraint rather than capacity. DeepSeek made the mixing matrix weaker on purpose, limited to averaging and permuting, and the model got better because training stopped exploding. I run into the small version of this constantly: a filter that must return the array it was handed, a cache layer that falls back to the source instead of failing, a wrapper that passes the request through untouched when it has nothing to add. The untouched path is what saves you when one layer misbehaves, and the paper’s results are a large-scale version of the same argument.
The other lesson is the ratio of math to plumbing. Half the paper is kernel fusion, recomputation and communication scheduling, because a correct fix that thrashes memory gets eaten anyway. WordPress performance work has the same shape: a clever query that isn’t cached loses to a dumb query that is. It’s why I treat caching as part of the design for AI features rather than a cleanup task at the end. That includes the caches you get for free.
If your AI feature fails because the model is wrong about your prices, stock or store policies, a better residual connection changes nothing, and that’s what most of the store chatbot complaints I see are. Test that before anything else: run ten real customer questions through the current setup and count how many failures are grounding versus reasoning.
One caveat worth keeping from the source: the 20-iteration Sinkhorn-Knopp cap is an approximation, the measured gain of 1.6 is not the theoretical 1.0, and that’s proven at 27B but not at frontier scale. If you want a second pair of eyes on whether your store’s assistant needs a smarter model or just better grounding, that’s work I take on, and it’s usually the cheaper half of the problem to fix.