RCP-Merging: Merging Long Chain-of-Thought Models with Domain-Specific Models by Considering Reasoning Capability as Prior

Junyao Yang, Jianwei Wang, Huiping Zhuang, Cen Chen, Ziqian Zeng · DOI

Introduction

The artificial intelligence landscape has recently been transformed by the emergence of "Reasoning Models" such as DeepSeek-R1 and OpenAI’s o1. These models excel at complex, multi-step problem solving through extended Chain-of-Thought (CoT) processes. Concurrently, specialized models like Meditron have been developed to house vast amounts of domain-specific knowledge in fields like medicine and finance.

A natural progression is the fusion of these two capabilities: creating a model that possesses both deep domain expertise and advanced reasoning logic. However, traditional model merging techniques—which typically rely on weight averaging or magnitude-based masking—often fail in this context. These methods frequently overwrite the delicate internal logic of reasoning engines, leading to "output collapse." In such cases, the merged model may lose its ability to think step-by-step or produce nonsensical gibberish. RCP-Merging (Reasoning Capability as Prior) addresses this challenge by providing a framework to create dual-capability models without the prohibitive cost of full retraining.

Methodology

RCP-Merging operates through a three-stage process designed to protect reasoning capabilities while integrating specialized knowledge. The framework treats the reasoning model's parameters as a stable Bayesian prior, ensuring that updates for domain expertise do not disrupt the underlying logic.

Overview of the RCP-Merging framework, illustrating the three-step process of domain sensitivity analysis, reasoning preservation, and final weight merging.

1. Domain Knowledge Sensitivity ($S$)

The first stage identifies which weights are most critical for domain-specific tasks. Using a first-order Taylor expansion—multiplying weights by their gradients—the framework estimates the potential performance degradation if specific weights were modified. This ensures that the most vital pieces of domain knowledge are identified before the merge.

2. Reasoning Preservation Indicator ($p$)

This core innovation moves beyond simple weight magnitude. By treating the reasoning model as a Bayesian prior, the authors utilize the Fisher Information Matrix (FIM) to calculate a "penalty" for deviating from the original reasoning weights. Weights with high FIM values are flagged as crucial to the reasoning process and are strictly protected during the merging phase.

3. Reasoning-Preserved Merging

The final stage combines these metrics into a unified constraint. By applying a "majority vote" across a small set of calibration samples, the system generates a binary mask. This mask selectively permits domain-specific updates only when they do not significantly compromise the integrity of the reasoning architecture.

Experimental Evaluation

The researchers evaluated RCP-Merging across four primary pillars using a diverse set of benchmarks:

  • Mathematics: GSM8k and AIME2024 (testing multi-step logic).
  • Coding: HumanEval and LiveCodeBench.
  • BioMedicine: PubMedQA and MedQA (utilizing Meditron3 as the domain model).
  • General Knowledge: ARC-C and GPQA.
  • Finance: ConvFinQA (utilizing WiroAI-Finance as the domain model).

The primary experiments utilized Qwen2.5-7B as the base architecture, merged with DeepSeek-R1-Distill-Qwen-7B as the reasoning component.

Key Results and Insights

RCP-Merging demonstrated significant improvements over state-of-the-art merging methods, particularly in specialized fields. It outperformed existing techniques by 9.5% in BioMedicine and 9.2% in Finance tasks. Notably, the merged models occasionally surpassed the original domain-specific models; for instance, achieving a 4.5% improvement on PubMedQA. This suggests that the addition of structured "thinking" capabilities enhances performance even in knowledge-heavy domains.

Performance comparison of RCP-Merging against various state-of-the-art merging techniques across multiple benchmarks, showing superior area coverage in the radar chart.

Beyond raw accuracy, the framework significantly improved model stability. While traditional methods like TIES or DARE often resulted in gibberish rates as high as 80%, RCP-Merging reduced this to approximately 14%. Furthermore, the average output length of the RCP-merged models was nearly eight times longer than the base models, reflecting a robust and sustained reasoning process rather than truncated or repetitive responses.

Discussion and Future Work

The success of RCP-Merging highlights that reasoning is a fragile capability that requires specialized protection. The study reinforces that a weight's importance is not solely determined by its absolute magnitude; small weights can often be the linchpins of complex reasoning chains. By framing the merge as a Maximum A Posteriori (MAP) estimation problem, the authors provide a rigorous mathematical foundation for model fusion.

One emergent behavior noted was the model's ability to apply long CoT reasoning to medical or financial problems that the original reasoning model (trained primarily on math and code) had never encountered. This suggests that reasoning logic, once preserved, can generalize across disparate knowledge bases.

Future research will focus on reducing the reliance on calibration data and exploring the application of this framework to multi-modal models, such as merging vision-capable models with long-form reasoning engines.

Summary updated

BibTeX
@inproceedings{yang2026rcp,
  author = {Junyao Yang and Jianwei Wang and Huiping Zhuang and Cen Chen and Ziqian Zeng},
  title = {{RCP-Merging: Merging Long Chain-of-Thought Models with Domain-Specific Models by Considering Reasoning Capability as Prior}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i40.40722},
}
Figure