Manuscript Offprint
arXiv:2611.24567Objective-Specialized Residual Streams in Manifold-Constrained Hyper-Connections
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Manifold-constrained Hyper-Connections (mHC) extend a Transformer’s residual stream into multiple parallel streams with learned cross-stream connections. Prior work trains all streams toward a shared objective. We instead study whether assigning distinct learning objectives to different streams can improve task performance and induce objective-specific specialization. Using complementary lexical (sparse) and semantic (dense) retrieval objectives as a test case, we find that objective-specialized mHC consistently outperforms a non-specialized mHC model across the full sparse–dense fusion range, for both two- and four-stream models and at two model scales. We then examine how specialization changes the model internally using probes of stream representations, residual mixing, objective-specific gradient flow, and read/write gates. The specialized and non-specialized models behave similarly through most of the network but diverge in the final layers: the specialized model develops increasingly objective-specific gradient flow, distinct read/write routing patterns, and reduced cross-stream mixing, and streams assigned to different objectives become increasingly dissimilar while those trained toward the same objective remain highly similar. Fixing the residual mixing to the identity leaves the specialization benefit intact, indicating that the benefit stems from objective-specific read/write routing rather than learned cross-stream mixing. These results show that assigning distinct objectives to mHC streams can improve multi-objective retrieval while inducing structured, depth-dependent specialization in the residual computation.
1 Introduction
Manifold-constrained Hyper-Connections (mHC) Xie et al. (2025) replace a Transformer’s single residual stream with multiple parallel streams Zhu et al. (2024), whose interactions are learned at each layer’s attention and feed-forward modules. Existing applications of mHC jointly optimize all streams toward a shared objective Xie et al. (2025); Oldenburg et al. (2026); Mishra (2026), leaving open a basic question: what happens when different streams are assigned different objectives?
Distinct objectives can benefit from shared representations and computation Caruana (1997); Liu et al. (2019), while task-specific processing can be beneficial when objectives require different information Misra et al. (2016); Sun et al. (2019). This motivates objective-specialized mHC, in which different streams are assigned distinct learning objectives while retaining the ability to interact through learned connections.
We investigate two questions. RQ1: Can mHC streams specialize toward distinct learning objectives while improving joint task performance? (Section 4) RQ2: How does this specialization emerge across depth, as reflected in inter-stream representations, gradient flow, and read, write, and residual-mixing gates? (Section 5).
As a concrete test case, we consider two complementary information-retrieval objectives: lexical and semantic matching Lin and Lin (2023); Lee et al. (2023). We train two- and four-stream mHC models, assigning each objective to a disjoint subset of streams, and evaluate at two model scales, ModernBERT-base and ModernBERT-large Warner et al. (2024), to test whether the effect of specialization holds beyond a single model size. Across 13 BEIR benchmarks Thakur et al. (2021), the pattern is consistent at both scales: objective specialization improves average nDCG@10 from to with two streams and from to with four streams at the base scale, and from to and from to , respectively, at the larger scale. In addition, we demonstrate that the specialized models outperform their non-specialized counterparts across the full sparse–dense fusion range at both scales.
Beyond retrieval performance, we analyze how objective specialization emerges within the mHC stack using complementary measurements of stream routing, gradient flow, and inter-stream representations. These diagnostics reveal a consistent depth-dependent pattern. Through most of the Transformer, specialized and non-specialized models exhibit similar residual mixing and read/write routing, while gradients from the two objectives remain broadly distributed across streams. In the final layers, however, the specialized models exhibit a distinct pattern absent in the non-specialized models: gradient flow becomes increasingly concentrated on the streams assigned to each objective, read/write routing becomes asymmetric, with the MLP increasingly reading from the sparse-objective streams and writing toward the dense-objective streams, and residual mixing moves toward the identity. Additionally, the representation analysis provides a clear contrast: in the non-specialized model, all streams remain highly similar throughout the network, whereas in the specialized model, streams assigned to different objectives become increasingly dissimilar in the final layers. These effects persist when increasing from two to four streams, suggesting that mHC supports shared computation at early depths followed by objective-specific processing near the output. Finally, fixing the residual mixing to the identity leaves the specialization benefit intact, indicating that the benefit stems from the objective-specific read/write routing rather than from learned cross-stream mixing.
Together, these results show how objective specialization in mHC emerges across depth, connecting retrieval gains to changes in stream representations, gradient flow, and routing. To our knowledge, we are the first to assign distinct learning objectives to different mHC streams and characterize the resulting specialization across the Transformer stack.
2.1 Hyper-Connections
Residual connections provide an identity path that allows representations to propagate across layers without transformation. Hyper-Connections (HC) Zhu et al. (2024) generalize this paradigm by expanding the residual pathway into multiple parallel streams. HC allows the multiple streams to interact through learned connectivity patterns, providing greater flexibility in how information propagates through depth. Manifold-Constrained Hyper-Connections (mHC) Xie et al. (2025) constrain these learned connections to the Birkhoff polytope Sinkhorn and Knopp (1967), ensuring that the residual mixing matrices remain doubly stochastic and thereby preserve the stability of the residual pathway while retaining learned cross-stream interactions. Recent work has also begun to examine how the multiple residual streams introduced by HC and mHC are actually used after training Alimaskina et al. (2026); Zhao et al. (2026). Our work builds on this multi-stream formulation but changes how the streams are trained: rather than jointly optimizing all streams toward the same objective, we assign different objectives to different streams and study the resulting organization of information flow across depth.
2.2 Multi-Task and Multi-Objective Learning
Multi-task learning aims to share computation across tasks while reducing task interference Caruana (1997); Crawshaw (2020). Prior work addresses this by learning task-specific representations or routing capacity, using approaches such as cross-stitch networks and mixture-of-experts Misra et al. (2016); Ma et al. (2018); Gupta et al. (2022). Our setting instead attaches distinct objectives directly to different mHC streams within the residual computation, allowing the streams to remain coupled while developing objective-specific behavior.
2.3 Multi-Representation Retrieval
Modern information retrieval increasingly combines representations that capture different notions of relevance. Sparse retrieval emphasizes lexical matching and exact or token-level correspondence, whereas dense retrieval captures semantic similarity through continuous representations Formal et al. (2021); Lin and Lin (2023). These signals are complementary: combining lexical and semantic matching can improve retrieval effectiveness and robustness over either representation alone Lin and Lin (2023); Lee et al. (2023).
Recent retrieval models demonstrate the value of combining complementary relevance signals within a single model. BGE-M3 Chen et al. (2024), for example, supports dense, sparse, and multi-vector retrieval within a unified encoder, showing that multiple retrieval representations can be supported and efficiently combined. We instead ask whether distinct learning objectives can be assigned directly to different internal mHC streams, and how such specialization emerges across the Transformer stack. We use sparse and dense retrieval as complementary objectives to study this question.
2.4 Retrofitting Pretrained Models with mHC
Closely related to our setup is the use of mHC as a retrofit onto an already-pretrained model. Oldenburg et al. (Oldenburg et al., 2026) wrap a pretrained model’s residual stream with mHC for parameter-efficient fine-tuning. We likewise retrofit mHC onto a pretrained encoder, but differ in two respects: we fine-tune all parameters (both the backbone and the mHC routing), and we assign distinct objectives to different streams rather than optimizing all streams toward a common objective.
3 Task-Specialized Residual Streams in mHC
3.1 Hyper connection
Whereas a standard residual network maintains a single hidden representation per token throughout the Transformer stack, Hyper-Connections (HC) (Zhu et al., 2024) expand this hidden state into parallel streams. We denote the hidden state of a token at layer as , where the -th row vector represents the -th stream for . At the input layer (), the initial token embedding is replicated across all streams, after which the streams propagate through the entire encoder stack.
At each Transformer sublayer (representing either Multi-Head Attention or a Feed-Forward Network), mHC (Xie et al., 2025) govern information routing across streams via three components: a read vector that determines how much each stream contributes to the sublayer’s input, a write vector that determines how much of the sublayer’s output is written back into each stream, and a mixing matrix that governs how streams exchange information with one another along the residual path.
Aggregation (read).
The read gate collapses the streams into a single vector using an element-wise weighted sum across streams. This vector is the only input to the sublayer:
Distribution (write and mixing).
The single sublayer output is split back into streams by the write gate, which assigns a per-stream scalar gain to . In parallel, the mixing matrix recombines the incoming streams along the residual path, and the two are summed to form the next-layer streams:
Routing components.
The read, write, and mixing objects are not fixed (Xie et al., 2025): they are produced from the current streams by learned linear projections with bias terms. Let be the flattened, normalized streams. Then
where , , and are, respectively, the read, write, and mixing objects introduced above, are learned projection weights, are learned biases, and are learned scalar gains. The biases carry the static component of each gate, while the projections make the routing depend on the streams themselves.
Manifold constraint.
The defining feature of mHC is that the residual mixing matrix is constrained to be doubly stochastic via Sinkhorn-Knopp normalization (Sinkhorn and Knopp, 1967), which helps stabilize signal and gradient propagation across depth (Xie et al., 2025).
3.2 Encoder for Information Retrieval
Encoder.
We start from the publicly available, pretrained ModernBERT encoder (Warner et al., 2024), using both the base ( layers, hidden size ) and large ( layers, ) variants, and fine-tune each for retrieval. We retrofit mHC onto the pretrained encoder by wrapping every self-attention and MLP sublayer in an mHC block (Section 3.1) with streams. The retrofit is function-preserving at initialization: for every layer , the resulting stream is identical across all streams and equal to the hidden state the pretrained ModernBERT model would produce at that layer (Appendix A). Fine-tuning therefore starts from the pretrained ModernBERT function, with any subsequent stream specialization learned during retrieval training.
Retrieval heads.
Let denote the final-layer () contextual representation of token in stream , where ; retrieval heads read only the final-layer streams. Let denote the set of content token positions, excluding special tokens. Each retrieval head reads a designated subset of streams, for the dense head and for the sparse head. The selected streams are mean-pooled at each token:
The dense representation is obtained by masked mean pooling over content tokens followed by normalization:
The sparse head produces a vocabulary-sized, non-negative lexical representation. A learned linear projection assigns a scalar importance to each token. The importance is rectified by ReLU and masked to zero on non-content tokens:
where and are learned parameters and for . Let denote the vocabulary id of token , where is the vocabulary. The token weights are then max-pooled according to vocabulary id:
If vocabulary id does not occur among the content tokens, we set . Thus, the sparse representation contains non-zero weights only for terms occurring in the input, following the lexical term-weighting formulation of uniCOIL (Lin and Ma, 2021), BGE-M3 (Chen et al., 2024).
Scoring.
Let and denote a query and a candidate document, respectively. Both are encoded with the same encoder, each independently producing representations and via the retrieval heads above. Retrieval scores are computed as inner products of matching representation types:
Stream specialization.

