Test-Time Adaptive Merging (T^3)
- The paper introduces T^3 as a dynamic, test-time model merging approach that computes adaptive interpolation weights based on metrics like JS divergence and entropy minimization.
- The methodology leverages diverse adaptation techniques including scalar, vector, binary mask, and latent-space adaptations to refine model merging under distribution shifts.
- Empirical results indicate that per-sample or batch-adaptive merging improves performance in zero-shot classification, continual learning, and robustness against corruptions.
Searching arXiv for papers on test-time adaptive model merging and related methods. Test-Time Task Adaptive Merging, commonly abbreviated as , denotes a family of inference-time model-composition methods in which a merged model is not fixed once offline, but is adapted at deployment using signals available from the current test setting. In the literature summarized here, the central adaptive object may be a scalar interpolation coefficient, a task-wise or layer-wise vector of merge coefficients, a binary mask over singular directions, a router over task vectors, or an input-conditioned gate over low-rank experts. The shared premise is that static merging is often insufficient because task vectors, checkpoints, or experts interact differently across inputs, tasks, layers, and distribution shifts. Recent work therefore treats model merging not as a one-time arithmetic operation, but as a conditional decision problem driven by unlabeled test data, predictive disagreement, latent fingerprints, evidential uncertainty, or current-task seed batches (Yang et al., 2023, Lee et al., 28 Mar 2025, Yang et al., 22 May 2025, Qiu et al., 17 May 2025, Imam et al., 31 Oct 2025, Xie et al., 4 Mar 2026).
1. Definition and scope
The most direct named instance of is "T3: Test-Time Model Merging in VLMs for Zero-Shot Medical Imaging Analysis" (Imam et al., 31 Oct 2025). That work studies inference-time merging of two medical vision-LLMs: a pretrained/generalist model with parameters , and a fine-tuned/expert model with parameters . The merged parameters for input are defined as
where is computed at test time from the Jensen–Shannon divergence between the two models’ predictive distributions on that same sample (Imam et al., 31 Oct 2025). In this narrow sense, is a backpropagation-free, per-sample or per-batch adaptive parameter interpolation rule.
The broader research landscape uses the same underlying principle without always using the name 0. AdaMerging adapts task-wise or layer-wise coefficients over task vectors using entropy minimization on unlabeled test samples (Yang et al., 2023). AdaRank adapts binary masks over singular components of task vectors during test time, again using entropy minimization, thereby selecting which spectral directions should be retained in the merged model (Lee et al., 28 Mar 2025). CodeMerge computes merge coefficients for adaptation checkpoints through latent-space fingerprints and ridge leverage scores rather than direct multi-model inference (Yang et al., 22 May 2025). MINGLE adapts gates over low-rank experts using a small unlabeled seed batch from the current task in a continual setting (Qiu et al., 17 May 2025). BD-Merging trains a debiased router that allocates task-wise or layer-wise weights on a per-sample basis under distribution shift (Xie et al., 4 Mar 2026).
This suggests a useful working distinction. In a narrow usage, 1 refers to per-sample or per-batch test-time interpolation such as the medical VLM method in (Imam et al., 31 Oct 2025). In a broader usage, it denotes test-time adaptive merging more generally: methods that condition model composition on unlabeled target data or current input statistics rather than relying on a fixed offline merge. A plausible implication is that the field is converging on a common design pattern even when nomenclature differs.
2. Mathematical formulations of adaptive merging
A recurrent starting point is the shared-base model-merging setup. AdaMerging assumes a pretrained model 2 and 3 fine-tuned task models 4, defining task vectors
5
Static task arithmetic forms
6
whereas AdaMerging replaces the single global coefficient with task-wise coefficients 7,
8
or with layer-wise coefficients,
9
These coefficients are optimized at test time by minimizing Shannon entropy on unlabeled samples from the multi-task setup (Yang et al., 2023).
AdaRank begins from the same task-vector formalism but replaces scalar coefficient adaptation with adaptive selection in singular space. For task 0 and layer 1,
2
Instead of top-3 truncation, AdaRank introduces a binary mask 4, yielding
5
The mask is learned at test time by entropy minimization, with a straight-through estimator applied to an underlying continuous parameterization (Lee et al., 28 Mar 2025). This reframes test-time adaptation as structural selection over spectral components rather than only coefficient tuning.
BD-Merging takes a different route. With shared backbone 6 and task vectors 7, it predicts per-sample task weights
8
from token embeddings 9, and forms
0
The paper explicitly states that the router allocates task-specific or layer-specific weights on a per-sample basis (Xie et al., 4 Mar 2026). This is among the clearest examples of sample-adaptive parameter-space merging in the broader 1 sense.
The named 2 method in medical VLMs uses only two models, but the logic is analogous. It computes
3
then maps this to
4
and merges
5
A batch-wise extension averages coefficients across a batch,
6
and uses one parameter interpolation per batch (Imam et al., 31 Oct 2025).
3. Adaptation signals at test time
The principal distinction among 7-style methods is the signal used to infer how merging should change at inference.
AdaMerging uses entropy minimization on unlabeled test samples. For sample 8 with predicted distribution 9, the entropy is
0
and the merge coefficients are optimized to minimize the sum of these entropies over current test batches (Yang et al., 2023). The method reports an average Spearman correlation of 1 between entropy and prediction loss across the multi-task data, providing the paper’s empirical justification for entropy as a surrogate objective (Yang et al., 2023).
AdaRank uses the same general entropy-minimization principle but applies it to binary spectral masks and optionally to layerwise scaling coefficients 2. Its objective is
3
The significant shift is therefore not the adaptation signal but the adaptation space (Lee et al., 28 Mar 2025).
The medical 4 method avoids optimization entirely. Its signal is disagreement between the pretrained and expert models, quantified by Jensen–Shannon divergence. The paper argues that entropy ratio or confidence ratio fail to capture high-confidence disagreement, whereas JS divergence compares the full predictive distributions jointly (Imam et al., 31 Oct 2025). This makes the method training-free and backpropagation-free at inference.
CodeMerge adopts a latent proxy rather than output entropy or current-sample behavioral similarity. Each checkpoint 5 is associated with a fingerprint
6
derived from source-model penultimate activations. At time 7, ridge leverage scores
8
are used to select and weight checkpoints (Yang et al., 22 May 2025). The paper reports Pearson 9 and Kendall 0 between pairwise fingerprint differences and model weight differences across SparseDrive and SECOND, which is the empirical premise allowing latent-space retrieval to approximate weight-space selection (Yang et al., 22 May 2025).
BD-Merging uses evidential uncertainty and neighborhood discrepancy. A joint evidential head produces Dirichlet parameters 1, predictive probabilities 2, and uncertainty mass 3 or 4 depending on task-specific or unified-label notation (Xie et al., 4 Mar 2026). It then computes an Adjacency Discrepancy Score
5
and uses ADS to drive a discrepancy-aware contrastive objective for training a debiased router (Xie et al., 4 Mar 2026). This is a more elaborate adaptation signal than plain entropy minimization and is explicitly targeted at robustness under distribution shift.
MINGLE uses a current-task seed batch and a teacher KL objective. For current task 6, it minimizes
7
where the current task’s standalone fine-tuned model 8 serves as teacher (Qiu et al., 17 May 2025). This is a distinct test-time guidance signal: the merge is adapted not toward generic confidence but toward imitation of the current expert on unlabeled target samples.
4. Architectural variants of 9-style merging
The literature supports several distinct architectural interpretations of test-time adaptive merging.
One class performs direct parameter interpolation between complete models. The named 0 method for medical VLMs belongs here: a current coefficient 1 directly determines interpolation between 2 and 3 (Imam et al., 31 Oct 2025). This is the simplest realization and is especially suitable when the merge involves only two compatible checkpoints.
A second class adapts coefficients over task vectors derived from multiple fine-tuned models. AdaMerging is the canonical example, with task-wise or layer-wise scalar coefficients over 4 (Yang et al., 2023). BD-Merging extends this to per-sample router-predicted coefficients over task vectors or layer-specific task vectors (Xie et al., 4 Mar 2026). These methods keep the representation of expertise in the same coordinate system as standard task arithmetic.
A third class performs structural selection within task vectors. AdaRank adapts binary inclusion masks over singular components of each task vector, per task and per layer (Lee et al., 28 Mar 2025). This can be interpreted as task-adaptive control over parameter subspaces rather than over whole-task deltas.
A fourth class adapts over expert modules rather than dense vectors. MINGLE represents each task by a low-rank expert 5, with merged layer output
6
and adapts only the current task gate 7 at test time (Qiu et al., 17 May 2025). TTMM, from "Local Mixtures of Experts: Essentially Free Test-Time Training via Model Merging," merges LoRA adapters rather than full dense checkpoints: 8 where the prompt embedding 9 routes over cluster centroids 0 (Bertolissi et al., 20 May 2025). Although framed as Test-Time Model Merging rather than 1, it is a prompt-level adaptive merge and therefore a fine-grained instance of the same general paradigm.
A fifth class uses intra-model adaptive transfer rather than inter-model merging. Hi-Vec equips a single model with a hierarchy of linear heads, selects a head by gradient norm,
2
then merges the adapted selected head into similar heads via
3
The paper explicitly calls each hierarchical layer a task vector, though this usage differs from the standard residual-delta definition (Ambekar et al., 11 Aug 2025). This suggests that 4 can be interpreted not only as inter-checkpoint merging but also as test-time adaptive sharing among internal parameter components.
5. Empirical performance and benchmark evidence
The named 5 medical VLM paper evaluates across four medical imaging modalities and three deployment regimes: in-domain, base-to-novel, and corruption shifts (Imam et al., 31 Oct 2025). Averaged over four medical datasets, the reported Top-1 accuracies are: pretrained CLIP 6, expert CLIP 7, DaWin 8, 9 0, and 1 2. The corresponding normalized error values are 3, 4, 5, 6, and 7, respectively (Imam et al., 31 Oct 2025). On Cell Microscopy, the mean accuracy rises from DaWin’s 8 to 9 with 0 and 1 with 2 (Imam et al., 31 Oct 2025). These results support the specific claim that sample- or batch-adaptive weight interpolation can outperform both static merging and prior dynamic entropy-based weighting in medical zero-shot classification.
AdaMerging reports strong gains over conventional task arithmetic on eight-task CLIP image classification. For ViT-B/32, Task Arithmetic achieves 3, TIES-Merging 4, Layer-wise AdaMerging 5, and Layer-wise AdaMerging++ 6. For ViT-L/14, Task Arithmetic gives 7, TIES-Merging 8, AdaMerging 9, and AdaMerging++ 00 (Yang et al., 2023). The paper also reports robustness improvements under corruption shifts and improvements on unseen downstream tasks (Yang et al., 2023). This is evidence that batch-level test-time coefficient adaptation already yields substantial gains, even without per-sample routing.
AdaRank extends this with adaptive spectral selection. On vision benchmarks merging CLIP ViT-B/32 and ViT-L/14 fine-tuned on 8, 14, and 20 tasks, CART+AdaRank reports 01 on ViT-B/32 and 02 on ViT-L/14, compared with static CART’s 03 and 04 (Lee et al., 28 Mar 2025). On language, RoBERTa average rises from 05 with CART to 06 with CART+AdaRank, and GPT-2 from 07 to 08 (Lee et al., 28 Mar 2025). Particularly notable is the ablation on ViT-B/32 8-task merging: starting from TA/CART, no adaptation gives 09, learning 10 only gives 11, learning 12 only gives 13, and learning both yields 14 (Lee et al., 28 Mar 2025). This indicates that structural adaptation in singular space can matter at least as much as scalar coefficient adaptation.
CodeMerge evaluates in online 3D perception under corruptions and cross-dataset transfer. On nuScenes-C end-to-end autonomous driving, averaged over corruptions, it improves 3D detection from MOS’s 15 to 16 mAP and from 17 to 18 NDS; AMOTA rises from 19 to 20, AMOTP decreases from 21 to 22, and recall increases from 23 to 24 (Yang et al., 22 May 2025). On Waymo 25 KITTI and nuScenes 26 KITTI transfer, it exceeds MOS by clear margins in AP27 and AP28 (Yang et al., 22 May 2025). Because CodeMerge computes weights from a compact codebook rather than repeated forward passes through all checkpoints, it shows how 29-style adaptivity can be implemented in high-cost settings.
BD-Merging reports strong robustness under corruptions and unseen-task generalization. In the layer-wise setting, it achieves clean average accuracy 30, corrupted 31 32, corrupted 33 34, and corrupted 35 36 (Xie et al., 4 Mar 2026). On a 4-seen / 4-unseen split, it reports seen Avg Acc 37 and unseen Avg Acc 38, compared with AdaMerging’s 39/40 and Twin-Merging’s 41/42 (Xie et al., 4 Mar 2026). Its ablation shows the router is indispensable: full BD-Merging gives clean 43, corrupted 44, while removing the router drops these to 45 and 46 (Xie et al., 4 Mar 2026).
MINGLE provides the continual-learning variant of the story. On ViT-B/32 with 8 tasks, OPCM yields 47 ACC and 48 BWT, whereas MINGLE reaches 49 ACC and 50 BWT (Qiu et al., 17 May 2025). On ViT-B/16 with 20 tasks, OPCM gives 51 ACC and 52 BWT, while MINGLE reaches 53 ACC and 54 BWT (Qiu et al., 17 May 2025). The ablation shows that test-time adaptation alone improves ACC but can severely worsen forgetting, and that null-space constrained gating is central to balancing plasticity and stability (Qiu et al., 17 May 2025).
TTMM provides a prompt-level language-model analogue. With Llama-3.2-1B on Wikipedia, base perplexity is 55, single-model fine-tuning gives 56, TTMM with 10 experts gives 57, and TTT gives 58. On GitHub Python, base is 59, fine-tuned 60, TTMM with 10 experts 61, and TTT 62 (Bertolissi et al., 20 May 2025). The paper reports that TTMM is more than 100x faster than TTT at test time for the 1B-parameter model by amortizing optimization into offline expert construction (Bertolissi et al., 20 May 2025). This supports a broader interpretation of 63: adaptive merging can act as an amortized surrogate for test-time training.
6. Limitations, controversies, and adjacent directions
A major dividing line concerns granularity. AdaMerging is clearly test-time adaptive, but mainly at the level of a single merged model tuned to a current test mixture rather than per-sample dynamic routing (Yang et al., 2023). AdaRank similarly adapts a shared merged model for the current evaluation setting, not a different mask per incoming sample (Lee et al., 28 Mar 2025). By contrast, BD-Merging and the medical 64 method are explicitly per-sample or per-batch adaptive (Xie et al., 4 Mar 2026, Imam et al., 31 Oct 2025). This suggests that the phrase "task adaptive" is used with varying strictness across the literature.
Another major issue is whether test-time adaptation is necessary at all. WUDI-Merging offers a deliberately static, data-free counterpoint. It defines task vectors 65, interference vectors 66, and an interference objective based on how merged and task-specific task vectors act on task-relevant hidden inputs (Cheng et al., 11 Mar 2025). The method is entirely offline and uses no test data, yet reports state-of-the-art performance in data-free model merging scenarios, with an abstract claim of average 67 improvement versus baseline methods and 68 better performance than mainstream test-time adaptation approaches (Cheng et al., 11 Mar 2025). A plausible implication is that 69-style methods may benefit from strong offline interference reduction as an initialization rather than replacing static merging entirely.
The question of what counts as "task" is also unsettled. In TTMM, each prompt is effectively its own task (Bertolissi et al., 20 May 2025). In CodeMerge, the latent environment or domain state plays the role of task (Yang et al., 22 May 2025). In Hi-Vec, hierarchical classifier heads are treated as task vectors, though they are not standard task deltas (Ambekar et al., 11 Aug 2025). In MINGLE, the current sequential task and its class vocabulary are known (Qiu et al., 17 May 2025). In the medical VLM 70 paper, the task is the current sample’s location along the generalist–expert specialization axis (Imam et al., 31 Oct 2025). This suggests that 71 is better understood as a conditional merging principle than as a single fixed task formalism.
There are also practical constraints. Entropy-minimization methods require unlabeled target batches and can suffer from overconfident collapse, a limitation AdaMerging does not explicitly regularize away (Yang et al., 2023). AdaRank requires SVD of task vectors and test-time optimization over binary masks (Lee et al., 28 Mar 2025). BD-Merging requires neighborhood construction and a joint evidential head, making purely single-sample low-latency deployment more difficult (Xie et al., 4 Mar 2026). CodeMerge depends on the availability of stored checkpoints and a meaningful source-feature fingerprint space (Yang et al., 22 May 2025). MINGLE assumes shared initialization, same backbone architecture, current task class prompts, and retention of protected subspace statistics (Qiu et al., 17 May 2025). The medical 72 method assumes two compatible checkpoints and classification-style predictive distributions, and its entropy-threshold extrapolation rule is heuristic (Imam et al., 31 Oct 2025).
Finally, some adjacent work is relevant without being a direct 73 method. S4T studies test-time training in a single multi-task model and shows that task relations should remain synchronized during target-time adaptation; its synchronization metrics and cross-task consistency losses are relevant to 74 because they frame multi-task adaptation as a relational coordination problem rather than independent confidence maximization (Jeong et al., 10 Jul 2025). MergeRepair studies static and continual merging of LoRA adapters in code LLMs for automated program repair, but explicitly reports no empirical results yet and does not implement test-time task-conditioned merging (Dehghan et al., 2024). It is therefore more a precursor in deployment-time adapter composition than a demonstrated 75 system.
Overall, Test-Time Task Adaptive Merging denotes a transition from static model arithmetic to conditional model composition. The literature now spans backpropagation-free coefficient computation from predictive disagreement (Imam et al., 31 Oct 2025), entropy-based adaptation of task-wise and layer-wise weights (Yang et al., 2023), singular-space mask optimization (Lee et al., 28 Mar 2025), latent retrieval over checkpoint memories (Yang et al., 22 May 2025), prompt-conditioned low-rank expert merging (Bertolissi et al., 20 May 2025), continual low-rank gating with interference control (Qiu et al., 17 May 2025), and bias-aware per-sample routing under distribution shift (Xie et al., 4 Mar 2026). This suggests that 76 is less a single algorithm than a research program: the systematic study of how model-merging decisions should depend on the current input, batch, stream, or deployment regime.