---
title: Adaptive Iterative Model Merging
url: https://www.emergentmind.com/topics/adaptive-iterative-model-merging-aimmerging
type: topic
---

# Adaptive Iterative Model Merging

Adaptive Iterative Model Merging (AimMerging) is a continual learning framework for large language models in which model merging is treated as a dynamic, multi-round process rather than a single post-training operation. It was introduced to address the stability–plasticity trade-off in sequential learning, especially the observation that existing model merging-based continual learning methods suffer from suboptimal number of merges and merging frequency. AimMerging monitors the training trajectory through explicit learning and forgetting signals, uses a training trajectory-guided merge controller to decide merge timing and frequency, and performs rehearsal-based knowledge fusion to combine new-task and past-task task vectors into a single updated model [2509.17348].

## 1. Problem formulation and conceptual scope

AimMerging is formulated in a continual learning setting for large language models exposed to a task sequence
\[
\{\mathcal{T}_1,\dots,\mathcal{T}_K\},
\]
where task \(k\) has dataset
\[
\mathcal{D}_k = \{(x_i^k, y_i^k)\}_{i=1}^{N_k}, \quad x_i^k\in\mathcal{X}_k,\, y_i^k\in\mathcal{Y}_k.
\]
The ideal objective is
\[
\mathcal{L} = \mathbb{E}_{(x,y)\sim \bigcup_{k=1}^K \mathcal{D}_k}[-\log p_\Theta(y\mid x)],
\]
but training is sequential, so catastrophic forgetting arises when optimization on \(\mathcal{T}_k\) harms performance on earlier tasks. The central tension is the standard stability–plasticity trade-off: stability requires preserving knowledge from past tasks and avoiding catastrophic forgetting, whereas plasticity requires learning new tasks well and enabling transfer [2509.17348].

The framework assumes a replay-based continual learning regime. For each past task \(\mathcal{T}_i\), a small memory buffer \(\mathcal{M}_i\) is stored, with the default setup using \(2\%\) of the task training set. At task \(k\), the model trains with current task data \(\mathcal{D}_k\) and memory \(\mathcal{M}_{<k} = \bigcup_{i<k}\mathcal{M}_i\). AimMerging is implemented in a parameter-efficient fine-tuning setting, mainly with LoRA adapters on top of a frozen base LLM. If \(\theta^k\) denotes the task-\(k\) model parameters, the task vector is
\[
\tau^k = \theta^k - \theta^{k-1}.
\]
Model merging methods define a merge function \(f_{\text{merge}}\) and produce a unified model, for example
\[
\hat{\theta}^k = f_{\text{merge}}(\theta^{k-1},\theta^k).
\]
Within this framing, AimMerging departs from single-round, static merging and from fixed-schedule multi-round merging by making the merge schedule itself trajectory-dependent [2509.17348].

In the broader model-merging literature, “adaptive iterative model merging” also refers to a wider family of procedures that repeatedly update a merged model using task vectors or quadratic proxy objectives. Related work has treated iterative merging as alternating tuning-and-merging, adaptive projective gradient descent, spectral regularization of noisy inverse problems, or sequential orthogonal projection of incoming task vectors [2411.03055][2501.01230][2606.07289][2501.09522]. AimMerging is more specific: it is a continual learning framework for LLMs in which the adaptive signal comes from the training trajectory and replay memory rather than from purely data-free weight-space geometry [2509.17348].

## 2. Training trajectory signals and the merge controller

AimMerging’s controller is built from two explicit signals: a learning signal that tracks parameter change, and a forgetting signal that tracks replay loss. Suppose the \(b\)-th merge during task \(\mathcal{T}_k\) occurs at iteration \(j\), with interval \(S_b\) since the previous merge. The task vector between merges is
\[
\tau_b = \theta_j - \theta_{j-S_b}.
\]
The learning signal is defined as
\[
\Lambda_b = \frac{1}{S_b} \sum_{i=1}^n |\tau_b^i|,
\]
namely the average absolute parameter change per step over the preceding interval. Large \(\Lambda_b\) indicates active learning, while small \(\Lambda_b\) indicates slow convergence. To reduce noise, AimMerging maintains a history
\[
\mathcal{H} = [\Lambda_1,\dots,\Lambda_{b-1}]
\]
and uses a sliding window of length \(L_w\) to compare upward and downward trends [2509.17348].

