TL;DR
Model merging is a powerful way to combine specialized Large Language Models (LLMs) into a single generalist model without expensive retraining, but traditional methods fail when applied to reinforcement learning (RL) trained agents. This paper introduces Reinforced Agent Merging (RAM), a distribution-aware framework that prevents "signal dilution" by separating shared and task-unique parameter updates. RAM not only preserves specialized capabilities but actually unlocks synergistic performance, allowing the merged generalist to outperform the original single-task experts.
What Problem Does This Paper Address?
Post-training LLMs with Reinforcement Learning (RL) has become essential for developing advanced reasoning and agentic behaviors. However, training a single generalist agent across multiple domains (like coding, tool use, and long-context memory) via multi-task RL is incredibly difficult because it requires running parallel, task-specific environments and reward models simultaneously.
An attractive alternative is model merging—taking separate expert models fine-tuned from the same base model and blending their weights. Unfortunately, existing state-of-the-art merging methods (like Task Arithmetic, TIES, or DARE) were designed for Supervised Fine-Tuning (SFT) settings. SFT typically results in dense, globally distributed parameter updates.
In contrast, on-policy RL produces highly sparse, localized, and heterogeneous "task vectors." When traditional methods globally average these sparse vectors, the unique parameter updates that give an expert its specialized edge get divided by the number of models ($N$). The authors term this phenomenon Signal Dilution, and it severely degrades the agent's specialized capabilities.
Methods
To resolve this mismatch, the authors propose Reinforced Agent Merging (RAM) and its enhanced variant, RAM+. The framework operates in three distinct stages:
- Probing Vector Distribution: RAM identifies which parameters were actually modified by RL training. It creates a binary mask for each expert using a small threshold ($\epsilon = 10^{-5}$). By summing these masks, it categorizes parameters into two subsets: Shared (updated by two or more agents) and Unique (updated by only one agent).
- Rescaling Unique Regions (RAM+): Agents with highly overlapping updates risk losing performance when their shared regions are averaged. To counteract this, RAM+ calculates a task-specific scaling factor ($\lambda_t$) based on the Overlap-Unique Ratio ($\rho_t$). It proportionally amplifies the unique parameter updates to compensate for the diluted shared updates.
- Selective Merging: Finally, RAM constructs the merged model element-wise. Shared parameters are averaged to balance multi-task consensus, while unique parameters are completely preserved (and amplified by $\lambda_t$ in RAM+) to protect specialized domain knowledge.
Datasets
The authors evaluated their approach across three core agentic domains using a wide array of demanding benchmarks:
- Coding: LiveBench, LiveCodeBench, MBPP, CodeContests, and CodeForces.
- Tool Use: Berkeley Function Call Leaderboard (BFCL) focusing on complex Live/Non-Live Parallel and Parallel Multiple subsets.
- Long-Context Memory: RULER benchmark (specifically HotpotQA and SQuAD tasks) scaled across context lengths from 7K to 64K.
- General Capabilities & Robustness: IFEval (Instruction Following Evaluation) to check for catastrophic forgetting, alongside GSM8K, MATH500, NQ, and 2WikiMultiHopQA for cross-architecture validation.
Key Insights and Ideas
- RL Sparsity is Highly Variable: The spatial distribution of RL updates varies wildly by task. For instance, the Coding agent modified a mere 3.2% of the base model's parameters, whereas the Memory agent altered 54.3%. Global averaging strategies cannot handle this level of heterogeneity.
- Unique Updates Don't Interfere: The authors isolated the unique parameter updates of individual experts and found they caused virtually zero negative interference on out-of-domain tasks. This proves that diluting unique updates during standard merging is entirely unnecessary and actively harmful.
- Unlocking Cross-Task Synergy: By properly preserving and scaling unique parameters, the merged model doesn't just maintain performance—it actually improves. Reasoning behaviors learned from one domain (e.g., coding or math) synergize with others (e.g., tool use), allowing the generalist to beat the original specialized experts.
Key Results
RAM and RAM+ consistently established new state-of-the-art results across Qwen-2.5-7B and Llama-3.2-3B architectures:
- Overall Performance: RAM+ achieved an average score of 66.55 across all 12 primary tasks, substantially outperforming the strongest baseline, DARE+TA (63.33), and the base model (48.70).
- Expert Defeat: In complex tool-use scenarios (Live Parallel Multiple), RAM+ scored 70.83, obliterating the specialized ToolRL expert's score of 58.33.
- Mitigating Catastrophic Forgetting: On the IFEval benchmark, traditional merging methods like TIES suffered severe performance collapses (dropping over 10 percentage points on smaller models). RAM avoided this collapse, maintaining or even improving general instruction-following accuracy.
- High Efficiency: Because RAM relies on simple distribution statistics rather than heavy optimization loops, it is incredibly fast—merging models in just 75.4 seconds, representing a 5.5× speedup over TIES and DARE variants.
Limitations and Future Work
While RAM represents a major step forward for agent merging, the authors note several limitations:
- Scalability to Many Agents: As the number of merged models scales significantly, the probability of parameter collisions in the shared subspace will increase, potentially requiring more complex conflict-resolution strategies.
- Isotropic Importance Assumption: The rescaling factor calculation assumes all parameters contribute equally on average. Incorporating element-wise curvature information (like Fisher information) could provide finer control, though at a higher computational cost.
- Scale Validation: The method was primarily validated on 3B and 7B parameter models. Verifying if these sparsity patterns and RAM's efficacy hold true for massive-scale models (70B+) remains an open question for future research.
Summary updated