HyperAIHyperAI

Command Palette

Search for a command to run...

cmHC : équilibrer le mélange de flux dans les hyper-connexions par contraction géométrique

Résumé

Les hyper-connexions sous contrainte de variété (mHC) étendent les connexions résiduelles à plusieurs flux et stabilisent la propagation résiduelle en contraignant les matrices résiduelles de mélange de flux au polytope de Birkhoff, l'ensemble des matrices doublement stochastiques. Dans ce travail, nous étudions comment mélanger efficacement les flux résiduels au sein du polytope de Birkhoff. Nous mettons en évidence un compromis de mélange : lorsque des matrices résiduelles sous-mélangées restent proches des sommets du polytope de Birkhoff, les hyper-connexions dégénèrent en un ensemble de flux quasi indépendants ; lorsque des matrices résiduelles sur-mélangées se concentrent autour du barycentre uniforme du polytope, les flux deviennent moins distinguables les uns des autres. Nous validons théoriquement ces observations en bornant le mélange résiduel cumulé, la différence entre flux et la différence de gradient des coefficients de mélange à travers les couches. Motivés par ces constats, nous proposons la contraction pour hyper-connexions sous contrainte de variété (cmHC), une méthode exactement doublement stochastique qui contracte géométriquement le polytope de Birkhoff vers son intérieur. Cette contraction atténue le sous-mélange en forçant les matrices résiduelles à explorer plus profondément le polytope, avec une borne de mélange de flux démontrable et sans nouvelle paramétrisation. De plus, nous appliquons une contraction modérée dans les couches peu profondes pour éviter le sur-mélange, permettant une propagation stable du gradient lors du pré-entraînement de modèles à très grande échelle. Des expériences approfondies sur des modèles denses et à mélange d'experts à différentes échelles de paramètres démontrent l'efficacité et la capacité de mise à l'échelle de cmHC. Nous développons également des opérateurs fusionnés pour cmHC sur les NPU Ascend, réduisant la latence d'exécution des hyper-connexions jusqu'à 44,8 %.

One-sentence Summary

Researchers from Xingchen AGI Lab, China Telecom, and collaborators propose cmHC, an exact doubly stochastic method that geometrically contracts the Birkhoff polytope toward its interior to balance residual stream mixing in hyper-connections, mitigating under-mixing while preventing over-mixing at shallow layers for stable large-scale pretraining across dense and mixture-of-experts models, with Ascend NPU fused operators reducing hyper-connection execution latency by up to 44.8%.

Key Contributions

  • The paper identifies and theoretically characterizes a mixing trade-off in manifold-constrained hyper-connections: residual matrices near Birkhoff polytope vertices cause under-mixing and nearly independent streams, while concentration around the uniform barycenter causes over-mixing and reduced stream distinguishability. It provides bounds on cumulative residual mixing, stream difference, and gradient difference across layers.
  • The paper introduces Contraction for Manifold-Constrained Hyper-Connections (cmHC), an exactly doubly stochastic method that geometrically contracts the Birkhoff polytope toward its interior by replacing permutation matrices with smoothed ones. This applies moderate contraction at shallow layers to avoid over-mixing, guarantees positive stream mixing, and requires no new parameterization.
  • The paper validates the method on GPT-2 and mixture-of-experts models at 6B and 300B parameter scales, showing improved training loss and stable gradient propagation. It also develops fused Ascend NPU operators that reduce hyper-connection execution latency by up to 44.8%.

Introduction

Hyper-connections extend residual connections by mixing multiple feature streams, and manifold-constrained variants stabilize deep network training by restricting mixing matrices to the Birkhoff polytope of doubly stochastic matrices. However, prior methods still face an information exchange trade-off: residual matrices can stay near permutation vertices, causing under-mixing and limited cross-stream interaction, while excessive mixing can make streams too similar and reduce their distinguishability. Existing parameterizations that explore the polytope interior often add complexity, lack a strict mixing guarantee, and are not validated on large-scale pretraining. The authors propose cmHC, which contracts the Birkhoff polytope by replacing permutation matrices with smoothed doubly stochastic matrices, guaranteeing positive mixing without introducing new parameters. They also apply moderate contraction only at shallow layers to balance early information exchange against over-mixing, and validate the approach from GPT-2 to 6B and 300B mixture-of-experts models.

Method

The authors leverage Hyper-Connections to maintain nnn feature streams xl∈Rn×dx_l \in \mathbb{R}^{n \times d}xl​∈Rn×d, updating them through residual mixing and Transformer branches. To ensure training stability, mHC-lite constrains the residual mixing matrix HlresH_l^{res}Hlres​ to the Birkhoff polytope by parameterizing it as a convex combination of permutation matrices PmP_mPm​. This guarantees exact double stochasticity.

However, this approach suffers from under-mixing. The residual matrix often remains close to a single permutation vertex, such as the identity, rather than learning active stream mixing. As illustrated in the framework diagram, the matrix stays near the vertex of the Birkhoff polytope, limiting cross-stream information exchange.

