TL;DR
QA-Merging introduces a training-free, query-adaptive model merging framework that combines a long chain-of-thought (Long-CoT) model with a short chain-of-thought (Short-CoT) model. By selectively calibrating only the transformer layers where the two models' behaviors diverge most, it dynamically tailors reasoning depth to query complexity—slashing token generation costs by up to 70% while maintaining or even improving accuracy.
What Problem Does This Paper Address?
Large Reasoning Models (LRMs) excel at complex problem-solving by generating extensive internal monologues, or Long Chains-of-Thought (Long-CoT). However, this deep deliberation comes with a major downside: "overthinking." When faced with simple queries, these models still generate lengthy, redundant reasoning steps, which spikes inference latency and computational costs.
Existing solutions to achieve adaptive reasoning—where a model dynamically chooses between a short or long explanation—fall into two flawed categories:
- Prompt-guided methods: Brittle and highly sensitive to phrasing.
- Training-based methods (SFT/RL): Prohibitively expensive, requiring massive datasets and compute.
Model merging offers a cheaper alternative by blending specialized Long-CoT and Short-CoT models. However, standard merging techniques are static and input-agnostic, or they require costly all-layer calibrations that negate the efficiency benefits of merging in the first place.
Methods
QA-Merging solves these challenges through an activation-based, layer-selective merging pipeline that operates in three main phases:
- Pattern-Labeled Data Construction: The authors build a tiny calibration dataset (just 128 queries) by running both the Long-CoT and Short-CoT models on seed questions. Queries are categorized based on whether the short model can answer them correctly; if it can, the query is labeled as preferring a "Short-CoT" pattern to maximize efficiency.
- Layer-Selective Strategy: Instead of optimizing the entire network, the authors calculate the Reasoning Pattern Divergence (RPD) across layers using cosine distance. They discover that the behavioral differences between long and short reasoning are heavily concentrated in a few middle-to-late layers. QA-Merging selects only the top-$K$ (default 30%) highest-divergence layers for active calibration.
- Feature-Alignment & Contrastive Shaping:
- For High-Divergence Layers: The framework optimizes element-wise merging coefficients using a dual-loss objective: feature alignment (minimizing distance to the preferred model's hidden states) and contrastive shaping (pushing the merged representation closer to the target behavior and away from the unwanted one).
- For Low-Divergence Layers: To avoid gradient computation overhead, the remaining layers are initialized via simple average merging and adjusted using a lightweight, closed-form linear correction matrix.
Datasets
The framework was evaluated across seven prominent mathematical and scientific reasoning benchmarks:
- In-Distribution (ID): GSM8K, MATH500, and AIME24 (used to sample the 128 calibration queries).
- Out-of-Distribution (OOD): AIME25, Minerva Math, OlympiadBench, and GPQA (graduate-level QA).
Key Insights and Ideas
- Non-Uniform Behavioral Divergence: The most profound insight is that a model's reasoning style (concise vs. verbose) is not uniformly distributed. As shown in Figure 1, the divergence peaks sharply in specific middle-to-late layers, meaning full-model fine-tuning is largely redundant for style adaptation.
- Contrastive Shaping Prevents "Blurring": Naive interpolation often washes out distinct model behaviors. Introducing a contrastive loss explicitly forces the merged model to commit to either a crisp, direct answer or a fully realized, step-by-step derivation based on the query's difficulty.
Key Results
The authors tested QA-Merging on two model families: Qwen2.5-1.5B (merged with a DeepSeek-R1 distillation) and Qwen3-4B.
- Superior Accuracy-Efficiency Trade-off: On the Qwen2.5-1.5B pair, QA-Merging achieved an average accuracy of 44.9%, actually outperforming the base DeepSeek-R1-1.5B model (44.3%) while reducing the average response length by 70.5% (dropping from 8,162 tokens to just 2,404 tokens).
- Outperforming RL Baselines: QA-Merging beat state-of-the-art reinforcement learning methods like Query-Opt and Ada-R1 in both accuracy and token compression.
- Massive Compute Savings: While RL-based adaptive training took upwards of 20 to 24 hours, QA-Merging completed its layer-selective calibration in just 20.7 minutes on a single NVIDIA RTX A5000 GPU.
Limitations and Future Work
The primary limitation acknowledged by the authors is that QA-Merging currently operates strictly within a homogeneous setting—meaning it requires the Long-CoT and Short-CoT models to share the exact same base architecture and scale (e.g., merging two variants of Qwen2.5-1.5B).
Future work will focus on extending this layer-selective activation framework to heterogeneous model merging, allowing developers to cross-merge entirely different model families or architectures to achieve query-adaptive intelligence.
Summary updated