Shallow λ=0.97 contraction cuts nanoGPT val loss by up to 0.0073 versus mHC-lite

cmHC: Balancing Stream Mixing in Hyper-Connections via Geometric Contraction

Haowei He, Ziwen Zhao, Chenshuo Pan, Gang Lin, Zhihao Yang, Chao Wang, Xinzhang Liu, Kaidong Yu, Han Gao, Dongfang Li, Menglin Yang, Shuangyong Song, Yongxiang Li

cs.LG

2026-11-20

cmHC contracts only the first two layers at λ=0.97 and adds no parameters. OpenWebText nanoGPT validation loss falls 0.0073, 0.0024, and 0.0045 versus mHC-lite.

What problem this solves

Hyper-Connections split the residual into n feature streams and mix them with a learned matrix. Leave that matrix unconstrained and the signal scale drifts as depth grows. mHC confines it to the Birkhoff polytope, the set of doubly stochastic matrices: nonnegative entries, every row and column sums to 1, spectral norm at most 1. The residual branch cannot amplify, so the stack stays bounded.

A stable mixer can still refuse to mix. mHC-lite uses the Birkhoff-von Neumann theorem and writes the matrix as a convex combination of every permutation matrix, with softmax weights. The residual bias starts at 0 on the diagonal and -8 elsewhere, so training begins on the identity permutation. At 5k and 10k steps the average matrix is still there. Point the initialization at another permutation and the average sticks to that vertex instead. A permutation only reorders streams. The extra width collapses into nearly separate residuals.

Other parameterizations step into the interior of the polytope. They do not prove a mixing floor, and they were not run through large-scale pretraining. The other failure is over-mixing: stronger contraction pushes cosine similarity between streams toward 1.

Method

cmHC keeps the softmax and replaces the basis. Supported entries of a permutation P keep weight λ. The remaining 1-λ is split evenly over the other n-1 entries. λ lies in (1/n, 1). Near 1, the map is mHC-lite again. Near 1/n, every entry equals 1/n.

Equivalently, the original matrix is pulled toward the uniform barycenter J, the matrix filled with 1/n: H' = λ' H + (1-λ') J, with λ' = (nλ-1)/(n-1). Smoothed bases are computed ahead of time. The parameter count does not change. At n=4 there are 24 bases, 4 factorial.

Contracted matrices stay doubly stochastic, so the spectral norm is still at most 1. Every entry is at least min(λ, (1-λ)/(n-1)), strictly positive. For n=4 and λ=0.97 that floor is 0.01. Even a one-hot coefficient vector leaks every input stream into every output stream. Permutation vertices are no longer reachable.

Applying the floor at every layer overshoots. The Dobrushin coefficient τ of the cumulative product is bounded by the product of the per-layer λ'. Smaller τ means the rows look more alike. Dropping λ from 1 to 0.97 cuts τ at 24 layers from 0.6539 to 0.1656. At λ=0.7, τ is 0.0231 and the product is nearly the barycenter. At 48 layers the three values are 0.6372, 0.1173, and 0.0462. Contraction also tightens the bound on stream-difference norm and shrinks the gradient gap between permutation coefficients. The coefficients flatten, and mixing grows further.

So contraction is applied only on the first K layers. Deeper layers keep the raw permutations and can stay near the identity. A shallow mix multiplies into every later layer. A deep mix only affects the end of the network. The contracted layers share one λ.

Results

Training follows the mHC-lite setup, from scratch on OpenWebText and FineWeb-Edu. Baselines are a single residual, four independent residuals, unconstrained HC, Sinkhorn mHC, mHC-lite, and KromHC, which factors doubly stochastic matrices into Kronecker products. Mixers use n=4 except the single residual. The three nanoGPT scales have 12, 24, and 48 hyper-connection layers, about 45M, 0.12B, and 0.36B parameters, trained 10k steps with three runs.

On OpenWebText, λ=0.97 and K=2 gets the best average loss rank, 1.3. Validation loss against mHC-lite:

ScalemHC-litecmHCGap
12 layers3.47593.4686-0.0073
24 layers3.25643.2540-0.0024
48 layers3.19493.1904-0.0045

The same setting also beats mHC at all three scales. On FineWeb-Edu its average rank is 2.8, again first in the table. Gradient norms stay in the same range as mHC and mHC-lite. On 24-layer FineWeb-Edu, unconstrained HC reaches 2.7226±2.2325. cmHC stays near 0.37.

With every layer contracted, λ=0.97 beats λ=0.70. The OpenWebText validation gap grows from 0.0043 at 12 layers to 0.0143 at 48. At 48 layers, λ=0.70 lands at 3.2169, worse than four independent residuals at 3.1909. Reducing K from 10 to 2 improves average rank. Putting λ=0.97 on only the last 10 layers lifts 12-layer validation loss to 3.5184 and the gradient norm to 1.3792. Deep contraction has the higher gradient norm in 8 of 9 comparisons.

The 6B and 300B mixture-of-experts models use a DeepSeek-style stack: multi-latent attention, sparse experts, four streams, FineWeb-Edu. At 6B, λ=0.97, step 71.5k, loss is 0.002 below mHC and 0.005 below mHC-lite. At 300B, λ=0.96, step 2k, the gap versus mHC is 0.0157, with smaller and smoother gradients.

Fused Pre and Post operators on Ascend 910C cut forward-plus-backward latency against the mHC pipeline by 44.8%, 31.0%, and 24.1% at hidden sizes 2048, 3584, and 7168 (sequence 4096, n=4). The gain shrinks as hidden size grows. The Transformer sublayer is not in the timer.

Why it matters

Code that already runs mHC-lite can swap in the smoothed bases and set λ=0.97 on the first two layers. No new parameters and no optimizer change. Four streams mean 24 permutations, computed once and cached.

The return is a third decimal place of loss. A 0.007 validation gap is real on these runs, and the absolute move is still in the thousandths. Stability is the firmer result. Unconstrained HC hits a gradient norm of 2.7226 on 24-layer FineWeb-Edu. Doubly stochastic mixing holds norms near 0.37, and cmHC does not give that up to buy a little more mixing.

The Ascend kernels speed up only the hyper-connection segment. At hidden size 7168 the reduction is 24.1%, not a full-step training speedup.

On the mHC line this is an incremental fix.

Limitations

The grid is not a sweep of wins. On 12-layer FineWeb-Edu, mHC-lite validation loss is 3.4660 and cmHC with K=2 is 3.4672, slightly worse. On 48-layer OpenWebText the best validation number is K=10 at 3.1893. The rank winner K=2 is 3.1904, beside four independent residuals at 3.1909. Average rank covers that tie.

The 300B gap of 0.0157 is measured at step 2k. It shows that early loss and gradients still look normal. It is not a finished pretraining run. At 6B and step 71.5k the margins are 0.002 and 0.005. No downstream benchmark is reported.

Stream count is frozen at 4. The mixer is still a combination of n! permutations: 120 bases at 5 streams, 720 at 6. Contraction adds no parameters, and the basis count remains. Whether wider streams still under-mix, and whether K=2 is enough, is untested.

Stream-difference and gradient-gap bounds use a local linear approximation. The cumulative-mixing bound does not. Figure 3 also drifts slightly off exact double stochasticity because of low precision at inference. λ and K have to be searched. λ=0.70 on every layer hurts the 48-layer run. The case for shallow mixing rests on the older claim that features move from general to specific with depth, plus the shallow-versus-deep ablation in this paper. These models did not get a separate layer-wise representation study.

The write-up of Figure 6 says only cmHC lands below four independent residuals. In Table 1, on 12-layer OpenWebText, unconstrained HC has training loss 3.4749 and the four-stream residual has 3.4777. On the three-run means, HC is lower too.

Terms

Source

Related papers

All paper explainers