The forgetting signal is defined through the historical loss on replay data. At each iteration, a batch from \(\mathcal{M}_{<k}\) is sampled and evaluated without gradient updates, yielding historical loss \(L_{\text{hist}(t)}\). During the first \(\frac{2}{3}S_{b+1}\) steps after the last merge, an average historical loss \(\bar{L}\) is estimated, and the threshold for the upcoming interval is set to
\[
\delta_{b+1} = \gamma_{\text{forget}} \cdot \bar{L},
\]
with default \(\gamma_{\text{forget}}=2\). If at any later step before the next scheduled merge
\[
L_{\text{hist}(t)} > \delta_{b+1},
\]
the forgetting signal is activated and the counter is incremented:
\[
\mathcal{F}(b+1) = \mathcal{F}(b+1) + 1.
\]
If \(\mathcal{F}(b+1)\) reaches \(\mathcal{F}_{\max}\), with default \(\mathcal{F}_{\max}=3\), an early merge is triggered [2509.17348].

The merge controller first sets a nominal interval \(S_{b+1}\) from learning-signal trends. If upward trends dominate, the method interprets the phase as rapid learning and shortens the interval:
\[
S_{b+1} = \max(S_{\min}, S_b / \gamma_{\text{learn}^-}).
\]
If the trends are balanced, it keeps
\[
S_{b+1} = S_b.
\]
If downward trends dominate, the phase is treated as slow convergence and the interval is lengthened:
\[
S_{b+1} = \min(S_{\max}, S_b \cdot \gamma_{\text{learn}^+}).
\]
The default hyperparameters are \(S_{\text{init}}=8\), \(L_w=3\), \(S_{\min}=2\), \(S_{\max}=128\), with \(\gamma_{\text{learn}^+}=1.5\), \(\gamma_{\text{learn}^-}=2\) when \(S>64\), and \(\gamma_{\text{learn}^+}=2\), \(\gamma_{\text{learn}^-}=1.5\) otherwise. A cold-start phase uses fixed \(S_{\text{init}}\) for the first \(L_w\) merges [2509.17348].

The actual interval \(S'_{b+1}\) is then determined by combining the nominal schedule with the forgetting signal. If forgetting activates repeatedly before the nominal merge time, the method triggers an early merge, so \(S'_{b+1}<S_{b+1}\). If forgetting does not activate by the time the nominal interval is reached, the merge can be deferred to allow more new-knowledge acquisition, up to the hard cap
\[
S'_{b+1} = 2S_{b+1}.
\]
This policy is intended to support aggressive merging under high forgetting risk and conservative merging when forgetting is low [2509.17348].

## 3. Rehearsal-based knowledge fusion and full algorithmic pipeline

