GEPA is among the strongest reflective prompt optimizers for language-model programs, but its system-aware merge operator is unstable across models: merge improves gpt-4.1-mini on average while degrading Qwen3-8B, an asymmetry noted but left unexplained by the GEPA paper. We investigate this instability across five datasets and two models. Our nine-configuration sweep over merge timing and merge operator shows that merge can improve both models when configured appropriately. This suggests that merge instability is better explained by configuration sensitivity than by an inherent flaw in the merge operator. We then test whether prompt-level features predict GEPA's merge-accept decisions and find that they do not, ruling out static-feature gating. As a proof of concept, a behavior-based probe built from these diagnostics avoids large merge failures in our multi-seed runs by abstaining on high-risk tasks, although it does not consistently outperform NoMerge. Code is available as GEPA-MergeProbe at https://github.com/ChongZZZZ/GEPA_MERGE .
Figures & tables
Figure 1: Test-score change from adding merge to GEPA (GEPA+Merge − GEPA), computed from Tables 1–2 of Agrawal et al. (2026) . Merge helps gpt-4.1-mini but hurts Qwen3-8B; dashed lines mark the six-task aggregate change ( +1.14 and −2.45 pp).
Figure 2: Overview of the GEPA optimization loop, reproduced from Agrawal et al. (2026) . Parents are drawn from a Pareto-filtered candidate pool (bottom); each iteration proposes a child with either reflective prompt mutation or system-aware merge (right), and keeps it only if it improves on a minibatch and then on the full validation set (top). Our study varies when the merge branch may fire and how it resolves conflicting modules (§ 4 ).
Case
Condition
Resolution
A
Exactly one descendant diverged from ancestor
Take the diverged descendant
B
Both diverged differently
Variant-dependent (§ 4 )
C
Both descendants agree ( p1=p2 )
Take either
Table 1: Case classification in the GEPA merge operator.
Dataset
Task type
HotpotQA
multi-hop QA
HoVer
fact verification
IFBench
instruction following
MuSiQue
compositional multi-hop QA
2WikiMultiHopQA
entity-relation multi-hop QA
Table 2: The five benchmarks evaluated. Per-benchmark retrieval modes are reported in Appendix A .
Figure 3: Configuration sweep: Δ test score relative to NoMerge. Columns denote benchmarks and rows denote (operator×timing) configurations. The left panel shows Qwen3-8B; the right panel shows gpt-4.1-mini. Per-benchmark winners are shown in boldface, and catastrophic cells with Δ≤−20 pp appear as dark-red outliers. The paper-default setting (original × immediate) is rarely the best configuration.
Task
GPT-4.1-mini
Qwen3-8B
mean
σ
mean
σ
HotpotQA
58.2
4.0
51.9
4.0
IFBench
49.6
0.8
34.4
2.2
HoVer
46.2
2.1
44.4
3.0
MuSiQue
48.1
4.7
47.2
5.1
2WikiMHQA
83.5†
0.2†
82.6
2.2
Table 3: Per-task NoMerge test scores across 3 seeds, showing the seed-variance noise floor for interpreting merge-cell deltas in Figure 3 . † has only n=2 seeds.
Qwen3-8B
gpt-4.1-mini
Task
Reflect
Merge
Reflect
Merge
HotpotQA
−0.005
−0.008
+0.018
−0.006
IFBench
+0.039
+0.009
+0.012
−0.001
HoVer
+0.020
+0.015
+0.001
−0.004
MuSiQue
+0.018
+0.001
+0.021
−0.005
2WikiMHQA
+0.045
−0.011
+0.040
−0.008
Table 4: Mean per-step Δval by operator. Reflection exceeds merge on every task for both models.
Task
Qwen r
GPT r
HotpotQA
+0.89
+0.71
MuSiQue
+0.40
+0.83
IFBench
−0.01
+0.00
HoVer
−0.06
+0.63
2WikiMHQA
+0.99
+0.98
Table 5: Per-task validation/test Pearson correlation across the nine merge configurations and NoMerge baseline ( n=10 per model–task pair).
Figure 4: Overview of the behavioral probe. Merge is unlocked only after a score plateau and GEPA’s original validity checks; parent pairs are filtered by strength and maturity balance, then routed to summarize-before under bloat risk or high complementarity, and to the original rule otherwise.
Figure 5: Behavioral probe vs. NoMerge across seeds. Each tile reports mean Δˉ and sample standard deviation σ .
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
Retrieval
Context
HotpotQA
BM25 / Wiki
top- k retrieved
HoVer
BM25 / Wiki
top- k retrieved
IFBench
none
instruction only
MuSiQue
per-example
20 paragraphs (gold + distractors)
2WikiMultiHopQA
per-example
10 paragraphs (gold + distractors)
Appendix
Table 6: Per-benchmark retrieval mode. BM25/Wiki retrieves from a shared Wikipedia abstracts corpus; per-example uses each dataset example’s packaged context.
Task
Reflect mean
Merge mean
Reflect σ
Merge σ
Qwen3-8B
HotpotQA
−0.005
−0.008
0.047
0.027
IFBench
+0.039
+0.009
0.074
0.023
HoVer
+0.020
+0.015
0.027
0.018
MuSiQue
+0.018
+0.001
0.048
0.015
2WikiMHQA
+0.045
−0.011
0.121
0.022
Appendix
Table 7: Per-step Δval mean and standard deviation by operator.
Task
Δs=0
Δs=1
Δs=2
Δˉ
σ
gpt-4.1-mini
HotpotQA
+3.66
−2.66
+0.00
+0.33
3.17
IFBench
+1.36
+0.34
−1.02
+0.23
1.19
HoVer
+1.66
+1.66
+5.00
+2.77
1.93
MuSiQue
+1.67
+1.66
+6.34
+3.22
2.70
2WikiMHQA
+1.00
+0.33
—
+0.66
0.47
Appendix
Table 8: Per-task probe Δ vs. NoMerge across 3 seeds.
Model merging has emerged as a lightweight paradigm for enhancing Large Language Models (LLMs), yet its underlying mechanisms remain poorly understood. In this work, we analyze late-stage pre-training trajectories and uncover a Rank-1 Subspace phenomenon: while raw optimization steps oscillate violently, consecutive merged checkpoints collapse onto a stable, approximately one-dimensional linear manifold. We theoretically ground this observation in a river-valley landscape analysis: averaging acts as a geometric low-pass filter that dampens high-curvature noise to reveal the optimal descent direction. Capitalizing on this insight, we propose Extra-Merge, a training-free strategy that extrapolates along this subspace to minimize loss without additional gradient updates. Extensive experiments across GPT-2 and LLaMA families (124M to 2B) demonstrate that Extra-Merge consistently outperforms standard merging baselines. Notably, it yields consistent zero-shot accuracy gains on Pythia-12B downstream tasks and generalizes effectively to the Muon optimizer \citep{jordan2024muon}.
Wenjie Zhou, Bohan Wang, Hongtao Zhang +3
State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences, China · University of Chinese Academy of Sciences, China · Alibaba Group, China +2
Large language models fine-tuned from a shared base can be merged by averaging their task vectors, but some merges collapse far below the base model, and common merge operators give no warning before evaluation. We show that one statistic of the specialists' task vectors both predicts this collapse and calibrates its repair. The power that averaging removes equals the variance of the task vectors across specialists, our measure of interference. Under a working noise model, the disturbance that a merge injects grows with the merge coefficient and with interference, yielding a pre-merge score. In our experiments on twenty-two merge configurations from four model families, only destructive merges exceed a threshold on this score. We find that statistics of sign conflict between specialists, a common target of existing merge operators, are anti-predictive. We then predicted the outcomes of fourteen merges before evaluating them, and twelve predictions were correct, including the destructive outcome of a specialist pair pushed past the threshold by continued pretraining. To address this collapse, we introduce PRISM, an operator that averages the task vectors first and then soft-thresholds each layer at a level set by the layer's interference. Without data or tuning, PRISM keeps all five destructive merges above the threshold within evaluation noise of the base model, where plain averaging falls at least 14.4 points below it or collapses entirely. We apply PRISM only above the threshold and keep the plain average for merges below it, which include all fifteen harmless ones. Code is available at https://github.com/js-lee-AI/PRISM.
Jungseob Lee, Seungyoon Lee, Sugyeong Eo +3
Korea University · Yonsei University Mirae Campus · Sookmyung Women’s University +1
Prompt optimization methods either analyze individual failures in isolation or compare prompt variants across examples, operating on single execution traces with no access to the reasoning process distinguishing success from failure on the same input. We introduce ContraPrompt, built on the observation that when a model fails but succeeds on a retry with feedback, the difference between its two chain-of-thought traces constitutes an optimization signal not captured by prior methods. Unlike prior contrastive methods, we compare complete intermediate reasoning processes: the two traces share model, input, and base prompt, so remaining differences reflect reasoning strategy and appended error feedback -- we call this dyadic reasoning trace analysis. The multi-attempt solving phase is an instrumented agentic retry loop that generates contrastive data automatically without human annotation. Extracted rules are organized into an input-aware decision tree routing instructions by observable input characteristics. On four reasoning and compliance benchmarks, ContraPrompt outperforms GEPA (Agrawal et al., 2026) on all four, with absolute gains of +8.29 pp on HotPotQA (+20.8% rel.), +2.21 pp on GDPR-Bench (+18.2% rel.), +7.14 pp on GPQA Diamond (+10.6% rel.), and +0.74 pp on BBH (+0.85% rel.). Ablations confirm dyadic trace contrastivity is the critical component, with a -16% relative average drop upon its removal. On 53 EvalSet black-box optimization problems, ContraPrompt beats GEPA on 11, ties on 41, and loses on 1 at equal budget. On FiNER-139 financial named entity recognition (Loukas et al., 2022), ContraPrompt achieves +7.77 pp over the unoptimized baseline (+11.6% rel.) and +1.94 pp over GEPA (+2.66% rel.), with branch conditions aligning with standard US GAAP financial-instrument categories.