Latent Merger: Latent-Space Composition of Hypernetwork-Generated LoRAs

Yanlai Yang1, Minki Kang2, Divyam Madaan1, Sung Ju Hwang2,3, and Mengye Ren1

1New York University, 2KAIST, 3DeepAuto.ai

NeurIPS 2026

TL;DR: Merge document knowledge in hypernetwork latent space, then decode a single fixed-rank LoRA adapter.

Abstract

Recent work proposes hypernetworks that convert a document into a low-rank parameter update (LoRA) in a single forward pass, enabling fast injection of new knowledge into a frozen LLM. However, storing separate LoRA adapters for each document can be unsustainable in streaming settings. In this paper, we study the problem of composing hypernetwork-generated LoRAs using two representative systems, Doc-to-LoRA and SHINE. We show that hypernetwork-generated LoRAs have a geometry sharply different from directly fine-tuned LoRAs. They exhibit greater spectral concentration and stronger cross-document alignment than next-token prediction and QA fine-tuned adapters, which are diffuse and nearly orthogonal across documents. Guided by this observation, we propose latent-space LoRA merging. We compose the intermediate hypernetwork latents and then decode the merged latent through the frozen LoRA-generation head. We show that latent-space merging techniques consistently improve over weight-space and factor-space baselines while preserving a single fixed-rank adapter. These results support latent-space composition as a promising mechanism for combining hypernetwork-generated LoRAs under a fixed output-rank budget.

Motivation

Hypernetworks such as Doc-to-LoRA (D2L) and SHINE turn a document into a LoRA adapter in a single forward pass, letting a frozen language model absorb new text without per-document fine-tuning. But keeping one adapter per document makes storage grow with the stream. Concatenating their low-rank factors also increases the output rank. Can we combine many documents into one adapter at the original rank?

Generated adapters are not the endpoints of independent fine-tuning runs: a shared generator decodes each one from an intermediate latent. We therefore combine the document latents before decoding the weights, then decode once.

Geometry

Do generated adapters behave like directly fine-tuned LoRAs? We compare D2L on Gemma-2-2B-it and SHINE on Qwen3-8B with LoRAs fine-tuned on the same 500 SQuAD validation passages and corresponding backbones, using next-token prediction (NTP-FT) or QA supervised fine-tuning (QA-SFT).

Figure 1. Pairwise distances between unit-Frobenius-normalized adapters, embedded in 2-D using metric MDS. Directly fine-tuned adapters form broad shells; generated adapters occupy compact regions, especially for SHINE. The embedding provides a qualitative view.
Figure 1. Pairwise distances between unit-Frobenius-normalized adapters, embedded in 2-D using metric MDS. Directly fine-tuned adapters form broad shells; generated adapters occupy compact regions, especially for SHINE. The embedding provides a qualitative view.
Figure 2. Cumulative uncentered spectral energy against the number of leading components. Generated adapters concentrate their energy in fewer directions. SHINE's leading component alone captures 88.8%.
Figure 2. Cumulative uncentered spectral energy against the number of leading components. Generated adapters concentrate their energy in fewer directions. SHINE's leading component alone captures 88.8%.

The leading component captures 15.5% of D2L's spectral energy, versus 0.6% (NTP-FT) and 1.5% (QA-SFT) on its backbone. For SHINE, it captures 88.8%, versus 0.2% and 2.6%. Cross-document alignment is also stronger: after unit-norm normalization, mean pairwise cosine similarity is +0.144 for D2L and +0.888 for SHINE, compared with at most +0.025 for the directly fine-tuned adapters.

This shared structure, together with a common decoder, motivates testing the generator's latent space as a place to combine document knowledge.

Method

Figure 3. Latent Merger overview. A shared frozen hypernetwork encoder produces document latents. The trainable merger combines their mean with a gated, permutation-invariant residual; a frozen LoRA-generation head decodes one rank-r adapter for the frozen language model. The inset is schematic; projection and RMS-matching details are described below.
Figure 3. Latent Merger overview. A shared frozen hypernetwork encoder produces document latents. The trainable merger combines their mean with a gated, permutation-invariant residual; a frozen LoRA-generation head decodes one rank-r adapter for the frozen language model. The inset is schematic; projection and RMS-matching details are described below.

