加速4×4流形约束超连接的投影计算,提升精度与效率。
Accelerating Birkhoff Projection for Manifold-Constrained Hyper-Connections
- 采用对偶优化与牛顿法求解,替代迭代投影,加快收敛。
- 在大输入情况下投影误差降低数个数量级,稳定性显著提升。
- 适合需要高效稳定超连接的深度学习模型部署场景。
流形约束超连接(mHCs)通过将残差混合矩阵约束为双随机矩阵来增强模型稳定性,其约束依赖于对Birkhoff多面体的投影,通常通过Sinkhorn-Knopp迭代实现。然而,该方法在前向传播中需多次迭代,反向传播依赖展开求导,带来巨大计算和内存开销,并在复杂输入下因收敛慢导致投影不准,削弱了原有的范数控制与稳定性保障。本文聚焦4×4情形,提出端到端加速框架:利用对偶形式将问题转化为三维无约束凸优化,以牛顿法快速求解;反向传播改用隐式微分,避免存储中间状态,获得精确梯度;并设计基于寄存器的线程级CUDA内核,最大化并行性。大量实验表明,新方法在输入幅度较大时仍保持极低边缘误差,且整体速度提升超20倍,显著优于主流开源基线。
原文摘要 · Abstract (English)
Manifold-constrained hyper-connections (mHCs) have recently been proposed as a principled extension of hyper-connections, where the residual mixing matrices are constrained to be doubly stochastic via projection onto the Birkhoff polytope. In practical mHC implementations, this constraint is enforced by Sinkhorn-Knopp iterations, and the backward pass relies on unrolling the iterative solver. This design introduces substantial computation and memory overhead, and may also yield inaccurate projections when the algorithm converges slowly on challenging inputs, undermining the intended norm-control and stability guarantees of mHCs. In this work, we focus on the practically important 4x4 Birkhoff projection setting and develop an end-to-end acceleration framework. By leveraging the dual formulation, we reduce the problem to a three-dimensional unconstrained convex problem and solve it with Newton's method, achieving fast convergence and high accuracy. For the backward pass, we replace the unrolled differentiation with implicit differentiation, yielding exact gradients without storing intermediate states. To exploit massive parallelism, we design a warp-level CUDA kernel that uses only register-level primitives, avoiding global and shared memory I/O. Extensive experiments against representative open-source baselines demonstrate that the proposed solver yields substantially more reliable doubly stochastic projections -- especially when the input magnitude is large -- and achieves significant end-to-end speedups (including the backward pass), reaching over 20x acceleration at large batch sizes while maintaining orders of magnitude smaller marginal errors.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。