This under-mixing phenomenon is not specific to the identity matrix; it can occur around any permutation matrix favored at initialization. During training, the mixing coefficients α\alphaα remain close to their initial near-Dirac state, causing a single permutation to dominate the residual matrix and suppressing effective information exchange between streams.

To mitigate under-mixing, the authors introduce a geometric contraction method, cmHC. They replace each permutation matrix PmP_mPm​ with a smoothed version Pm′P_m'Pm′​ controlled by a contraction strength parameter λ∈(1/n,1)\lambda \in (1/n, 1)λ∈(1/n,1). This operation maps the original Birkhoff polytope to a smaller region in its relative interior, ensuring that every entry of the contracted residual matrix has a strictly positive lower bound. This guarantees a minimum level of cross-stream mixing without adding learnable parameters.

Nevertheless, a mixing trade-off exists. Stronger contraction promotes information exchange but risks over-mixing. By Banach's fixed-point theorem, repeated application of the contraction across layers causes the cumulative residual matrix to converge exponentially toward the uniform barycenter of the polytope.

This convergence indicates an over-mixing state where all output streams assign identical importance to every input stream. Furthermore, geometric contraction induces a butterfly effect that suppresses the norm of stream differences during inference, making feature streams less distinguishable.

The contraction also reduces the upper bound of the gradient difference between different permutation coefficients, leading to a smoother distribution of α\alphaα that further promotes excessive mixing.

To balance these effects, the authors propose a moderate contraction strategy applied only to the first KKK shallow layers. Since the mixing effect accumulates through products of residual matrices, contraction in shallow layers propagates its influence to all subsequent layers. This design improves the expressivity of the hyper-connection architecture by encouraging early stream interaction while avoiding the over-mixing risks associated with deep layer contraction.

Experiment

The experiments evaluate constrained mixing hyper-connections on OpenWebText and FineWeb-Edu using GPT-2 models and 6B to 300B mixture-of-experts models. Results show that moderate geometric contraction improves language modeling loss and training stability over residual and hyper-connection baselines, with shallow contraction proving more effective than deep contraction. Analyses further indicate that contraction suppresses inter-stream differences and smooths the learned mixing coefficients, supporting the over-mixing trade-off interpretation. Fused operators on Ascend NPUs also reduce hyper-connection training latency.

Across OpenWebText and FineWeb-Edu, cmHC with a moderate contraction coefficient and K=2 attains the best average loss rank among the compared methods. On OpenWebText, cmHC improves training and validation loss over mHC and mHC-lite at every nanoGPT scale, while maintaining gradient norms comparable to those baselines and much lower than unconstrained HC. Moderate contraction also consistently outperforms strong contraction on both datasets. cmHC with moderate contraction achieves the best average loss rank on both OpenWebText and FineWeb-Edu. On OpenWebText, cmHC reduces training and validation loss compared with mHC and mHC-lite at every model depth without adding learnable parameters. cmHC keeps gradient norms comparable to mHC and mHC-lite and substantially lower than unconstrained HC, indicating more stable optimization. Moderate contraction consistently beats strong contraction on both datasets, with the validation-loss advantage widening as depth increases.

Across OpenWebText evaluations with a fixed contraction coefficient of 0.97, shallow contraction generally yields lower training and validation losses than deep contraction across nanoGPT-S, nanoGPT-M, and nanoGPT-L. The deepest contraction setting is an exception on nanoGPT-M but substantially worsens validation loss on nanoGPT-S. Deep contraction also tends to produce higher gradient norms, suggesting less stable training. Shallow contraction achieves lower training and validation losses than deep contraction across most model sizes. Deep contraction is associated with higher gradient norms in the majority of cases, indicating less stable training. The deepest contraction setting is not robust, improving the medium model while substantially worsening the small model.

The fused cmHC operator pipeline consistently achieves lower total forward and backward latency than mHC across the tested hidden dimensions. The relative speedup is largest at the smallest hidden dimension and narrows as hidden dimension increases, reflecting reduced impact of launch and intermediate-memory overhead at larger sizes. Across all tested configurations, cmHC shows lower total latency than mHC. The speedup is largest at the smallest hidden dimension and decreases as the hidden dimension grows. The benefit is greatest where launch and intermediate-memory overhead form a larger share of execution time.

The experiments evaluate cmHC against mHC, mHC-lite, and unconstrained HC on OpenWebText and FineWeb-Edu across nanoGPT model scales and depths, and they also benchmark a fused cmHC operator. Moderate contraction with K=2 gives the best average loss rank and reduces training and validation loss relative to mHC and mHC-lite without adding learnable parameters, while keeping gradient norms comparable to those baselines and much lower than unconstrained HC. Shallow contraction is generally more stable and more effective than deep contraction across model sizes, with the advantage growing at greater depths. The fused cmHC operator also consistently achieves lower forward and backward latency than mHC, with the largest speedup at small hidden dimensions and a narrowing benefit as hidden dimension increases.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp