Manuscript Offprint
arXiv:2611.23026TPHC: Improving Hyper-Connections with Tensor-Parallel Grouped Updates
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Hyper-Connections (HC) expand the residual stream of a Transformer into parallel streams, and manifold-constrained HC (mHC) stabilizes them at scale. However, mHC benefits little from more than four streams, partly because each sublayer writes a single output to all streams, limiting how differently they can be updated. In this work, we propose TPHC, which integrates tensor-parallel (TP) shards with HC streams to promote greater independence across streams. Specifically, we route a separate mixture of the residual streams to each TP shard and keep the individual shard outputs separate during write-back, so each stream can receive a different mixture of those outputs. This design makes the residual-stream updates more expressive without adding parameters or FLOPs to the attention or FFN sublayers. With native support for stream sharding under TP, TPHC requires only 9% more training time than mHC on an 8B model when both use four streams. Increasing the number of streams from four to sixteen raises its training time by only 19%. On a 1.1B model trained on 100B tokens, TPHC reduces validation loss by 0.7–1.0% and raises average zero-shot accuracy across six commonsense reasoning benchmarks by 0.3–0.7 percentage points relative to mHC at matched stream counts . Our code is available at https://github.com/wuyou2002/TPHC.
1 Introduction
Hyper-Connections (Zhu et al., 2025a, HC;) have recently attracted growing interest as an effective approach to improving the performance of large language models (LLMs). HC expands standard residual connections (He et al., 2016a; He et al., 2016b) from a single residual path to parallel residual streams, introducing learnable control over inter-layer information flow. Specifically, each sublayer reads a learned mixture of the streams and writes its output back to them, while a learned matrix mixes the residual streams. Building on HC, Manifold-Constrained Hyper-Connections (Xie et al., 2026, mHC;) constrain this residual mixing matrix to be doubly stochastic to stabilize signal propagation across layers. The DeepSeek-V4 series adopts mHC (DeepSeek-AI, 2026b), and DeepSeek-V4.1-Flash uses a Single-Pass variant designed to enable more efficient kernel fusion (DeepSeek-AI, 2026a).
(a) mHC\mathbf{x}_{0}$$\mathbf{x}_{1}$$\mathbf{x}_{2}$$\mathbf{x}_{3}$$X_{l}$$X_{l+1}$$\mathcal{H}^{\mathrm{pre}}_{l}$$1{\times}N$$\mathcal{F}_{l}sublayer, one output\mathcal{H}^{\mathrm{post}}_{l}$$N{\times}1$$\mathbf{u}$$\mathbf{o}$$\mathcal{H}^{\mathrm{res}}_{l}$$N{\times}N(b) TPHC (ours)\mathbf{x}_{0}$$\mathbf{x}_{1}$$\mathbf{x}_{2}$$\mathbf{x}_{3}$$X_{l}$$X_{l+1}$$\mathcal{H}^{\mathrm{pre}}_{l}$$k{\times}N$$\mathcal{F}_{l,0}$$\mathcal{F}_{l,1}$$\mathcal{F}_{l,2}$$\mathcal{F}_{l,3}$$k groups of , outputs kept separate\mathcal{H}^{\mathrm{post}}_{l}$$N{\times}k$$\mathbf{u}_{0}$$\mathbf{o}_{0}$$\mathbf{u}_{1}$$\mathbf{o}_{1}$$\mathbf{u}_{2}$$\mathbf{o}_{2}$$\mathbf{u}_{3}$$\mathbf{o}_{3}$$\mathcal{H}^{\mathrm{res}}_{l}$$N{\times}N
Figure 1: One sublayer (attention or FFN) of (a) mHC and (b) TPHC with streams. Horizontal lines are residual streams. (a) In mHC, the sublayer reads one mixture of the streams, and its single output is written to every stream, while mixes all streams densely. (b) In TPHC, the sublayer is split into groups: group reads its own mixture of the streams and returns its own output , and gives each stream its own mixture of the outputs. The illustrated case shows the full update, which writes all streams. The sparse update (§3.2) restricts and to the active streams.
Most HC-family models use , since additional streams bring little gain while substantially increasing computational cost. xHC (Zhang et al., 2026) attributes these limited gains to the shared source of stream updates: each stream receives a scaled copy of the same sublayer output. Therefore, it proposes temporal feature augmentation (TFA) to address this problem, which derives additional write-back components from causal convolutions of the FFN outputs from nearby preceding tokens.
In this work, we explore the possibility of using the partial outputs of tensor-parallel shards as a complementary source of write-back diversity. Large models commonly use tensor parallelism (Shoeybi et al., 2019, TP;) for training and inference. Consider the computation graph of mHC with TP sharding. TP splits each attention and FFN sublayer across devices by heads or hidden units, so that each shard computes a partial output from a shared input. An all-reduce aggregates these partial outputs into a single output, which mHC then writes to all streams. Thus, the partial outputs already computed by TP are collapsed into the single write-back component. Instead, we propose TPHC (Tensor-Parallel grouped Hyper-Connections), which treats the shards as groups and preserves their outputs as separate write-back components (Figure 1). In this way, each sublayer contributes separate write-back components rather than one. In addition, each group reads its own learned mixture of the streams, allowing group-specific inputs as well as outputs. Unlike xHC, our grouped write-back applies to both attention and FFN sublayers by adapting the existing HC read and write mappings to the TP groups, without introducing additional feature-augmentation modules. TPHC increases the training time of mHC by only 7–8% on 1.1B and 8B models when both use four streams.
This grouped design also naturally supports tensor parallelism. Each group resides on a separate device, naturally partitioning the group inputs and outputs across devices. The residual streams can also be sharded accordingly, with both read and write operations implemented using reduce-scatter collectives. This reduces the memory cost of the residual streams and makes training models with larger stream counts feasible: at the 8B scale, increasing from to raises the training time of TPHC by only 19%, compared with 59% without sharding.
In order to further reduce the cost of the mappings, we adopt the sparse update of xHC (Zhang et al., 2026) with a fixed schedule, so each layer writes only of the streams while every sublayer still reads all of them. This reduces the cost of generating the mappings from to . In addition, we initialize each group to read from and write to its own stream. This group-specific initialization breaks the symmetry (Alimaskina et al., 2026) within each sublayer and we empirically find it benefical to model performance.
Our experiments demonstrate the effectiveness of TPHC. On a 1.1B model, TPHC achieves lower training and validation loss than mHC with from to . It also improves average zero-shot accuracy on commonsense reasoning tasks by up to 0.7 percentage points over mHC. Notably, TPHC with 8 streams outperforms mHC with 16 streams. Our analysis also suggests that the shared write drives the mHC streams toward a common direction, whereas the TPHC streams remain less homogeneous.
2.1 Hyper-Connections: HC, mHC, and xHC
Each Transformer block consists of an attention sublayer followed by an FFN sublayer. We index the sublayers by , where is the number of Transformer blocks. We denote the residual state after sublayer as , where is the number of streams and is the hidden size. Before the first sublayer, we form the initial state by replicating the token embedding across all streams. HC (Zhu et al., 2025a) replaces the residual update with
where is the attention or FFN sublayer with parameters . The pre-mapping forms the sublayer input as a weighted sum of the streams, the post-mapping writes the output back to the streams, and the residual mapping mixes the streams. mHC (Xie et al., 2026) predicts these three mappings from the input state normalized by RMSNorm (Zhang and Sennrich, 2019):
The three mappings are then parameterized as
Here are learned projections, scalar gates, static biases and the sigmoid, and Sinkhorn–Knopp normalization (; Sinkhorn and Knopp, 1967) makes doubly stochastic, which keeps the residual path non-expansive across depth.
xHC (Zhang et al., 2026) shares our motivation of making better use of multiple residual streams. Its sparse residual-stream architecture mixes and writes only of the streams, a few fixed ones and others chosen per token by a learned router, while every sublayer still reads all . It also adds write-back components to each FFN through TFA. Our TPHC retains the dense read and the sparse update of xHC but selects the written streams with a fixed schedule and obtains the additional write-back components from the TP partition of each sublayer.
Alimaskina et al. (2026) trace the under-use of HC streams to their permutation symmetry at initialization and break it with Learned Stream Scaling (LSS), learnable per-stream scales applied where the residual is expanded into streams. In TPHC, we break this symmetry within each sublayer by initializing each group to read primarily from and write primarily to a distinct stream.
mHC-lite (Yang and Gao, 2026) builds exactly doubly stochastic matrices without Sinkhorn iterations, and Frac-Connections (Zhu et al., 2025b) split the hidden state into fractions instead of copying it. Other work improves cross-layer information flow by aggregating earlier activations instead of expanding the residual state (Huang et al., 2017; Pagliardini et al., 2024; Xiao et al., 2025; Kimi Team, 2026).
2.2 Tensor Parallelism
Megatron-style TP splits each attention sublayer by heads and each FFN by its intermediate dimension across devices (Shoeybi et al., 2019; Narayanan et al., 2021). The first projection is column-parallel: each device computes the queries, keys and values of its heads, or its slice of the FFN units, from the replicated input. The output projection is row-parallel: each device produces a partial output in , and one all-reduce per sublayer sums them. Sequence parallelism (Korthikanti et al., 2023) rewrites each all-reduce as a reduce-scatter and an all-gather. These collectives are a major cost, especially in latency-bound inference (Pope et al., 2023). Ladder-Residual (Zhang et al., 2025) reroutes residual connections so that communication overlaps with computation, and SPD (Kim et al., 2025) drops synchronization points after selected attention sublayers. TPHC likewise modifies the architecture around the TP collectives, but instead of rescheduling the all-reduce, it removes the summation of the shard outputs.
3 Method
Compared with mHC, TPHC changes how each sublayer reads from and writes to the streams. Its central component is the grouped hyper-connection, which keeps the outputs of the TP groups separate (§3.1). It is complemented by the sparse update (§3.2) and an initialization that places each group on its own stream (§3.3). We describe the TP implementation, in which both groups and streams are sharded across devices (§3.4). Algorithm 1 in Appendix D gives the full procedure for one sublayer.
3.1 Tensor-Parallel Grouped Hyper-Connections
We split each sublayer into groups along its tensor-parallel partition, which divides its parameters into , and write for group . Group contains of the attention heads and of the KV heads in each attention sublayer, and of the intermediate units in each FFN sublayer, with the matching columns of the input projections and rows of the output projection. This partitioning preserves the total parameter count and FLOPs of the attention and FFN projections. Given a common input , the sum of the group outputs equals the output of the original sublayer, , and this sum is the all-reduce of standard TP. TPHC gives each group its own input and keeps the outputs separate:
Every group reads a learned mixture of all streams, and the group outputs are written back to the streams:
where , , and . In Eq. (1), every stream receives a multiple of the same output, whereas here can have rank .
We follow the mHC parameterization in Eqs. (3)–(5), adjusting the projection dimensions and reshapes to the matrix shapes above. For , we use rather than :
Attention and FFN sublayers have separate mappings. The token embedding is copied to all streams, and the final hidden state is .
3.2 Sparse Update
Eq. (8) updates all streams at every sublayer, which we call a full update. Generating the three mappings from the -dimensional input state costs training FLOPs per token and sublayer, compared with in mHC.
To reduce the computational cost of the mapping generation, we follow xHC to update only streams per sublayer, one per group, which we call a sparse update. Let denote the indices of these active streams. The update in Eq. (8) becomes
where stacks the active streams from the input state. The mappings are generated as in Eq. (2) from the entries of corresponding to the active streams. Each sublayer still reads all streams as in Eq. (7).
We choose the active streams with a heuristic schedule shared by both sublayers of each Transformer block. Let be the zero-based block index of sublayer . Following xHC, we update the first two streams, the fixed streams, at every sublayer. The remaining slots advance by positions per block over the other streams, which we call the sliding streams:
When , all streams are active in every block. For , each sliding stream is active once every 3 blocks when and once every 7 blocks when , as shown in Figure 6 in Appendix B.
In contrast to the router of xHC, which selects streams per token, our schedule depends only on the layer index. It introduces no parameters and uses fixed gather and scatter indices. The ablation experiments show that the performance of our sparse update matches that of the full update (§4.3).
Under the sparse update, generating the mappings only costs training FLOPs per token and sublayer, which is when and , compared with in mHC. Appendix C gives the detailed analysis for training FLOPs and parameter overhead.
3.3 Initialization
At initialization, the input-dependent component of each mapping is zero, so the mapping is determined solely by its static bias. In mHC, the token embedding is copied to all streams, and each sublayer writes its single output to every stream with the same weight, so the streams remain identical and the model starts as a standard Transformer. If TPHC used the same initialization, it would write the sum of the group outputs to every stream, so all groups would read the same input and start as shards of a single standard sublayer.
In TPHC, we set the bias of in row , column to and all other entries in that row to . For and , we set the diagonal bias entries to and the off-diagonal entries to . After applying the sigmoid to and and Sinkhorn normalization to the exponentiated , row of is nearly one-hot at stream , and and are close to the identity. Thus, group reads primarily from its own active stream , and stream receives mainly the output (Figure 4d). We refer to this write-back initialization as the identity write.
The groups receive identical inputs in the first sublayer because all streams start from the same embedding. Their separate writes allow the streams to differ after that sublayer, so the groups can read different inputs in subsequent sublayers. In our ablation, identity write lowers the final training loss relative to dense write at and (§4.3). Appendix A gives the implementation details.
3.4 Tensor-Parallel Implementation
(a) mHCGPU 0partial read\mathbf{u}$$\mathcal{F}_{l,0}$$\mathbf{o}_{0}partial writeGPU 1partial read\mathbf{u}$$\mathcal{F}_{l,1}$$\mathbf{o}_{1}partial writeGPU 2partial read\mathbf{u}$$\mathcal{F}_{l,2}$$\mathbf{o}_{2}partial writeGPU 3partial read\mathbf{u}$$\mathcal{F}_{l,3}$$\mathbf{o}_{3}partial write all-reduce all-reduce reduce-scatter mappingsreadwriteshards of one sublayer; the write sums their outputs(b) TPHC (ours)GPU 0partial read\mathbf{u}_{0}$$\mathcal{F}_{l,0}$$\mathbf{o}_{0}partial writeGPU 1partial read\mathbf{u}_{1}$$\mathcal{F}_{l,1}$$\mathbf{o}_{1}partial writeGPU 2partial read\mathbf{u}_{2}$$\mathcal{F}_{l,2}$$\mathbf{o}_{2}partial writeGPU 3partial read\mathbf{u}_{3}$$\mathcal{F}_{l,3}$$\mathbf{o}_{3}partial write all-reduce reduce-scatter reduce-scatter mappingsreadwrite groups; the write keeps their outputs separate
Figure 2: One sublayer of (a) mHC and (b) TPHC under tensor parallelism of degree 4 with sharded streams. GPU holds stream and shard of the sublayer, bars are collectives, and orange marks where (a) and (b) differ. mHC all-reduces the read, since every shard needs the full input , and its write sums the partial outputs . TPHC reduce-scatters the read into the group inputs and writes the as separate components.
Replicated streams.
Under standard TP, mHC follows the same strategy as a standard Transformer. Every device keeps a copy of all streams and performs mapping generation, reading, and writing locally. With TP degree , one all-reduce per sublayer sums the partial outputs of the shards. In this all-reduce, each device sends elements per token per sublayer, or at .
TPHC can adopt the same strategy. For , device holds group , which coincides with its Megatron shard. For , each device holds groups. Each device computes its group inputs locally. Since the group outputs must remain separate, an all-gather replaces the all-reduce. In this all-gather, each device sends elements per token per sublayer, or at .
With replicated streams, every device stores all streams and generates all mappings, so the memory per device grows with .
Sharded streams.
To reduce per-device memory, we shard the residual streams so that each device holds of them (Figure 2). For mHC (Figure 2a), each sublayer then requires three collectives. The mappings depend on the normalized state of all streams (Eq. (2)), so each device computes partial logits and the RMSNorm statistic from its own streams, and an all-reduce sums them. For the read, each device applies the columns of that belong to its streams, and since every shard requires the full input , a second all-reduce sums these partial inputs. For the write, each device combines its own streams with its partial output , and a reduce-scatter sums these contributions and returns the updated streams, so that the residual mixing, the write-back and the all-reduce of standard TP share a single collective. At , sharding raises the communication of mHC from to per sublayer (Table 5 in Appendix C), and since mHC writes all streams, its write grows with ( in total at ).
TPHC shards its streams in the same way (Figure 2b) and differs mainly in the read, where a reduce-scatter replaces the all-reduce and leaves on device . Device then computes its group (Eq. (6)), including the output projection, without communication, and the write sums the contributions to with a reduce-scatter, as in mHC. Both reduce-scatters become all-gathers in the backward pass. For , device holds stream . For , the streams are placed so that every device holds of the streams written in each layer, and since the fixed streams are written in every layer, the write reduce-scatter delivers each updated stream directly to the device that will hold it next, without a separate collective. Across the two reduce-scatters, each device sends a total of elements per token per sublayer, or at for any . The all-reduce for the mappings operates on values per token.
Sharding thus raises the communication of TPHC from to , and its overhead relative to mHC shrinks from to . The remaining lies entirely in the read, as the cost of keeping separate outputs, and unlike that of mHC, the communication of TPHC does not grow with .
4 Experiments
We evaluate TPHC on the Llama (Touvron et al., 2023) model, comparing language modeling loss and zero-shot commonsense reasoning accuracy across different stream counts (§4.1). We test the prefill and training cost on a single GPU and under tensor parallelism (§4.2). We conduct ablation studies to examine the contributions of grouped reads and writes, initialization, and the sparse updates (§4.3). Finally, we analyze the similarity of residual streams and their write-back mixtures across depth to examine how TPHC affects stream diversity (§4.4).
We compare models with standard residual connections (Llama), mHC (Xie et al., 2026), mHC-TFA, and TPHC with groups. mHC-TFA augments mHC with the TFA module from xHC (Zhang et al., 2026), including Gram–Schmidt orthogonalization. It differs from xHC only in that it writes all streams at every layer instead of using the sparse update. We evaluate each multi-stream method with streams and denote each configuration by appending the stream count to the method name (e.g. mHC16). Our code builds on HuggingFace Transformers (Wolf et al., 2020) and uses the scaled dot-product attention (SDPA) of PyTorch (Ansel et al., 2024) with torch.compile in max-autotune mode. Detailed model and training configurations are provided in Appendix E.
4.1 Main Results
Acc Loss Model HS OBQA WG ARC-c ARC-e PIQA Avg. Train Val Llama 51.1 31.6 54.6 27.6 49.3 71.5 47.6 2.1167 2.1188 mHC4 52.2 33.0 56.6 27.6 50.4 72.1 48.6 2.0967 2.0985 mHC-TFA4 52.4 33.2 56.7 27.2 52.0 72.0 48.9 2.0904 2.0923 TPHC4 52.7 33.0 54.9 28.3 52.6 71.9 48.9 2.0819 2.0838 mHC8 52.4 34.0 55.2 27.8 50.4 72.8 48.8 2.0907 2.0924 mHC-TFA8 52.8 34.8 54.9 28.3 51.5 71.7 49.0 2.0841 2.0859 TPHC8 54.2 34.8 56.2 26.9 51.1 72.4 49.3 2.0689 2.0706 mHC16 52.8 34.6 55.9 28.8 50.5 71.4 49.0 2.0867 2.0885 mHC-TFA16 53.1 32.8 57.2 28.2 52.5 72.1 49.3 2.0818 2.0835 TPHC16 54.2 35.8 55.2 29.3 51.9 71.9 49.7 2.0671 2.0688
Table 1: Zero-shot accuracy (%) and final training and validation loss of 1.1B models trained on 100B tokens. The number after each name is , and TPHC uses . The best result for each is in bold. HS, OBQA, and WG denote HellaSwag, OpenBookQA, and WinoGrande, respectively.
We follow the configuration of TinyLlama (Zhang et al., 2024), a Llama model with 1.1B parameters. We train the models from scratch on a 100B-token subset of the SlimPajama (Soboleva et al., 2023) dataset with sequence length 2048 and a global batch of 2M tokens. The models are trained with the AdamW optimizer (Loshchilov and Hutter, 2019) with and . We use a cosine learning rate schedule with a maximum learning rate of and a warmup of 200 steps. The final learning rate is . We use a weight decay of 0.1 and gradient clipping of 1.0. We report the final training loss, averaged over the last 50 steps, and the loss on the full SlimPajama validation set (163M tokens). We also report zero-shot accuracy with the LM Evaluation Harness (Gao et al., 2023) on commonsense reasoning tasks, including HellaSwag (Zellers et al., 2019), OpenBookQA (Mihaylov et al., 2018), WinoGrande (Sakaguchi et al., 2020), ARC-Challenge and ARC-Easy (Clark et al., 2018), and PIQA (Bisk et al., 2020).
Table 1 reports the main results. All hyper-connection variants outperform Llama. TPHC achieves the lowest training and validation loss at every , 0.7–1.0% below mHC and 0.4–1.7% below mHC-TFA on both, and improves average zero-shot accuracy relative to mHC by 0.3–0.7 percentage points.
TPHC also requires fewer streams to reach lower loss. TPHC4 matches mHC-TFA16, and TPHC8 outperforms both 16-stream baselines. As shown in Figure 3, all methods exhibit their largest gain over Llama early in training, while the gap between TPHC and mHC emerges within the first tenth of training and remains nearly constant.
0$$10$$20$$30$$40$$50$$-0.06$$-0.05$$-0.04$$-0.03$$-0.02training step ()loss LlamamHCmHC-TFATPHCN{=}4$$N{=}8$$N{=}16
Figure 3: Training loss of the 1.1B hyper-connection models minus that of Llama, smoothed over 1k steps. Color marks the method and line style the number of streams . Lower is better.
| 1.1B | 8B | |||||||
|---|---|---|---|---|---|---|---|---|
| Prefill | Train | Prefill | Train | |||||
| Model | ms | GiB | ms | GiB | ms | GiB | ms | GiB |
| 1 GPU | ||||||||
| Llama | 56.8 | 2.27 | 179.5 | 9.52 | 274.3 | 13.96 | 906.0 | 54.72 |
| mHC4 | 68.4 | 2.32 | 226.4 | 12.44 | 301.8 | 14.19 | 1009.4 | 58.99 |
| TPHC4 | 73.4 | 2.45 | 243.4 | 15.93 | 314.9 | 14.44 | 1093.5 | 69.11 |
| TPHC8 | 83.7 | 2.73 | 291.8 | 23.06 | 344.5 | 15.04 | 1234.5 | 89.72 |
| TPHC16 | 90.9 | 3.16 | 325.4 | 29.34 | 363.8 | 16.00 | OOM | |
| 4 GPUs, TP degree 4 | ||||||||
| Llama | 25.1 | 0.90 | 80.0 | 3.90 | 87.2 | 3.94 | 285.8 | 18.23 |
| mHC4 | 40.9 | 0.91 | 156.0 | 6.72 | 116.5 | 4.01 | 424.7 | 26.55 |
| + sharded streams | 36.8 | 0.94 | 151.8 | 4.83 | 112.4 | 3.96 | 411.5 | 20.66 |
| TPHC4 | 44.7 | 0.95 | 185.8 | 10.04 | 137.2 | 4.23 | 463.2 | 33.79 |
| + sharded streams | 37.8 | 0.94 | 193.3 | 5.37 | 118.6 | 4.01 | 447.0 | 21.73 |
| TPHC8 | 54.8 | 1.21 | 216.1 | 17.03 | 167.1 | 4.76 | 624.9 | 54.45 |
| + sharded streams | 42.5 | 0.97 | 199.9 | 6.13 | 122.1 | 4.15 | 494.4 | 23.96 |
| TPHC16 | 61.1 | 1.65 | 256.3 | 23.36 | 191.0 | 5.77 | 735.4 | 72.39 |
| + sharded streams | 45.9 | 1.10 | 206.2 | 7.37 | 133.1 | 4.54 | 531.0 | 27.40 |
Table 2: Prefill and training cost on NVIDIA H20 GPUs with batch size 1 and sequence length 2048. We report the average prefill latency and training step time (ms), together with the peak memory per GPU (GiB). Under TP, the streams are either replicated on every GPU, as in Megatron TP, or sharded across GPUs with “+ sharded streams” (§3.4). Training is compiled with max-autotune, and prefill uses the same mode with CUDA graphs disabled.
4.2 Efficiency
We test the prefill and training cost of the TinyLlama-1.1B and Llama-3.1-8B models (Grattafiori et al., 2024) under two configurations: single-GPU execution without TP and four-GPU execution with a TP degree of 4. Table 2 reports the results. Without TP at both scales, TPHC4 introduces 4–7% additional prefill latency compared with mHC4, and 7–8% additional training step time. Under TP with sharded streams at the 8B scale, TPHC4 is 6% slower than mHC4 in prefill and 9% slower in training, while using 5% more peak training memory. Compared with replicated streams, sharding reduces the prefill latency of TPHC4 by 15% at 1.1B and 14% at 8B, versus 10% and 4% for mHC4. It also reduces the peak training memory of TPHC4 by 47% and 36%, respectively.
At 1.1B, however, sharding increases the training step time of TPHC4 from 185.8 to 193.3 ms. Its training overhead relative to mHC4 is 19% with replicated streams and 27% with sharded streams. A possible reason is that the additional collectives add a roughly fixed cost, which outweighs the savings when the per-GPU workload is small. Sharding also slightly increases the prefill memory of mHC4 from 0.91 to 0.94 GiB. Apart from these two exceptions, sharding reduces both latency and peak memory.
The benefits of sharding grow with . At the 8B scale, sharding reduces the prefill latency of TPHC8 and TPHC16 by 27% and 30%, their training step time by 21% and 28%, and their peak training memory by 56% and 62%, respectively. Scaling from TPHC4 to TPHC16 with sharded streams increases prefill latency by 12%, training step time by 19%, and peak training memory by 26%. The corresponding increases with replicated streams are 39%, 59%, and 114%. On a single GPU, TPHC16 runs out of memory during training.
4.3 Ablation Studies
We first evaluate the grouped read and write in isolation and then the three design choices of TPHC: which streams the groups read at initialization, how the write is initialized, and how many streams each layer updates. All runs train 1.1B models with groups for one epoch on MiniPile (Kaddour, 2023), with a batch of 64K tokens. We report the final validation loss in Table 3, and show the initial mappings in Figure 4.
| Initialization | Loss | |||||
|---|---|---|---|---|---|---|
| read | write | update | ||||
| mHC | no groups | full | 2.2377 | 2.2271 | 2.2281 | |
| (a) | overlap | dense | full | 2.2324 | 2.2311 | 2.2202 |
| (b) | disjoint | dense | full | 2.2250 | 2.2203 | |
| (c) | disjoint | identity | full | 2.2328 | 2.2213 | 2.2095 |
| (d) TPHC | active | identity | sparse | 2.2195 | 2.2100 |
Table 3: Ablation of TPHC with groups. The final validation loss is reported. Lower is better. Rows (a)–(d) correspond to Figure 4(a)–(d), and (d) is the final TPHC. mHC uses the same number of streams without groups. With , every layer reads and writes all streams, so (a) and (b) share one run, as do (c) and (d).
pre-mapping post-mapping layer layer layer layer (a) overlapping read, dense write, full update0123456701234567012345670123456701230123(b) disjoint read, dense write, full update0123456701234567012345670123456701230123(c) disjoint read, identity write, full update0123456701234567012345670123456701230123(d) TPHC: active read, identity write, sparse update012345670123456701234567012345670123012310not written
Figure 4: Initial read () and write (, drawn transposed) patterns of the configurations in Table 3 for streams and groups in the first two layers. Rows are groups, columns are streams, and gray cells are near 1 and white cells near 0. (a)–(c) write all streams at every layer. (d) writes only the active streams of Eq. (12), and the remaining streams are unchanged.
Grouped read and write.
Row (a) of Table 3 adds the grouped read and write to mHC but retains its initialization: starts as an all-ones matrix, so all streams are initially identical (dense write), and every layer writes all streams. The grouped read and write (a) reduce the loss of mHC by 0.005 at and 0.008 at but increase it by 0.004 at , which motivates the following changes.
Read.
In (a), the streams read at initialization shift by one from layer to layer, so consecutive layers read largely the same streams. Disjoint read (b) gives consecutive layers disjoint inputs and covers all streams within layers, reducing the loss by 0.006 at and leaves it unchanged at , and we therefore adopt it.
Write.
In (b), dense write initialization produces the same write-back component across streams, whereas the identity write in (c) gives each stream a distinct one. With 4 streams, the two settings differ in validation loss by less than 0.001, whereas with 8 and 16 streams (c) reduces the loss by 0.004 and 0.011, respectively, and we therefore adopt it.
Update.
In the sparse update (d), each group initially reads from and writes to its own active stream, which significantly reduces the computational cost of mapping generation. Its loss remains within 0.002 of the full update (c) at both and , and we therefore adopt it.
1$$10$$20$$30$$40$$44$$0.4$$0.6$$0.8$$1Sublayer(a) Mean pairwise cosine similarity between streamsmHC4mHC-TFA4TPHC41$$10$$20$$30$$40$$44$$0$$0.25$$0.5$$0.75$$1Sublayer(b) Mean pairwise cosine similarity between rows of
Figure 5: Stream collapse and writes across depth for mHC4, mHC-TFA4 and TPHC4. The 44 sublayers are numbered in order, with attention at odd and FFN at even positions. (a) Mean pairwise cosine similarity between streams after each sublayer, averaged over tokens. (b) Mean pairwise cosine similarity between the rows of the token-averaged write matrix of each sublayer, which is 1 whenever is a single column, as in mHC and in the attention sublayers of mHC-TFA4.
With all three choices, TPHC improves over mHC by 0.005, 0.008 and 0.018 at , and , and unlike mHC, it continues to improve from 8 to 16 streams.
4.4 Stream Diversity Analysis
To examine how the models use their streams, we measure the mean pairwise cosine similarity between streams after each sublayer on SlimPajama validation data (Figure 5a). In mHC4, the streams become increasingly aligned with depth, reaching a cosine similarity of 0.985 at the last layer, while their norms remain comparable. The multi-stream residual thus collapses toward a single direction, even though all streams remain in use.
A likely cause is mHC’s shared write-back. remains close to the identity in most layers, and the stream norms grow by more than an order of magnitude with depth, so each stream is dominated by its accumulated writes. In mHC, these writes are scalar multiples of the same sublayer outputs, so all streams are weighted sums of the same vectors and differ only in their weights.
mHC-TFA4 and TPHC4 both write multiple distinct outputs, the four TFA components of the FFN output and the group outputs, respectively. Both reduce the stream similarity relative to mHC4, and TPHC4 attains the lowest similarity throughout the second half of the network, ending at 0.917 compared with 0.966 for mHC-TFA4. The two differ in the similarity of the write mixtures that different streams receive (Figure 5b). In mHC-TFA4, the attention sublayers still write a single output, since TFA augments only the FFN, and even in the FFN sublayers the streams receive similar mixtures (0.79 on average). In TPHC4, whose groups are initialized to write to their own streams, the mixtures remain distinct (0.40 on average) and become similar only in the last layers, where the streams also align.
5 Conclusion
We propose TPHC, which improves HC by using tensor-parallel sublayer partitions to produce distinct write-back components without increasing the parameters or FLOPs of the attention and FFN sublayers. TPHC achieves lower training and validation loss than mHC and mHC-TFA for , raises the average zero-shot commonsense reasoning accuracy of mHC, and with 8 streams outperforms mHC with 16. We also implement TP with sharded streams for TPHC, keeping the training-time overhead of TPHC4 relative to mHC4 small at the 8B scale and makes TPHC16 affordable. Our analysis further shows that TPHC4 maintains lower inter-stream cosine similarity than mHC4 and mHC-TFA4, consistent with its goal of preserving stream diversity.
Limitations
Our pretraining experiments are limited to 1.1B-parameter models and 100B tokens, and thus do not cover larger models with more training data. Our work focuses on dense Transformers, where TPHC builds its groups around tensor-parallel partitions. Consequently, the current grouping and communication design cannot be directly transferred to MoE models with expert parallel. We leave the extension of TPHC to MoE models for future work.
Ethics Statement
This work proposes an architectural modification for language-model pre-training and inherits the risks of the underlying models and training data. It does not introduce new data collection or new capabilities beyond those of standard LLMs. All models are trained on publicly released corpora, SlimPajama (Soboleva et al., 2023) and, for the ablations, MiniPile (Kaddour, 2023), and inherit their biases. SlimPajama is released under the Apache 2.0 license and MiniPile under the MIT license of the Pile, both of which permit research use.
Acknowledgements
We would like to thank Xuhao Lu for insightful suggestions on this work.
References
E. Alimaskina, G. Molodtsov, and A. Beznosikov Analyzing stream collapse in Hyper-Connections: from diagnosis to mitigation. In ICML 2026 Workshop on Weight-Space Symmetries: from Foundations to Practical Applications, Cited by: §1, §2.1.
J. Ansel, E. Yang, H. He, N. Gimelshein, A. Jain, M. Voznesensky, B. Bao, P. Bell, D. Berard, E. Burovski, G. Chauhan, A. Chourdia, W. Constable, A. Desmaison, Z. DeVito, E. Ellison, W. Feng, J. Gong, M. Gschwind, B. Hirsh, S. Huang, K. Kalambarkar, L. Kirsch, M. Lazos, M. Lezcano, Y. Liang, J. Liang, Y. Lu, C. Luk, B. Maher, Y. Pan, C. Puhrsch, M. Reso, M. Saroufim, M. Y. Siraichi, H. Suk, M. Suo, P. Tillet, E. Wang, X. Wang, W. Wen, S. Zhang, X. Zhao, K. Zhou, R. Zou, A. Mathews, G. Chanan, P. Wu, and S. Chintala PyTorch 2: faster machine learning through dynamic Python bytecode transformation and graph compilation. In Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2, ASPLOS ’24, pp. 929–947. External Links: Document, Link Cited by: §4.
Y. Bisk, R. Zellers, R. Le Bras, J. Gao, and Y. Choi PIQA: reasoning about physical commonsense in natural language. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34, pp. 7432–7439. Cited by: §4.1.
P. Clark, I. Cowhey, O. Etzioni, T. Khot, A. Sabharwal, C. Schoenick, and O. Tafjord Think you have solved question answering? Try ARC, the AI2 reasoning challenge. arXiv preprint arXiv:1803.05457. Cited by: §4.1.
DeepSeek-AI DeepSeek-V4.1-Flash: pushing the limits of KV cache compression. arXiv preprint arXiv:2609.19969. Cited by: §1.
DeepSeek-AI DeepSeek-V4: towards highly efficient million-token context intelligence. arXiv preprint arXiv:2606.19348. Cited by: §1.
L. Gao, J. Tow, B. Abbasi, S. Biderman, S. Black, A. DiPofi, C. Foster, L. Golding, J. Hsu, A. Le Noac’h, H. Li, K. McDonell, N. Muennighoff, C. Ociepa, J. Phang, L. Reynolds, H. Schoelkopf, A. Skowron, L. Sutawika, E. Tang, A. Thite, B. Wang, K. Wang, and A. Zou A framework for few-shot language model evaluation. External Links: Link Cited by: §4.1.
A. Grattafiori, A. Dubey, A. Jauhri, A. Pandey, A. Kadian, et al. The Llama 3 herd of models. arXiv preprint arXiv:2407.21783. Cited by: §4.2.
K. He, X. Zhang, S. Ren, and J. Sun Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778. Cited by: §1.
K. He, X. Zhang, S. Ren, and J. Sun Identity mappings in deep residual networks. In European Conference on Computer Vision, pp. 630–645. Cited by: §1.
G. Huang, Z. Liu, L. van der Maaten, and K. Q. Weinberger Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4700–4708. Cited by: §2.1.
J. Kaddour The MiniPile challenge for data-efficient language models. arXiv preprint arXiv:2304.08442. Cited by: §4.3, Ethics Statement.
H. Kim, D. N. M. Hoang, A. Kundu, M. Samragh, and M. Cho SPD: sync-point drop for efficient tensor parallelism of large language models. In Proceedings of the 42nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 267, pp. 30086–30098. Cited by: §2.2.
Kimi Team Attention residuals. arXiv preprint arXiv:2603.15031. Cited by: §2.1.
V. A. Korthikanti, J. Casper, S. Lym, L. McAfee, M. Andersch, M. Shoeybi, and B. Catanzaro Reducing activation recomputation in large transformer models. In Proceedings of Machine Learning and Systems, Vol. 5. Cited by: §2.2.
I. Loshchilov and F. Hutter Decoupled weight decay regularization. In International Conference on Learning Representations, Cited by: §4.1.
T. Mihaylov, P. Clark, T. Khot, and A. Sabharwal Can a suit of armor conduct electricity? A new dataset for open book question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 2381–2391. Cited by: §4.1.
D. Narayanan, M. Shoeybi, J. Casper, P. LeGresley, M. Patwary, V. A. Korthikanti, D. Vainbrand, P. Kashinkunti, J. Bernauer, B. Catanzaro, A. Phanishayee, and M. Zaharia Efficient large-scale language model training on GPU clusters using Megatron-LM. In Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, Cited by: §2.2.
M. Pagliardini, A. Mohtashami, F. Fleuret, and M. Jaggi DenseFormer: enhancing information flow in transformers via depth weighted averaging. In Advances in Neural Information Processing Systems, Vol. 37. Cited by: §2.1.
R. Pope, S. Douglas, A. Chowdhery, J. Devlin, J. Bradbury, A. Levskaya, J. Heek, K. Xiao, S. Agrawal, and J. Dean Efficiently scaling transformer inference. In Proceedings of Machine Learning and Systems, Vol. 5. Cited by: §2.2.
K. Sakaguchi, R. Le Bras, C. Bhagavatula, and Y. Choi WinoGrande: an adversarial Winograd schema challenge at scale. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 34, pp. 8732–8740. Cited by: §4.1.
M. Shoeybi, M. Patwary, R. Puri, P. LeGresley, J. Casper, and B. Catanzaro Megatron-LM: training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053. Cited by: §1, §2.2.
R. Sinkhorn and P. Knopp Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics 21 (2), pp. 343–348. Cited by: §2.1.
D. Soboleva, F. Al-Khateeb, R. Myers, J. R. Steeves, J. Hestness, and N. Dey SlimPajama: a 627B token cleaned and deduplicated version of RedPajama. External Links: Link Cited by: §4.1, Ethics Statement.
H. Touvron, T. Lavril, G. Izacard, X. Martinet, M. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar, A. Rodriguez, A. Joulin, E. Grave, and G. Lample LLaMA: open and efficient foundation language models. arXiv preprint arXiv:2302.13971. Cited by: §4.
T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, J. Davison, S. Shleifer, P. von Platen, C. Ma, Y. Jernite, J. Plu, C. Xu, T. Le Scao, S. Gugger, M. Drame, Q. Lhoest, and A. Rush Transformers: state-of-the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 38–45. Cited by: §4.
D. Xiao, Q. Meng, S. Li, and X. Yuan MUDDFormer: breaking residual bottlenecks in transformers via multiway dynamic dense connections. In Proceedings of the 42nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 267, pp. 68440–68458. Cited by: §2.1.
Z. Xie, Y. Wei, H. Cao, C. Zhao, C. Deng, J. Li, D. Dai, H. Gao, M. Xu, K. Yu, L. Zhao, S. Zhou, Z. Xu, Z. Zhang, W. Zeng, S. Hu, Y. Wang, J. Yuan, L. Wang, and W. Liang mHC: manifold-constrained hyper-connections. In Proceedings of the 43rd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 306, pp. 139786–139802. Cited by: §1, §2.1, §4.
Y. Yang and J. Gao mHC-lite: you don’t need 20 Sinkhorn-Knopp iterations. In ICLR 2026 Workshop on Geometry-grounded Representation Learning and Generative Modeling, Cited by: §2.1.
R. Zellers, A. Holtzman, Y. Bisk, A. Farhadi, and Y. Choi HellaSwag: can a machine really finish your sentence?. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 4791–4800. Cited by: §4.1.
B. Zhang and R. Sennrich Root mean square layer normalization. In Advances in Neural Information Processing Systems, Vol. 32. Cited by: §2.1.
M. Zhang, M. Mishra, Z. Zhou, W. Brandon, J. Wang, Y. Kim, J. Ragan-Kelley, S. L. Song, B. Athiwaratkun, and T. Dao Ladder-Residual: parallelism-aware architecture for accelerating large model inference with communication overlapping. In Proceedings of the 42nd International Conference on Machine Learning, Proceedings of Machine Learning Research, Vol. 267, pp. 75779–75792. Cited by: §2.2.
P. Zhang, G. Zeng, T. Wang, and W. Lu TinyLlama: an open-source small language model. arXiv preprint arXiv:2401.02385. Cited by: §4.1.
X. Zhang, X. Qin, T. Dai, X. Shi, H. Wu, Y. Yang, Z. Xia, S. Zhang, Y. Wang, Y. Cheng, and J. Yan xHC: expanded hyper-connections. In Advances in Neural Information Processing Systems, Cited by: §C.3, Table 4, Table 5, Appendix C, §1, §1, §2.1, §4.
D. Zhu, H. Huang, Z. Huang, Y. Zeng, Y. Mao, B. Wu, Q. Min, and X. Zhou Hyper-Connections. In International Conference on Learning Representations, Cited by: §1, §2.1.
D. Zhu, H. Huang, J. Zhou, Z. Huang, Y. Zeng, B. Wu, Q. Min, and X. Zhou Frac-Connections: fractional extension of Hyper-Connections. arXiv preprint arXiv:2503.14125. Cited by: §2.1.
Appendix A Implementation Details
Batched group computation.
All per-group projections are stored as tensors with a leading group dimension, , and applied with a single batched matrix multiplication over the groups. The query, key and value projections are fused into one batched GEMM, and so are the SwiGLU gate and up projections. After the projection, the heads of all groups are concatenated so that a standard attention kernel (e.g., SDPA) computes attention over all heads at once. Group ’s queries, keys and values are computed from its own normalized input .
Functional scatter.
The write of Eqs. (10)–(11) is implemented as , where is the one-hot scatter matrix of and is the active-stream mask. Both are fixed buffers, which avoids in-place indexing operations that break compiled autograd. This functional form reads and writes the full residual state, whereas the memory traffic in Table 5 counts an in-place scatter that touches only the active streams.
Initialization.
With and , each mapping starts at its static bias. TPHC uses bias entries with . The identity write of TPHC sets if and , where is the all-ones vector, with all other entries .
Full-update variant.
The configurations of Figure 4a–c use the full update of Eq. (8), with all mappings generated from the -dimensional state. In (a), if , so consecutive layers read overlapping streams. In (b) and (c), if , so consecutive layers read disjoint streams. The dense write of (a) and (b) computes with and , so all its entries are 1. The identity write of (c) uses and sets if . In all three, , so starts near the identity, and all other bias entries are .
Numerics.
Sinkhorn–Knopp runs in fp32 for 20 iterations, alternately normalizing columns and rows after subtracting the column-wise maximum of the logits for stability.
Appendix B Update Schedule Details
Figure 6 shows the schedule for . Groups 0 and 1 always write the two fixed streams, and groups 2 and 3 move over the sliding streams, so the pattern repeats every 3 layers for and every 7 layers for . In our 22-layer model with , the two fixed streams are written in all 22 layers and each of the 14 sliding streams in 3–4 layers, while every stream is read by all 44 sublayers.
(a) 01230012310123201233012340123501236012370123801234567layer (b) 0123001230123201230123401230123601230123801230123100123012312012303691215layer stream
Figure 6: Active streams of each layer produced by Eq. (12). Blue: fixed streams, written at every layer. Orange: sliding streams. Grey: not written (identity). The number in each active cell is the group that writes it. Every stream is read at every sublayer.
Appendix C Training FLOPs and Parameter Overhead
We follow the analysis of Zhang et al. (2026) and count the mapping generators of one layer (an attention and an FFN sublayer), ignoring biases and gates.
C.1 Parameters per Layer
In mHC, each sublayer projects the -dimensional state to coefficients, so a layer adds parameters. TPHC generates from the full state () and and from the active streams ( each), so .
C.2 Training FLOPs
As in xHC, the parametric training FLOPs of the mappings are per token for layers; Sinkhorn normalization and the stream mixing itself are left out and appear as memory traffic in Table 5. The backbone costs six times its linear-layer parameters per token, plus for causal attention over sequence length and for the LM head. Table 4 gives both overheads for our 1.1B models (, , , , , ).
| 1.1B (, ) | |||
|---|---|---|---|
| Method | /layer | ||
| mHC4 | 393K () | 0.8% | 0.8% |
| TPHC4 | 786K () | 1.6% | 1.5% |
| mHC8 | 2.62M () | 5.2% | 5.1% |
| TPHC8 | 1.57M () | 3.1% | 3.1% |
| mHC16 | 18.9M () | 37.7% | 36.9% |
| TPHC16 | 4.72M () | 9.4% | 9.2% |
Table 4: Parameters per layer added by the mappings, and the resulting parameter () and training-FLOPs () overhead relative to the 1.1B backbone, computed as in Zhang et al. (2026). TPHC uses and, for , the sparse update.
C.3 Memory Traffic
We follow Zhang et al. (2026) in counting memory accesses for the residual-stream operations. Table 5 reports the resulting memory traffic and the per-device communication volume under TP, both per token per sublayer.
| mHC | TPHC | |||
|---|---|---|---|---|
| Operation | R | W | R | W |
| Mappings | ||||
| dense read | ||||
| Gather | – | – | ||
| Active mappings | – | – | ||
| mixing | ||||
| write-back | ||||
| Merge and scatter | ||||
| Sum, | ||||
| Total, | ||||
| Total, | ||||
| Total, | ||||
| TP, replicated | ||||
| TP, sharded |
Table 5: Per-token memory access of the residual-stream operations of one sublayer, excluding the input and output of the sublayer function, counted as in Zhang et al. (2026) with the active streams gathered and scattered in place. R: read, W: write, for numerical totals. †No gather is needed when . TP: data each device sends per token and sublayer under TP degree 4, with the streams replicated on every device or sharded across devices (§3.4).
Appendix D Algorithm
Algorithm 1 One sublayer (attention or FFN) of layer in TPHC
1: state ; active set ; groups
2:
3: entries of of the active streams
4: for in parallel do group
5: row of
6: dense read
7:
8: end for
9: outputs kept separate
10:
11:
12: sparse update
13: return rows unchanged
Appendix E Model and Training Configurations
| Section | §4.1–§4.4 | §4.2 |
|---|---|---|
| Model size | 1.1B | 8B |
| Layers | 22 | 32 |
| Hidden size | 2048 | 4096 |
| FFN size | 5632 | 14336 |
| Heads / | 32 / 4 | 32 / 8 |
| Head dimension | 64 | 128 |
| Vocabulary | 32,000 | 32,000 |
Table 6: Model configurations.
| Section | §4.1, §4.4 | §4.3 |
|---|---|---|
| Training data | SlimPajama | MiniPile |
| Training tokens | 100B | 1.7B |
| Global batch (tokens) | 2M | 64K |
| Sequence length | 2048 | |
| LR schedule | cosine | |
| Optimizer | AdamW | |
| 0.9 | ||
| 0.95 | 0.999 | |
| Warmup | 200 steps | 1.5% of steps |
| Weight decay / grad. clip | 0.1 / 1.0 | |
| Max LR | ||
| Min LR | 0 | |
| Precision | bf16 | |
| GPU | 128 H800 | 8 H800 |
| Sinkhorn iterations | 20 | |
| Gate init / bias margin | 0.01 / 3 |
Table 7: Training configurations of the 1.1B models.