TL;DR
Optimization Trajectory Aware (OTA) Merging repurposes the "free" second-moment statistics already tracked by the Adam optimizer (exp_avg_sq) as a diagonal curvature proxy for model merging. By combining Fast Fisher Grafting (FFG)—a saliency-based task vector denoiser—with curvature-aware aggregation and rank-1 memory compression, OTA outperforms established merging baselines while revealing why fine-tuned models share loss landscape geometry.
What Problem Does This Paper Address?
Model merging consolidates multiple specialized large language models (LLMs)—such as specialists in coding, mathematics, or instruction-following—into a single multitask model without retraining.
However, merging faces two fundamental challenges:
- Task Interference: Naively combining non-identical weight updates can degrade individual skills.
- Curvature Misalignment and Cost: Traditional curvature-aware methods (like Fisher Merging) require expensive post-hoc gradient computation over validation datasets, while storing full second-order matrices doubles checkpoint storage.
Furthermore, a foundational theoretical mystery persists: Why does simple linear weight averaging work surprisingly well in practice?
Methods
OTA Merging addresses these issues in a unified, storage-efficient three-stage pipeline:
- Adam’s Second Moment as a Curvature Proxy: Under late-stage local linearity and calibration assumptions, the exponential moving average of squared gradients ($v_\tau$) is shown to approximate the diagonal of the empirical Fisher Information Matrix (FIM) and Hessian.
- Fast Fisher Grafting (FFG): Inspired by Optimal Brain Damage, parameter update saliency is scored as $s_{\tau, i} = (\Delta w_{\tau, i})^2 \cdot v_{\tau, i}$. Instead of zeroing parameters, non-top-$k$ edits are "grafted" back to the pre-trained base model values ($w_0$), effectively denoising task vectors before merging.
- Curvature-Aware Aggregation: Denoised task vectors are combined via closed-form weighted averaging using the diagonal preconditioner $P_{\tau}^* = \text{Diag}(\sqrt{v_\tau^*} + \epsilon)$.
- Memory-Efficient AdaFactor Compression: Because storing $v_\tau$ doubles model storage (29.9 GB for LLaMA-3.1-8B in FP32), OTA stores only moving averages of row- and column-wise sums, reconstructing a rank-1 non-negative tensor at runtime ($O(m+n)$ overhead vs. $O(mn)$).
Datasets
- Base Model:
Meta-Llama-3.1-8B. - Training Data: Curated capability-aligned subsets of
allenai/tulu-3-sft-mixture(728,360 total examples): - Math: Persona MATH, NuminaMath-TIR, OpenMathInstruct 2.
- Coding: Persona Python, Evol CodeAlpaca.
- General Instruction: WildChat (GPT-4 subset), OpenAssistant, No Robots.
- Knowledge Recall: FLAN v2, SciRIFF, TableGPT.
- Precise Instruction Following (IF): Persona IF.
- Evaluation Suite (OLMES / Tülu-3): GSM8K and MATH (mathematical reasoning), HumanEval and HumanEval+ (code generation), BBH (CoT) and DROP (commonsense/reasoning), IFEval (instruction following), and PopQA (knowledge recall/forgetting).
Key Insights and Ideas
- Shared Curvature Geometry: Heatmap analysis reveals that specialist models fine-tuned from the same base converge to loss basins with near-identical diagonal curvature morphology across layers. Curvature variation within a layer spans up to $10^4$, yet max-to-min ratios between different task models stay below 5. This shared structure explains why simple linear averaging works so well.
- Implicit Role- and Layer-Wise Pruning: Magnitude pruning preserves query/key projections while sparsifying value/output weights. FFG does the exact opposite: it aggressively zeroes early and late query/key projections (over 85% row/column sparsity in extreme layers) while keeping middle-layer value, output, and FFN projections dense.
- Regularization via Grafting: Removing low-saliency parameter updates acts as a regularizer. For example, at 20% density, an FFG-pruned coding specialist outperforms the dense model on HumanEval (0.834 vs. 0.788).
- Extremely Low Stable Rank: The stable rank of $v_\tau$ across transformer layers is below 1.3, empirically justifying AdaFactor-style rank-1 factorization without noticeable performance loss.
Key Results
- Overall Performance: On the 5-capability Tülu-3 evaluation suite, OTA achieves the highest average score (0.582), outperforming TIES (0.565), Linear Averaging (0.551), Fisher Merging (0.541), Breadcrumbs (0.502), and DARE (0.417).
- Ablations: FFG task vector pruning is the main driver of performance. Applying FFG followed by simple linear averaging (FFG-TA) scores 0.560, whereas running curvature aggregation without FFG drops to 0.536.
- Compression Efficiency: Rank-1 compressed OTA maintains strong performance (0.571) while slashing second-moment storage from 29.9 GB to just 12.6 MB.
- Expert Sparsity Tuning: Task-specific density tuning is essential; applying a single uniform sparsity ratio degrades OTA and TIES down to linear averaging performance.
Limitations and Future Work
- Diagonal Assumption: Adam’s accumulator only captures the diagonal of the Fisher matrix, ignoring off-diagonal correlations. The authors highlight Kronecker-factored approximations (e.g., K-FAC, Shampoo) as an important future direction.
- Storage Dependency: The standard OTA pipeline requires saving optimizer states alongside model weights, though rank-1 AdaFactor compression largely mitigates this.
- Scope: Experiments are currently focused on full-parameter SFT of 8B-parameter models; scaling to larger models (e.g., 70B+) and reinforcement learning fine-tuning stages (e.g., DPO, PPO) remains open for exploration.
Summary updated