Figure 1: Schematic comparison of the three encoder configurations studied in this work. In all three, streams propagate through the full encoder stack and the retrieval heads read only the final-layer () stream representations. (left) Single-stream: the standard ModernBERT encoder, with a single residual stream read by both the sparse and dense retrieval heads. (middle) Non-specialized mHC: the residual stream is expanded into parallel streams with learned cross-stream routing. Both retrieval heads operate on the mean-pooled representation obtained from all streams, so the sparse and dense objectives jointly optimize the same stream representation. (right) Objective-specialized mHC: the sparse and dense heads instead read disjoint sets of final-layer streams, so each objective selectively trains its assigned stream(s). For clarity the schematic depicts streams; we study both and in our experiments.
We consider three configurations that differ only in which streams are read by the retrieval heads. In the objective-specialized configuration (), and : the sparse and dense retrieval heads read disjoint stream groups, allocating the first half of the streams exclusively to the sparse objective and the second half to the dense objective. This decouples task readouts at the output layer while mHC routing maintains inter-stream coupling throughout the encoder stack. In the non-specialized configuration (), : both retrieval heads read the mean-pooled representation across all streams, forcing both objectives to jointly optimize a shared representation space. Finally, in the single-stream configuration (), : with a single stream, there is no cross-stream routing and the encoder is exactly the original ModernBERT model, providing the dedicated single-objective reference points.
3.3 Training Setup
Training data.
We fine-tune all models on the Natural Questions (NQ) Kwiatkowski et al. (2019) dataset. We use the first k training pairs for fine-tuning and reserve the remaining pairs as a validation set for checkpoint selection. Queries and passages are truncated to and tokens, respectively.
Dense and sparse objectives.
We optimize both sparse and dense representations using a contrastive retrieval loss (van den Oord et al., 2019) with in-batch negatives. Let denote the relevance score between query and document for retrieval type . For a batch of query–positive pairs, the per-objective loss is
where and are fixed temperature hyperparameters and is the batch document collection. Thus, for each query , its paired passage is treated as the positive, while the remaining passages in the batch serve as in-batch negatives.
Combined training loss.
The multi-objective models are trained on the sum of the two objectives,
where sets the weight of the sparse objective relative to the dense one. Single-objective baselines use only the corresponding term. In the specialized model, and are computed from disjoint streams (Section 3.2), so each term supervises its own set of streams.
Training parameters.
All model variants are fine-tuned using identical optimization setups: the Adam optimizer (Kingma and Ba, 2017) with no weight decay, a linear warmup-and-decay learning-rate schedule with a warmup phase, gradient clipping at a maximum norm of , and bfloat16 mixed precision. Each model is trained for an epoch on two NVIDIA H100 GPUs. We evaluate checkpoints every steps on the held-out NQ validation set and select the checkpoint with the highest mean triplet accuracy across the two retrieval heads. For each objective , triplet accuracy is the fraction of validation triplets satisfying . To ensure a fair comparison, all model families are optimized over the same hyperparameter grid: learning rate , dense loss temperatures , sparse loss temperatures , sparse loss weight , and batch size .
Inference and Hybrid Fusion.
At inference, the dense and sparse heads act as independent retrievers: each scores candidates via (Eq. 1) within its own feature space and returns its top- candidates. We fuse the two rankings with a score-based combination over the union of candidates (Chen et al., 2024):
where and if is outside head ’s top- candidates. The endpoints recover single-head retrieval (: pure sparse; : pure dense). We evaluate performance across the full continuum (Section 4).
4 Objective-Specialized Residual Streams
Model ArguAna C-FEVER DBPedia FEVER FiQA HotpotQA NFC NQ Quora SciDocs SciF TREC-C Touché Avg Sparse-only 0.3943 0.1052 0.1484 0.6384 0.1953 0.5895 0.2219 0.1600 0.6722 0.1119 0.6492 0.5381 0.2372 0.3585 Dense-only 0.3974 0.2116 0.2702 0.5049 0.2373 0.3797 0.2460 0.4569 0.8479 0.1328 0.5513 0.6784 0.2201 0.3950 Sparse+Dense 0.3833 0.2217 0.2552 0.6525 0.2649 0.5678 0.2611 0.4110 0.8274 0.1310 0.6707 0.6990 0.2643 0.4315 mHC no-spec 0.3827 0.2132 0.2579 0.6529 0.2718 0.5696 0.2708 0.4079 0.8229 0.1346 0.6709 0.6843 0.2634 0.4310 mHC spec 0.4278 0.2394 0.2919 0.6294 0.2885 0.5226 0.2767 0.4681 0.8483 0.1535 0.6672 0.7585 0.2598 0.4486 mHC no-spec 0.4068 0.2304 0.2584 0.6671 0.2752 0.5716 0.2694 0.4154 0.8301 0.1366 0.6751 0.7280 0.2688 0.4410 mHC spec 0.4287 0.2419 0.2991 0.6385 0.2872 0.5226 0.2848 0.4757 0.8516 0.1520 0.6689 0.7692 0.2676 0.4529
Table 1: BEIR nDCG@10 across all 13 datasets using ModernBERT-base. Sparse-only and Dense-only are evaluated in their native retrieval mode; Sparse+Dense and the mHC models are hybrid retrievers fused at , the shared empirical optimum across all multi-objective models. Underline marks the best score within each stream count ; bold marks the best score for that dataset across all configurations. The advantage of objective specialization is not confined to the aggregate score; it extends to a majority of individual datasets and holds at both and . Excluding the in-domain NQ dataset, mHC+spec still improves over mHC no-spec on the remaining 12 datasets ( at ; at ). Results reported here are mean over two seeds. Per seed variation is provided in Appendix 5. Results with ModernBERT-large (Table 4) show the same trend: mHC+spec improves over mHC no-spec at both and , indicating that the benefit of objective specialization is robust to model scale rather than specific to a single model size.
To address RQ1, we ask whether mHC residual streams can specialize to distinct learning objectives while improving multi-objective retrieval. We compare objective-specialized mHC (mHC+spec) against three baselines: (1) dedicated single-objective models, which provide single-task reference points; (2) a standard non-mHC joint model (Sparse+Dense), which combines the two objectives within a conventional single residual stream; and (3) a non-specialized mHC model (mHC no-spec), in which both retrieval heads read the pooled mHC streams. The third comparison is the key ablation: mHC no-spec and mHC+spec use the same architecture, training data, and optimization budget, differing only in whether the objectives are assigned to distinct streams. We evaluate both and streams. We evaluate our system on 13 BEIR datasets Thakur et al. (2021) and report results averaged over two training seeds.
4.1 Specialization improves retrieval across fusion weights
Because the multi-objective models produce both sparse and dense representations, we evaluate retrieval across the full sparse–dense fusion range using the score fusion defined in Eq. 4, from pure sparse () to pure dense (). Figure 2 reports average BEIR nDCG@10 across this sweep.
Figure 2: Average BEIR nDCG@10 as a function of the fusion weight , for ModernBERT-base (left) and ModernBERT-large (right); both mean over two seeds. and correspond to pure sparse and pure dense retrieval, respectively. Color encodes objective specialization (red: specialized, blue: non-specialized); Sparse+Dense (, grey) has no stream routing. Specialized models (red) dominate at every for both stream counts and at both base/large model scales.
The results show three findings. First, at the base scale, four-stream mHC models outperform the conventional Sparse+Dense model, while the two-stream models are comparable. This comparison is secondary, since mHC introduces additional stream-specific parameters and routing capacity. Second, and more importantly, mHC+spec consistently outperforms mHC no-spec at every fusion weight for both and ; Figure 2 shows that this also holds at a larger model scale (ModernBERT-large). At and the base scale, specialization improves average nDCG@10 from to with two streams and from to with four streams (ModernBERT-large: and , respectively). Thus, the improvement is not explained simply by the additional capacity of mHC, but by how that capacity is organized across objectives. Third, the specialization benefit persists across the full sparse–dense fusion range rather than depending on a particular operating point, at both model scales.
All five multi-objective models achieve their best average score at at both scales, which we use for the per-dataset analysis below. At the base scale, increasing the number of streams also improves both specialized and non-specialized mHC, indicating complementary benefits from additional stream capacity and objective specialization.
4.2 Per-dataset multi-objective retrieval
Table 1 reports seed-averaged nDCG@10 on all BEIR datasets at using ModernBERT-base; the corresponding per-dataset results for ModernBERT-large are reported in Appendix C. The advantage of objective specialization is not confined to the aggregate score: mHC+spec improves over mHC no-spec on of the datasets. The improvements are not universal, and the exceptions are the same across stream counts: on FEVER, HotpotQA, SciFact, and Webis-Touché2020.
5 How specialization reshapes the streams
Figure 3: Four depth-resolved specialization probes at the final checkpoint, for (top) and (bottom) streams (lines are the mean and shaded bands standard deviation over 4 seeds; flat layers – omitted). From left: stream cosine similarity, residual-mixing identity retention , per-objective gradient share on the assigned stream(s), and read/write gate shift. Red: specialized; blue: non-specialized control. Solid vs. dashed distinguishes the two objectives / gates / stream-pair types (legends). Metrics are defined and discussed in Section 5.
Since the specialized and non-specialized models have the same architecture and capacity, their performance difference raises a more specific question: how does assigning different objectives to the streams change the internal computation? We therefore ask whether, where, and how the two models diverge internally (RQ2). The models share the same architecture, training data, and optimization budget and differ only in whether or not the retrieval heads read disjoint stream groups, allowing us to attribute systematic internal differences to objective specialization.
We examine four complementary signals across encoder depth at the final checkpoint: (1) stream cosine similarity, which measures whether the stream representations diverge; (2) residual mixing, which measures how strongly information is exchanged between streams; (3) objective-specific gradient flow, which measures whether each objective preferentially trains its assigned stream; and (4) read and write gate shifts, which reveal how routing in MLP and attention submodules change to support this specialization. All curves are means over four seeds; the lower layers () are flat across probes and are omitted. Figure 3 summarizes the four depth-resolved probes, measured at the MLP sublayers. The corresponding results for the attention sublayers for residual mixing and read/write gates are provided in Appendix B.
Representational divergence.
We first ask whether objective specialization produces different stream representations. At each layer, we compute the cosine similarity between token-averaged stream states. The non-specialized models remain highly similar across streams, whereas the specialized models increasingly separate streams assigned to different objectives in the final layers. With two streams, cosine similarity falls to at layer 21; with four streams, streams assigned to the same objective remain nearly identical (), while cross-objective pairs diverge () (Figure 3). Thus, specialization organizes the streams into objective-specific groups rather than simply replicating the same representation across all streams.
Reduced residual mixing.
We next ask whether the streams remain strongly coupled through the residual mixing matrix as their representations diverge. We measure the mean diagonal of the doubly stochastic matrix , where values near indicate that approaches the identity and cross-stream mixing is reduced. In the specialized model, increases sharply in the final layers, approaching for and reaching for ; the non-specialized model remains near its initialization value ( for , for ) throughout. Thus, representational divergence is accompanied by a marked reduction in cross-stream mixing in the specialized model. Section 5.1 tests whether this reduction is needed for the specialization benefit.
Objective-specific gradient flow.
We next ask whether representational divergence is accompanied by objective-specific training signals. For each objective , we back-propagate its loss separately and measure the gradient magnitude it delivers to each stream, , at layer :
We report the assigned-stream share, , where is the set of streams assigned to objective (for , and ; for , and ). A value near indicates that the objective trains all streams equally, whereas a value near indicates concentration on its assigned stream. In the specialized model, both objectives increasingly concentrate their gradients on their assigned streams in the upper layers. The sparse objective localizes earlier and more sharply, while the dense objective remains more distributed until the final layers. For the non-specialized control no retrieval head reads a designated subset of streams, so no stream is intrinsically tied to an objective. We nonetheless evaluate the probe using the same index sets that specialization would impose, treating the partition as a fixed measurement convention rather than a property of the model. Because nothing links either objective to those streams, each objective’s gradient spreads evenly across all streams and the share stays near throughout depth. This flat profile is the appropriate null reference: it is exactly what the probe returns when the stream partition carries no objective-specific information, so that any departure from it in the specialized model reflects specialization rather than a property of the metric.
Read/write gate specialization.
Finally, we examine how the MLP routing reorganizes to support this objective-specific processing. Recall that at each layer the read gate emits a vector of per-stream read weights and the write gate a vector of per-stream write weights (Section 3). For a gate we define its sparse-stream share as the fraction of its total mass placed on the stream(s) assigned to the sparse objective,
which for reduces to the weight on the single sparse-assigned stream. Because our initialization places a small amount of random mass on each stream, we report the change in this share from initialization to the final checkpoint, , where denotes the final training step. This is the quantity plotted in Figure 3. A positive means the gate (read or write) moves mass toward the sparse-assigned stream, a negative value toward the dense-assigned stream.
In the specialized models, this pattern holds for both and : the read gate increases its sparse-stream share () while the write gate decreases it (). Since both gates start near an even split, the MLP ends up reading predominantly from the sparse-assigned streams and writing predominantly to the dense-assigned streams. The non-specialized controls show essentially no shift in either gate ().
Taken together, the four probes reveal a consistent depth-dependent pattern. The specialized and non-specialized models remain similar through most of the network, but diverge in the final layers: streams assigned to different objectives become more distinct, objective-specific gradients concentrate on their assigned streams, the gates develop a directional read/write pattern (preferentially reading from sparse-assigned streams and writing to dense-assigned streams), and residual mixing decreases. The results therefore connect the downstream benefit of objective specialization to a concrete change in the internal computation of mHC rather than to a difference in capacity alone.
5.1 Read/write routing, not mixing, drives the specialization benefit
| Model | Mixing | nDCG@10 () |
|---|---|---|
| mHC no-spec | learned | |
| mHC spec | learned | |
| mHC no-spec | identity | |
| mHC spec | identity |
Table 2: Fixing the residual-mixing matrix to the identity ( at every layer). ModernBERT-base, , average BEIR nDCG@10 over 13 datasets at ; mean standard deviation over two seeds.
Specialization drives the residual-mixing matrix toward the identity in the final layers. This suggests a hypothesis: the specialization benefit stems from the objective-specific read/write routing rather than from learned cross-stream mixing. To test it, we fix at every layer, so that each stream is carried forward unmixed and streams interact only through the read and write gates, and retrain both the specialized and non-specialized models with (Table 2). Fixing the mixing to the identity changes average nDCG@10 by less than the variation across seeds, and this holds with or without specialization: mHC no-spec scores with learned and with identity mixing, and mHC+spec scores and , respectively. Crucially, the specialization gain is preserved ( with learned mixing, with identity mixing), well beyond the seed-to-seed standard deviation. These results support the hypothesis: learned cross-stream mixing is not required for the specialization benefit, which instead stems from the objective-specific read/write routing.
6 Conclusion
We studied whether mHC residual streams can be assigned distinct learning objectives, using sparse and dense retrieval as a testbed. Specialization consistently improves retrieval over non-specialized mHC models of identical capacity, training data, and optimization budget, across the full sparse–dense fusion range and for both and streams, and this holds at both ModernBERT-base and ModernBERT-large scales. The specialized models also improve over the conventional single-stream joint retriever, with the model achieving the best BEIR score at both scales.
Our analyses further show that specialization emerges primarily in the final layers. There, stream representations diverge, objective-specific gradients concentrate on assigned streams, the MLP gates develop a read-from-sparse / write-to-dense pattern, and residual mixing moves toward the identity. At , streams assigned to the same objective remain similar, forming two coherent objective groups. Fixing the residual mixing to the identity leaves the specialization benefit intact, indicating that it stems from the objective-specific read/write routing rather than from learned cross-stream mixing. Together, these results show that assigning distinct objectives to mHC streams can both improve downstream performance and induce structured, depth-localized specialization within the streams.
Limitations
Objective diversity.
We study a single pair of objectives—lexical (sparse) and semantic (dense) retrieval—chosen because they are related but distinct. We do not systematically vary the degree of objective divergence, and therefore cannot determine how specialization changes as objectives become more similar, complementary, or conflicting.
Task scope.
Our experiments cover only two scales (ModernBERT-base and ModernBERT-base) with streams, and encoder-based retrieval. We therefore do not establish whether the observed performance gains or late-layer specialization patterns extend to other model scales, other numbers of streams or objectives, or decoder-based and generative tasks.
Equal allocation of stream capacity across objectives.
In our specialized mHC models, we allocated an equal number of streams to the sparse and dense objectives. We leave the effect of asymmetric stream allocation on downstream performance to future work.
References
E. Alimaskina, G. Molodtsov, and A. Beznosikov Analyzing stream collapse in hyper-connections: from diagnosis to mitigation. External Links: 2606.03483, Link Cited by: §2.1.
R. Caruana Multitask learning. Machine Learning 28, pp. 41–75. External Links: Link Cited by: §1, §2.2.
J. Chen, S. Xiao, P. Zhang, K. Luo, D. Lian, and Z. Liu M3-embedding: multi-linguality, multi-functionality, multi-granularity text embeddings through self-knowledge distillation. In Findings of the Association for Computational Linguistics: ACL 2024, L. Ku, A. Martins, and V. Srikumar (Eds.), Bangkok, Thailand, pp. 2318–2335. External Links: Link, Document Cited by: §2.3, §3.2, §3.3.
M. Crawshaw Multi-task learning with deep neural networks: a survey. External Links: 2009.09796, Link Cited by: §2.2.
T. Formal, C. Lassance, B. Piwowarski, and S. Clinchant SPLADE v2: sparse lexical and expansion model for information retrieval. External Links: 2109.10086, Link Cited by: §2.3.
S. Gupta, S. Mukherjee, K. Subudhi, E. Gonzalez, D. Jose, A. H. Awadallah, and J. Gao Sparsely activated mixture-of-experts are robust multi-task learners. External Links: 2204.07689, Link Cited by: §2.2.
D. P. Kingma and J. Ba Adam: a method for stochastic optimization. External Links: 1412.6980, Link Cited by: §3.3.
T. Kwiatkowski, J. Palomaki, O. Redfield, M. Collins, A. Parikh, C. Alberti, D. Epstein, I. Polosukhin, J. Devlin, K. Lee, K. Toutanova, L. Jones, M. Kelcey, M. Chang, A. M. Dai, J. Uszkoreit, Q. Le, and S. Petrov Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics 7, pp. 452–466. External Links: Link, Document Cited by: §3.3.
D. Lee, S. Hwang, K. Lee, S. Choi, and S. Park On complementarity objectives for hybrid retrieval. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), A. Rogers, J. Boyd-Graber, and N. Okazaki (Eds.), Toronto, Canada, pp. 13357–13368. External Links: Link, Document Cited by: §1, §2.3.
J. Lin and X. Ma A few brief notes on deepimpact, coil, and a conceptual framework for information retrieval techniques. External Links: 2106.14807, Link Cited by: §3.2.
S. Lin and J. Lin A dense representation framework for lexical and semantic matching. External Links: 2206.09912, Link Cited by: §1, §2.3.
X. Liu, P. He, W. Chen, and J. Gao Improving multi-task deep neural networks via knowledge distillation for natural language understanding. External Links: 1904.09482, Link Cited by: §1.
J. Ma, Z. Zhao, X. Yi, J. Chen, L. Hong, and E. H. Chi Modeling task relationships in multi-task learning with multi-gate mixture-of-experts. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’18, New York, NY, USA, pp. 1930–1939. External Links: ISBN 9781450355520, Link, Document Cited by: §2.2.
S. Mishra MHC-gnn: manifold-constrained hyper-connections for graph neural networks. External Links: 2601.02451, Link Cited by: §1.
I. Misra, A. Shrivastava, A. Gupta, and M. Hebert Cross-stitch networks for multi-task learning. External Links: 1604.03539, Link Cited by: §1, §2.2.
V. Oldenburg, F. de Kam, B. Zuijdam, L. Eberson, N. van Zutphen, S. de Wildt, I. Verhoeven, and C. Snoek Manifold-constrained hyper-connections for parameter-efficient finetuning. External Links: 2607.18130, Link Cited by: Appendix A, §1, §2.4.
R. Sinkhorn and P. Knopp Concerning nonnegative matrices and doubly stochastic matrices. Pacific Journal of Mathematics 21, pp. 343–348. External Links: Link Cited by: §2.1, §3.1.
T. Sun, Y. Shao, X. Li, P. Liu, H. Yan, X. Qiu, and X. Huang Learning sparse sharing architectures for multiple tasks. External Links: 1911.05034, Link Cited by: §1.
N. Thakur, N. Reimers, A. Rücklé, A. Srivastava, and I. Gurevych BEIR: a heterogenous benchmark for zero-shot evaluation of information retrieval models. External Links: 2104.08663, Link Cited by: §1, §4.
A. van den Oord, Y. Li, and O. Vinyals Representation learning with contrastive predictive coding. External Links: 1807.03748, Link Cited by: §3.3.
B. Warner, A. Chaffin, B. Clavié, O. Weller, O. Hallström, S. Taghadouini, A. Gallagher, R. Biswas, F. Ladhak, T. Aarsen, N. Cooper, G. Adams, J. Howard, and I. Poli Smarter, better, faster, longer: a modern bidirectional encoder for fast, memory efficient, and long context finetuning and inference. External Links: 2412.13663, Link Cited by: §1, §3.2.
Z. Xie, Y. Wei, H. Cao, C. Zhao, C. Deng, J. Li, D. Dai, H. Gao, J. Chang, 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. External Links: 2512.24880, Link Cited by: §1, §2.1, §3.1, §3.1, §3.1.
P. Zhao, X. Li, X. Yu, W. Guo, and Z. Dong How does mhc use its residual streams? selective routing and near-identity mixing. External Links: 2609.05309, Link Cited by: §2.1.
D. Zhu, H. Huang, Z. Huang, Y. Zeng, Y. Mao, B. Wu, Q. Min, and X. Zhou Hyper-connections. ArXiv abs/2409.19606. External Links: Link Cited by: §1, §2.1, §3.1.
Appendix A mHC routing parameter initialization
For initialization choices, we follow prior work on retrofitting pretrained Transformers with mHC (Oldenburg et al., 2026). Each mHC block is initialized so that, at the start of fine-tuning, its routing is static (independent of the input token’s stream representations) and the block behaves like an ordinary residual sublayer (Section 3.1). The projection weights for all three routing components are zero-initialized (), so each gate is determined solely by its bias. The input-dependent routing is therefore inactive at initialization and is introduced gradually as the projection weights and the scalar gains (which scale the dynamic term before the bias is added) are learned; the gains are initialized to a small value, . The remaining biases make the block reduce, at initialization, to an ordinary residual sublayer .
Write bias: The write gate initializes , giving unit gates since . So, the sublayer (MLP/attention) output is written equally to all the streams.
Residual-mixing bias. We set to an identity-patterned logit (diagonal entries , off-diagonal ). Sinkhorn normalization turns this into a doubly-stochastic matrix with diagonal and off-diagonals ( for , and for ); the diagonal is larger than each off-diagonal by the constant factor . These exact values are immaterial at initialization: because all streams hold identical copies of the pretrained hidden state, the residual mix returns that shared value for any row-stochastic , which Sinkhorn guarantees. The identity-patterned bias therefore does not alter the function at initialization. A uniform would likewise preserve the pretrained function.
Read gate: The read-gate bias is used to break the symmetry among streams. We use the same uniform-noisy scheme for both the specialized and non-specialized models: each stream is initialized to read approximately equally, with target at every layer, perturbed by small per-stream Gaussian noise on the logits (), after which the biases are renormalized so that exactly—keeping the stream aggregation a convex combination (and hence function-preserving) at initialization. We deliberately apply the identical initialization to both conditions so that the only difference between them is whether the retrieval heads read disjoint streams (specialized) or the pooled streams (non-specialized), removing initialization as a confound.
All Sinkhorn normalizations use iterations and . The exact values are reported in Table 3.
Finally, the mHC routing parameters are optimized with a separate, higher learning rate than the rest of the network. During fine-tuning we place all routing parameters—the three projections, their scalar gains, and the block’s RMSNorm—in their own Adam parameter group at learning rate , while the ModernBERT backbone and the retrieval heads train at the base learning rate. This lets the small, randomly perturbed routing parameters adapt quickly enough to develop specialization within a single fine-tuning epoch without destabilizing the pretrained backbone.
Table 3: Initialization of each mHC block. Projection weights are zero-initialized so routing starts static; the biases place the block near an identity residual layer. The read-gate bias uses the uniform-noisy scheme (target plus noise , , renormalized to sum to one) for both specialized and non-specialized models. At initialization this yields read gate (summing to ), write gate , and a doubly-stochastic mixing matrix with its largest mass on the diagonal.
| Parameter | Shape | Initialization |
|---|---|---|
| , renorm. | ||
| diag , off-diag | ||
| RMSNorm |
Appendix B How specialization reshapes the streams (attention sublayer)
Figure 4: Attention-sublayer routing probes at the final checkpoint (lines are the mean and shaded bands standard deviation over 4 seeds; flat layers – omitted). Left pair: ; right pair: . Within each pair: mean diagonal of the residual-mixing matrix , and the shift in each gate’s sparse-stream share (read gate solid, write gate dashed). Red: specialized; blue: non-specialized control. Like the MLP sublayer, attention drives toward the identity under specialization; unlike the MLP, its read gate does not shift () while its write gate moves strongly toward the dense-assigned stream(s) (), i.e. attention specializes its write but not its read. Metrics defined in Section 5.
Section 5 reports the routing probes for the MLP sublayer; here we provide the corresponding residual-mixing and read/write gate probes for the attention sublayer.
Figure 4 shows that attention mirrors the MLP in the residual-mixing gate: under specialization, moves toward the identity in the top layers (mean diagonal at and at , versus and for the non-specialized control). The gate behavior, however, differs from the MLP counterpart. Whereas the MLP shifts its read gate toward the sparse stream and its write gate toward the dense stream, attention leaves its read gate essentially unchanged () and moves only its write gate—strongly—toward the dense-assigned stream(s) ( at and at ). Attention therefore specializes by routing its write rather than its read: it keeps reading from all streams but commits its output predominantly to the dense streams.
As in the main text, these patterns are consistent across both stream counts and all four seeds.
Appendix C Results at a Larger Model Scale
Table 4 reports the same comparison as Table 1, using ModernBERT-large in place of ModernBERT-base. The specialization advantage reported in Section 4.2 holds at this larger scale as well.
Model ArguAna C-FEVER DBPedia FEVER FiQA HotpotQA NFC NQ Quora SciDocs SciF TREC-C Touché Avg Sparse-only 0.3967 0.0954 0.1348 0.5931 0.2133 0.5568 0.2251 0.1654 0.6761 0.1118 0.6507 0.5178 0.2307 0.3514 Dense-only 0.4110 0.2157 0.3072 0.5351 0.3103 0.4061 0.2800 0.5063 0.8562 0.1611 0.5972 0.6996 0.2205 0.4236 Sparse+Dense 0.4268 0.2204 0.2711 0.6586 0.3095 0.5838 0.2828 0.4488 0.8443 0.1398 0.6970 0.7614 0.2939 0.4568 mHC no-spec 0.4103 0.2108 0.2838 0.6698 0.3076 0.5864 0.2983 0.4546 0.8453 0.1421 0.6911 0.7621 0.2836 0.4574 mHC spec 0.4509 0.2285 0.3237 0.6353 0.3448 0.5332 0.3115 0.5182 0.8627 0.1655 0.6889 0.7534 0.2506 0.4667 mHC no-spec 0.4027 0.2001 0.2814 0.6669 0.3081 0.5887 0.2984 0.4573 0.8437 0.1358 0.6940 0.7721 0.2954 0.4573 mHC spec 0.4832 0.2389 0.3270 0.6438 0.3544 0.5447 0.3101 0.5200 0.8637 0.1628 0.6901 0.7802 0.2531 0.4748
Table 4: BEIR nDCG@10 across all 13 datasets using ModernBERT-large, mean over two seeds (42 and 1234). Sparse-only and Dense-only are evaluated in their native retrieval mode; Sparse+Dense and the mHC models are hybrid retrievers fused at . Underline marks the best score within each stream count ; bold marks the best score for that dataset across all configurations.
Appendix D Per-Seed Results
Table 5 and Table 6 reports BEIR nDCG@10 for each of the two training seeds separately, across all 13 datasets at fusion weight ; the two-seed means are the values reported in Table 1 and Table 4 for ModernBERT-base and ModernBERT-large respectively. The specialization gain is consistent across seeds: at both and and at both scales: ModernBERT-base and ModernBERT-large.
Model Seed ArguAna C-FEVER DBPedia FEVER FiQA HotpotQA NFC NQ Quora SciDocs SciF TREC-C Touché Avg Sparse-only 42 0.4038 0.1040 0.1504 0.6151 0.1998 0.5857 0.2238 0.1637 0.6823 0.1134 0.6555 0.5704 0.2269 0.3611 1234 0.3849 0.1064 0.1463 0.6617 0.1908 0.5932 0.2200 0.1562 0.6620 0.1105 0.6428 0.5057 0.2476 0.3560 Dense-only 42 0.3946 0.2119 0.2690 0.5025 0.2419 0.3785 0.2529 0.4606 0.8488 0.1315 0.5600 0.6725 0.2214 0.3959 1001 0.4003 0.2112 0.2715 0.5072 0.2326 0.3808 0.2392 0.4532 0.8471 0.1341 0.5426 0.6843 0.2187 0.3941 Sparse+Dense 42 0.3944 0.2022 0.2581 0.6382 0.2676 0.5657 0.2622 0.4047 0.8289 0.1309 0.6622 0.6797 0.2615 0.4274 1234 0.3723 0.2412 0.2523 0.6669 0.2622 0.5700 0.2601 0.4173 0.8258 0.1311 0.6793 0.7184 0.2671 0.4357 mHC no-spec 42 0.3834 0.2054 0.2605 0.6465 0.2744 0.5744 0.2697 0.4127 0.8253 0.1352 0.6731 0.7084 0.2576 0.4328 1234 0.3819 0.2211 0.2553 0.6593 0.2693 0.5648 0.2719 0.4030 0.8205 0.1339 0.6688 0.6601 0.2692 0.4292 mHC spec 42 0.4130 0.2329 0.2907 0.6248 0.2883 0.5243 0.2801 0.4676 0.8472 0.1510 0.6755 0.7726 0.2513 0.4476 1234 0.4427 0.2459 0.2931 0.6340 0.2887 0.5209 0.2732 0.4685 0.8494 0.1560 0.6589 0.7444 0.2682 0.4495 mHC no-spec 42 0.4183 0.2237 0.2586 0.6537 0.2738 0.5733 0.2677 0.4196 0.8294 0.1384 0.6743 0.7772 0.2548 0.4433 1234 0.3954 0.2371 0.2582 0.6805 0.2766 0.5698 0.2712 0.4112 0.8308 0.1348 0.6759 0.6789 0.2827 0.4387 mHC spec 42 0.4411 0.2356 0.2980 0.6270 0.2868 0.5210 0.2821 0.4726 0.8511 0.1549 0.6591 0.7765 0.2568 0.4510 1234 0.4164 0.2482 0.3002 0.6501 0.2876 0.5242 0.2874 0.4788 0.8520 0.1490 0.6787 0.7619 0.2785 0.4548
Table 5: Per-seed BEIR nDCG@10 across all 13 datasets (hybrid fusion at ) for ModernBERT-base.
Model Seed ArguAna C-FEVER DBPedia FEVER FiQA HotpotQA NFC NQ Quora SciDocs SciF TREC-C Touché Avg Sparse-only 42 0.4111 0.0981 0.1326 0.5833 0.2124 0.5491 0.2278 0.1701 0.6799 0.1143 0.6582 0.5424 0.2262 0.3543 1234 0.3822 0.0926 0.1371 0.6028 0.2142 0.5644 0.2223 0.1608 0.6722 0.1092 0.6433 0.4932 0.2351 0.3484 Dense-only 42 0.4107 0.2158 0.3080 0.5403 0.3078 0.4052 0.2777 0.5047 0.8563 0.1606 0.5944 0.7053 0.2233 0.4239 1234 0.4112 0.2156 0.3063 0.5299 0.3127 0.4070 0.2823 0.5079 0.8562 0.1616 0.5999 0.6938 0.2178 0.4232 Sparse+Dense 42 0.4291 0.2133 0.2670 0.6538 0.3027 0.5829 0.2872 0.4477 0.8459 0.1391 0.7031 0.7472 0.2915 0.4547 1234 0.4245 0.2275 0.2751 0.6634 0.3163 0.5848 0.2783 0.4500 0.8427 0.1405 0.6909 0.7756 0.2963 0.4589 mHC no-spec 42 0.3971 0.2038 0.2833 0.6553 0.3044 0.5937 0.2932 0.4537 0.8459 0.1389 0.6843 0.7649 0.2830 0.4540 1234 0.4234 0.2178 0.2842 0.6842 0.3109 0.5791 0.3033 0.4554 0.8447 0.1454 0.6979 0.7593 0.2843 0.4608 mHC spec 42 0.4417 0.2375 0.3270 0.6416 0.3464 0.5386 0.3099 0.5229 0.8626 0.1646 0.6845 0.7676 0.2593 0.4696 1234 0.4602 0.2195 0.3205 0.6290 0.3432 0.5277 0.3131 0.5135 0.8627 0.1664 0.6934 0.7393 0.2420 0.4639 mHC no-spec 42 0.4103 0.2011 0.2815 0.6683 0.2958 0.5877 0.2997 0.4519 0.8412 0.1358 0.6894 0.7717 0.2880 0.4556 1234 0.3950 0.1992 0.2813 0.6655 0.3204 0.5898 0.2970 0.4627 0.8462 0.1359 0.6986 0.7725 0.3029 0.4590 mHC spec 42 0.4805 0.2372 0.3268 0.6467 0.3526 0.5494 0.3079 0.5125 0.8621 0.1632 0.6870 0.7747 0.2526 0.4733 1234 0.4859 0.2406 0.3273 0.6408 0.3562 0.5400 0.3123 0.5276 0.8652 0.1625 0.6932 0.7856 0.2536 0.4762
Table 6: Per-seed BEIR nDCG@10 across all 13 datasets using ModernBERT-large, for each model and training seed. Sparse-only and Dense-only are evaluated in their native retrieval mode; the remaining models are hybrid retrievers fused at . The two-seed means are the values reported in Table 4. As at the base scale, the specialization gain holds within each seed: at both and , mHC+spec exceeds mHC no-spec in every seed.