Latent Merger treats the document latents as an unordered set. At each latent position, a small transformer mixes information across documents without positional embeddings, then mean-pools the result. It adds a gated, RMS-matched residual to the plain latent average. The output projection starts at zero, so training begins at latent averaging. The composition is permutation invariant by construction.

  • One fixed-rank adapter: the frozen LoRA-generation head decodes the merged latent at the generator's original rank, regardless of the number of documents.
  • Only the merger is trained: the language model, hypernetwork encoder, and generation head stay frozen. A separate merger is trained for each generator checkpoint.
  • Trained on SQuAD tuples: the merger sees tuples of 2–5 training passages. We study both KL distillation from per-document adapters and cross-entropy on gold answers.

We evaluate the approach with D2L on Gemma-2-2B-it and SHINE on Qwen3-8B.

Results

We evaluate on SQuAD validation and MS MARCO, which is out of distribution for the SQuAD-trained merger. Each method produces one adapter per tuple of N passages. The model answers every question in that tuple using the same adapter, without the passages in its prompt. This tests per-document knowledge retention, not reasoning that combines facts across documents.

Tables 1 and 2 report token-overlap F1 × 100 (mean ± 95% confidence interval) for representative methods. These are not all asserted to have the same output rank. N = 10 exceeds the training tuple sizes. SVD denotes a rank-r approximation of the average weight update. Full results, including rank-concatenation and TIES baselines, appear in Tables 3–4 of the paper.

For context, using each question's own unmerged adapter scores 66.8 / 42.2 on SQuAD / MS MARCO for D2L and 56.8 / 38.1 for SHINE. Merging therefore still loses substantial information, particularly as N grows.

Table 1. Doc-to-LoRA, Gemma-2-2B-it. Token-overlap F1 × 100, mean ± 95% CI, for N documents merged into one adapter. Bold: best among the methods shown.
SQuADMS MARCO
MethodN = 2N = 5N = 10N = 2N = 5N = 10
Factor averaging41.2±2.719.8±2.014.8±1.629.5±3.522.4±2.119.7±1.5
SVD48.5±2.822.0±2.115.5±1.731.0±3.523.2±2.120.1±1.5
DARE18.7±2.317.0±1.917.1±1.419.2±2.919.2±1.919.5±1.7
Latent averaging47.6±2.825.2±2.518.6±1.731.3±3.523.5±2.220.7±1.5
Latent Merger (ours)50.7±2.829.8±2.521.0±1.332.0±3.723.5±2.022.2±1.7
Table 2. SHINE, Qwen3-8B. Token-overlap F1 × 100, mean ± 95% CI, for N documents merged into one adapter. Bold: best among the methods shown.
SQuADMS MARCO
MethodN = 2N = 5N = 10N = 2N = 5N = 10
Factor averaging44.7±3.129.5±3.023.7±2.626.7±3.922.1±2.020.1±1.6
SVD44.6±3.129.3±3.023.6±2.726.5±3.722.2±2.020.1±1.6
DARE31.3±4.127.5±3.123.8±2.831.8±6.727.0±3.626.0±1.4
Latent averaging45.4±3.030.6±2.823.5±2.529.5±3.622.9±2.120.9±1.5
Latent Merger (ours)50.2±4.239.8±2.830.2±2.533.5±4.027.2±2.225.8±1.8

Discussion

  • Learning improves on latent averaging, with uneven gains. Latent Merger's mean matches or exceeds latent averaging in all 12 settings shown. The largest gains are on SHINE SQuAD: 30.6 → 39.8 at N = 5 and 23.5 → 30.2 at N = 10. For D2L, gains are smaller and the confidence intervals overlap at every N on both datasets.
  • The advantage is not universal. On SHINE MS MARCO, DARE's confidence intervals overlap Latent Merger's at every N. At N = 10, their means are 26.0 and 25.8, respectively.
  • The comparison includes additional training. Latent Merger is learned; the baselines shown are training-free. This is not an equal-training-budget comparison.

Takeaway

For the two generators studied here, generated LoRAs are more aligned across documents and more spectrally concentrated than directly fine-tuned adapters. Combining their latents and decoding once offers a promising route to a single fixed-rank document memory. A learned merger improves retention over latent averaging, but scores remain below the per-document oracle and decline as more documents are combined. The evaluations focus on QA; non-QA and conflicting-source settings remain untested.

BibTeX

@inproceedings{yang2026empirical,
  title = {Latent Merger: Latent-Space Composition of Hypernetwork-Generated LoRAs},
  author = {Yang, Yanlai and Kang, Minki and Madaan, Divyam and Hwang, Sung Ju and Ren, Mengye},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
}