Harnessing Optimization Dynamics for Curvature-Informed Model Merging

Pouria Mahdavinia, Hamed Mahdavi, Niloofar Mireshghallah, Mehrdad Mahdavi
9/14/2025
cs.LGcs.AI

Official code: pmahdavi/ota-merge (5 stars, last commit 2025-10-03).

Abstract

Model merging is an effective post-training strategy for composing capabilities in large language models without joint retraining. We study this in the supervised fine-tuning (SFT) stage, where multiple capability-based SFT checkpoints -- spanning math, code, precise instruction following, general instruction following, and knowledge recall -- must be consolidated into a single model. We introduce Optimization Trajectory Aware (OTA) Merging, a curvature-aware aggregation that leverages optimizer second-moment statistics as a diagonal curvature proxy to reweight parameter edits and mitigate interference. Complementing OTA, we propose Fast Fisher Grafting (FFG), a curvature-driven task-localization step that sparsifies conflicting or low-importance edits. FFG induces extremely low-rank masks concentrated in early attention query/key projections and token embeddings, exploiting shared curvature across capabilities. We further develop a memory-light compression of the second moments that preserves OTA's effect. Across diverse capability-based SFT checkpoints, OTA+FFG improves merged-model quality over strong weight-space baselines, reduces negative transfer, and remains robust across sparsity levels. Analyses reveal substantial curvature overlap between checkpoints, offering a novel lens on why simple linear merging can be effective in practice. Ablations confirm that FFG is critical for reducing task interference and that the compressed second moments retain the gains of the full formulation. To facilitate reproducibility, we open-source all code, training and evaluation scripts, visualization artifacts, and capability-specific SFT checkpoints at https://github.com/pmahdavi/ota-merge.

View on arXivView PDF

Code Implementations(1)

pmahdavi/ota-mergeOfficial100%
51Jinja, ShellApr 21, 20251 years agoNOASSERTION

Similar Papers

Cite this paper

@article{mahdavinia2025harnessing,
  title  = {Harnessing Optimization Dynamics for Curvature-Informed Model Merging},
  author = {Pouria Mahdavinia and Hamed Mahdavi and Niloofar Mireshghallah and Mehrdad Mahdavi},
  year   = {2025},
  eprint = {2509.11167},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.11167v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.11167.svg)](https://codeofpaper.com/paper/2509.11167)

Discussion