When a merge is triggered at iteration \(j\), AimMerging constructs two task vectors. The new-task vector over the realized interval \(S'_b\) is
\[
\tau_{\text{new}_b} = \theta_j - \theta_{j - S'_b}.
\]
To construct a historical-task vector, the model is temporarily fine-tuned on replay memory \(\mathcal{M}_{<k}\) for \(S'_b/2\) steps, producing \(\theta_{j(M)}\), and then
\[
\tau_{\text{past}_b} = \theta_{j(M)} - \theta_j.
\]
The first vector captures accumulated updates from the current training interval, while the second encodes parameter changes that favor historical tasks only [2509.17348].

The merge weights are derived from the learning and forgetting signals. The proportion assigned to new knowledge is
\[
\mathcal{P}_{\text{new}} = L_{\text{up}} / L_w,
\]
where \(L_{\text{up}}\) is the number of upward learning-signal trends inside the sliding window. The proportion assigned to past knowledge is
\[
\mathcal{P}_{\text{past}} = \mathcal{F}(b) / \mathcal{F}_{\max}.
\]
These are normalized into fusion weights
\[
\alpha_1 = \frac{\mathcal{P}_{\text{new}}}{\mathcal{P}_{\text{new}} + \mathcal{P}_{\text{past}}}, \qquad
\alpha_2 = \frac{\mathcal{P}_{\text{past}}}{\mathcal{P}_{\text{new}} + \mathcal{P}_{\text{past}}},
\]
so that \(\alpha_1+\alpha_2=1\). The resulting fusion update is
\[
\hat{\theta}_j = \theta_{j - S'_b} + \alpha_1 \tau_{\text{new}_b} + \alpha_2 \tau_{\text{past}_b}.
\]
This is a global parameter-wise fusion rather than a masking-based rule. In practice, the method operates on LoRA parameters or adapters rather than on the full backbone weights [2509.17348].

The full training loop reorganizes each task into repeated merge cycles. Starting from \(\theta^{k-1}\), AimMerging trains on batches from \(\mathcal{D}_k\) plus memory \(\mathcal{M}_{<k}\), but only the new-task batch is used for gradient updates; the replay batch contributes to loss monitoring when computing the forgetting signal. Whenever the elapsed steps reach the current interval bound, or the forgetting counter reaches threshold, or the hard cap \(2S_b\) is reached, the merge routine is executed, the controller state is updated, and training resumes. After the task ends, a replay memory \(\mathcal{M}_k\) is stored and the final merged LoRA state becomes the initialization for the next task [2509.17348].

This pipeline can be read as a continual-learning specialization of a more general iterative-merging template. In the broader literature, ATM formulates iterative merging as alternating tuning and merging, with updates of the form
\[
\theta_{\text{base}^{(k+1)}} = \theta_{\text{base}^{(k)}} + \frac{\alpha}{|T|} \sum_{t \in T} \tau_t^{(k)},
\]
where task vectors approximate multi-task gradients in early training epochs [2411.03055]. AimMerging differs in that it does not merge on a fixed outer-loop schedule and does not rely on a single averaging coefficient; it uses trajectory-dependent timing and signal-derived fusion coefficients instead [2509.17348].

## 4. Evaluation methodology and empirical behavior

AimMerging is evaluated on three continual learning benchmarks. The Standard CL benchmark contains five classification tasks: AG News, Amazon Reviews, Yelp Reviews, DBpedia, and Yahoo Answers. The Long Sequence benchmark contains fifteen classification tasks: the five Standard tasks, four GLUE tasks, five SuperGLUE tasks, and IMDB. The SuperNI benchmark contains fifteen generation and classification tasks from Super-NaturalInstructions, including dialogue generation, information extraction, question answering, summarization, and sentiment analysis. Across these settings, experiments use T5-large, Qwen3-1.7B, LLaMA2-7B, and LLaMA2-13B, all in a LoRA-based PEFT regime with frozen backbone weights [2509.17348].

The main continual-learning metrics are Overall Performance,
\[
\mathbf{OP} = \frac{1}{K}\sum_{i=1}^K a_{i,K},
\]
Backward Transfer,
\[
\mathbf{BWT} = \frac{1}{K-1} \sum_{i=1}^{K-1} \left(a_{i,K} - a_{i,i}\right),
\]
and Forward Transfer,
\[
\mathbf{FWT} = \frac{1}{K} \sum_{i=1}^K (a_{i,i} - a_{0,i}).
\]
Here \(a_{i,j}\) denotes performance on task \(\mathcal{T}_i\) after training through task \(\mathcal{T}_j\), and \(a_{0,i}\) denotes performance when training task \(i\) alone [2509.17348].

On T5-large, AimMerging improves transfer and forgetting relative to Recurrent-KIF across all three benchmarks. On Standard CL, OP is 78.1 versus 78.4, FWT is \(-1.5\) versus \(-3.1\), and BWT is \(-0.4\) versus \(-2.8\). On Long Sequence, OP is 77.9 versus 77.8, FWT is \(-2.3\) versus \(-4.6\), and BWT is \(-1.8\) versus \(-3.6\). On SuperNI, OP is 44.3 versus 43.3, FWT is 2.2 versus 0.4, and BWT is \(-4.0\) versus \(-8.4\). Averaged across benchmarks, FWT improves from \(-2.5\%\) to \(-0.5\%\), approximately an 80% relative improvement, and BWT improves from \(-4.9\%\) to \(-2.0\%\), approximately a 59% relative improvement [2509.17348].

Scaling experiments on the Long Sequence benchmark show that the gains persist from T5-large through Qwen3-1.7B, LLaMA2-7B, and LLaMA2-13B. For LLaMA2-7B, the reported example is FWT 79.3 versus 78.2 and BWT \(-1.6\) versus \(-2.9\). The paper also reports catastrophic forgetting curves: on Long Sequence, the first-task performance drops by roughly 32% for vanilla replay, roughly 10% for Recurrent-KIF, and only roughly 4% for AimMerging [2509.17348].

Ablation studies identify both learning and forgetting signals as necessary. On SuperNI, the full method reports OP 45.1, FWT 1.3, and BWT \(-2.2\). Removing the learning signal yields OP 43.9, FWT 0.5, and BWT \(-3.4\); removing the forgetting signal yields OP 44.3, FWT 0.8, and BWT \(-3.9\). Replacing trajectory-derived weights with manually set global merging weights gives OP 44.2, FWT 0.7, and BWT \(-3.7\), while using importance-based fine-grained merging gives OP 44.9, FWT 1.2, and BWT \(-2.1\). This indicates that the trajectory-derived weighting mechanism is slightly stronger than importance-based weights and avoids their computational overhead [2509.17348].

Memory and efficiency measurements also show a concrete trade-off. With Qwen3-1.7B, training time per epoch is 3.3 minutes for LoRAReplay, 3.4 for TaSL, 4.9 for Recurrent-KIF, and 4.4 for AimMerging. The method is therefore about \(1.3\times\) slower than single-round baselines but faster than fixed multi-round merging. On a 19-task mixed Standard CL + SuperNI sequence, AimMerging reports OP 48.3, FWT \(-3.0\), and BWT \(-9.1\), compared with Recurrent-KIF at OP 46.4, FWT \(-5.9\), and BWT \(-14.6\), indicating improved behavior under stronger distribution shifts [2509.17348].

## 5. Broader theoretical lenses on iterative model merging

The term “adaptive iterative model merging” is used more broadly in adjacent literature than in the continual-learning formulation of AimMerging. One important line of work treats task vectors as approximate gradients and merging as repeated optimization. ATM shows that, in a single-epoch setting under gradient descent, task vectors are mathematically equivalent to gradients obtained in a multi-task setting, and it proposes alternating tuning and merging as an iterative multi-task procedure [2411.03055]. DOGE, in turn, models multi-task model merging as a constrained optimization problem over task vectors and solves it via adaptive projective gradient descent in a shared subspace, with layer-wise merging coefficients interpreted as task-aware learning rates [2501.01230]. This suggests a conceptual link: AimMerging’s trajectory-guided cycles can be interpreted as a continual-learning instance of a wider class of iterative, gradient-like merge procedures.

A second line of work reinterprets iterative merging through second-order or spectral geometry. ACE-Merging derives a closed-form data-free merge
\[
\delta\theta^\star =
\Big( \sum_{i=1}^T \lambda_i \Sigma_i + \epsilon I \Big)^{-1}
\Big( \sum_{i=1}^T \lambda_i \Sigma_i \Delta\theta_i \Big),
\]
where \(\Sigma_i\) are covariance proxies inferred from parameter differences, and explicitly positions itself relative to adaptive iterative methods by arguing that covariance and curvature modeling can guide or replace heuristic update schedules [2603.02945]. Closed-form spectral regularization work then shows that iterative solvers for quadratic interference minimization behave primarily as implicit spectral regularizers of ill-posed normal equations, and proposes SWUDI and SWUDI-A as one-shot spectral filters that match or outperform iterative loops [2606.07289]. These results suggest that AimMerging-style controllers could potentially benefit from explicit spectral or covariance diagnostics rather than only trajectory counts and replay losses.

A third line extends iterative merging to continual or sequential settings without replay. A projection-based continual merging method processes models sequentially by projecting new parameter updates onto subspaces orthogonal to existing merged updates and uses an adaptive scaling mechanism to maintain stable parameter distances, with constant memory complexity in the number of models [2501.09522]. BECAME, from the continual-learning literature, derives a closed-form adaptive merge coefficient from a Bayesian formulation,
\[
\lambda_t^* =
\frac{\Delta\theta^\top F_t(\hat{\theta}_t)\Delta\theta}{
\Delta\theta^\top\Big(F_t(\hat{\theta}_t)+\sum_{i=1}^{t-1}F_i(\theta_i^*)\Big)\Delta\theta},
\]
to interpolate between a stable projection-based solution and a more plastic unconstrained solution [2504.02666]. This suggests that the dynamic weighting rule in AimMerging could in principle be complemented by curvature- or Fisher-informed weighting in future designs.

More recent work also treats optimization trajectories themselves as mergeable objects. TPMM-DPO constructs a reference model for iterative DPO by learning fusion weights over a sequence of policy models generated during alignment, rather than using only the immediately previous checkpoint. Its merged reference takes the form
\[
\theta^* = \sum_{t=0}^{T} \alpha_t \theta^{(t)},
\]
with \(\alpha\) learned from preference data [2605.23398]. That trajectory-aware formulation is not AimMerging, but it sharpens a useful interpretation: in iterative systems, adaptation can target not only model parameters within a cycle, but also the distribution of influence across the entire training trajectory.

## 6. Limitations, misconceptions, and future directions

AimMerging is sometimes conflated with the broader data-free model-merging literature, but its defining characteristics are different. It is not a one-shot merger of frozen experts, and it is not data-free: it depends on replay memory both for loss monitoring and for constructing the historical-task vector through short memory-only fine-tuning [2509.17348]. This means that its performance claims are tied to a replay-based continual-learning setting rather than to the fully data-free merging regime studied by ACE-Merging, SWUDI, DOGE, or sequential projection-based merging [2603.02945][2606.07289][2501.01230][2501.09522].

The authors identify two main limitations. First, the signal design is narrow: the current controller uses parameter changes and historical loss as proxies for learning and forgetting, while it remains open whether gradient norms, Hessian approximations, or layer-wise activation drift would better characterize model state and catastrophic forgetting. Second, the controller is semi-heuristic: interval bounds and thresholds such as \(S_{\min}\), \(S_{\max}\), \(\gamma_{\text{learn}}\), \(\gamma_{\text{forget}}\), and \(\mathcal{F}_{\max}\) are hand-designed rather than learned [2509.17348].

Additional practical constraints follow from the same design. The method depends on replay memory; a memory-free variant is not developed. It introduces extra training time because each merge involves both controller logic and rehearsal-based fusion, even if it remains faster than fixed multi-round merging in the reported setting. The paper also notes that scaling to ultra-large models may present engineering challenges, although experiments already reach 13B-parameter backbones [2509.17348].

The most direct future directions remain internal to the AimMerging formulation: fully automated or bi-level optimization frameworks for learning merge policies and thresholds, memory-free or retrieval-augmented variants where forgetting is estimated by other proxies, and combinations with more sophisticated PEFT mechanisms such as AdaLoRA, BiLoRA, or module routing [2509.17348]. Broader work on iterative merging suggests additional possibilities. Spectral filtering results imply that a controller could adapt merge timing from per-layer eigenspectra rather than only from loss excursions [2606.07289]. Covariance-aware closed-form methods suggest that task-vector statistics may provide data-free curvature surrogates for setting merge weights [2603.02945]. Trajectory-aware preference-guided merging suggests that entire sequences of intermediate models can themselves be fused to suppress late-stage over-optimization [2605.23398]. Taken together, these directions indicate that AimMerging is best understood not as a fixed algorithmic recipe, but as one explicit continual-learning instantiation of a broader program: adapt the merge operator, the merge schedule, and the merge weights to the evolving geometry of training.

Source: https://www.emergentmind.com/topics/adaptive-iterative-model-merging-aimmerging