Manuscript Offprint

arXiv:2609.07971

MeRoTune: RoPE-Safe Merging with a Tunable Dial

Salman Faroz

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

When you merge two fine-tuned models from the same base checkpoint by simply averaging their weights, you implicitly assume their attention subspaces are still aligned. Recent work [13] attempts to fix misalignments by learning an invertible correction matrix, MM, for each model's query and key projections. This correction cancels out—using MM on the query side and M−⊤M^{-\top} on the key side—right before the dot product. However, this cancellation is only exact if nothing sits between the projection and the dot product. In reality, almost all modern open-weight language models put a rotary position embedding (RoPE) exactly there. In this paper, we show that this cancellation is exact under RoPE if and only if MM commutes with RoPE's per-position rotation. We derive the specific class of matrices where this holds: a scaled rotation acting independently within each RoPE frequency pair. This forms a strict, low-dimensional subset of the unconstrained matrices that current methods normally train. Building on this, we turn this constrained matrix class into a new merging method. While keeping the base weights entirely frozen, two fine-tunes each learn their own RoPE-compliant correction matrices. We optimize these corrections against a chosen blend ratio so the final result can be adjusted post-hoc like a dial, rather than locked into a single fixed merge. Our default approach trains at one fixed blend ratio, similar to how LoRA sets its scaling hyperparameter in advance [8]. We also experiment with resampling the blend ratio randomly at every training step, and we report the results of both approaches. Additionally, we define a closed mathematical condition to determine whether this alignment process is even worth doing in the first place—specifically, checking for a genuine, bidirectional capability gap between the two fine-tunes—and we empirically verify this condition before training instead of just assuming it. We test our method on a verified pair of Qwen2.5-1.5B-Instruct fine-tunes (an Indonesian/code specialist and a Japanese specialist). Our approach never loses to the mergekit reference implementations of TIES and DARE-TIES at any blend ratio tested. It also clears our own statistical noise floor on most benchmarks (with the exception of one, whose margins remain inside that floor throughout), whereas DARE-TIES actually falls behind the unmerged base model on at least one axis. Finally, we explore whether the tied blend ratio can be split into two independent scaling factors, finding that doing so reliably degrades performance across all benchmarks as both factors rise. Code, training data, and merge/evaluation scripts are publicly available [4].

1 Introduction

Model merging combines several independently fine-tuned copies of one base checkpoint into a single set of weights, usually to obtain a model competent at every fine-tune's specialty without the cost of serving several models or retraining from scratch [19]. The dominant family of methods – weight averaging, task arithmetic [10], TIES [21], DARE [22], SLERP [18], Model Stock [11] – all operate directly on raw weight tensors. None of them ask whether two fine-tunes' internal coordinate systems for a given layer actually agree before combining them.

A separate line of work asks exactly that question for attention: before averaging two models' query/key projections, learn a per-head invertible correction MM and fold it in as Wq→MWqW_q \to MW_q, Wk→M−⊤WkW_k \to M^{-\top}W_k. For any invertible MM this is an exact no-op in isolation −(Mq)⊤(M−⊤k)=q⊤M⊤M−⊤k=q⊤k- (Mq)^{\top}(M^{-\top}k) = q^{\top}M^{\top}M^{-\top}k = q^{\top}k – so nothing is lost by inserting it, and averaging two models' MM-corrected projections can undo a rotational mismatch averaging their raw projections cannot. Li and Shen use exactly this construction, with MM left completely unconstrained (a Cayley-transform orthogonal factor times a Cholesky-factor symmetric part), to scale linear mode connectivity to billion-parameter transformers [13].

The cancellation q⊤M⊤M−⊤k=q⊤kq^\top M^\top M^{-\top}k = q^\top k holds because nothing sits between the projection and the dot product. Rotary position embedding (RoPE) [20] – used by Qwen [15], Llama 3 [14], and essentially every current open-weight decoder – inserts a position-dependent rotation there on purpose, to make the attention logit depend on relative position. An MM chosen without this in mind has no reason to leave that rotation’s action alone, and one that does not commute with it changes the merged model’s relative-position behavior in a way invisible to a smooth training loss that never checks for it. Section 3 makes this precise and derives the exact matrices for which the cancellation survives RoPE: not all invertible MM, but a specific 2-parameter family acting within each RoPE frequency pair.

We use this family – which we call the RoPE-commutant class – to build MeRoTune (Merging + RoPE + Tunable): a dual-sided alignment where each fine-tune learns its own RoPE-legal correction against a blend ratio, so the result works as a runtime dial rather than a single fixed-ratio checkpoint. Our default fixes that blend ratio before training, the same way LoRA’s own scaling hyperparameter is fixed in advance [8], rather than treating it as something that must be resampled during training; we also tried resampling it randomly and compare both. We also give a closed condition, checked before any training is done, for when this kind of correction addresses a real problem at all rather than searching for structure that is not there. Contributions:

  1. A short, self-contained proof of which query/key corrections survive RoPE exactly (Section 3), and the dual-sided, alpha-scannable merging method built on it (Section 4).

  2. A mathematical statement of when two fine-tunes have a genuine, bidirectional capability gap worth aligning for, checked empirically on five candidate models before any training is committed (Section 5) – rejecting three superficially plausible pairs in the process.

  3. An evaluation against the official mergekit implementations of TIES and DARE-TIES [6, 1] – not plain averaging, which is itself the trivial (M=IM=I) member of the same commutant class and assumes zero misalignment rather than correcting one – across the blend-ratio range, a comparison between fixing the blend ratio during training (our default) and resampling it randomly, and an ablation testing whether the tied blend ratio can be relaxed into two independent scaling factors (Section 6).