Organizations: State Key Laboratory of Multimodal Artificial Intelligence Systems, Institute of Automation, Chinese Academy of Sciences, Beijing, China · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China · Pengcheng Laboratory, Shenzhen, China · Institute of Computing Technology, Chinese Academy of Sciences · King Abdullah University of Science and Technology, Thuwal, Saudi Arabia
Model merging offers a way to integrate the capabilities of specialized experts, but existing agent merging methods typically require all of them to be available at once. We study continual agent merging, which integrates incoming experts sequentially without retaining previously merged experts. Yet merging in parameter space or feature subspaces does not ensure that the merged model acquires an incoming expert's behavior on interaction trajectories. Moreover, updates toward a new expert can disrupt the merged model's previously integrated interactive behavior. Therefore, we propose Behavior-Aware Continual Agent Merging (BACAM), which learns parameter-wise merging gates from candidate-generated trajectories using expert-guided behavioral supervision. Task-level stability-plasticity control and tensor-level conflict-aware update budgets limit interference with existing capabilities while allowing new ones to be acquired. The learned gates are folded into the model weights without additional inference-time parameters. Across four interactive tasks - web shopping, tool use, information retrieval, and embodied interaction - BACAM achieves an average success rate of 62.82%, exceeding the strongest evaluated merging baseline by 21.69 percentage points. Our code is publicly available at https://github.com/shuaitongli/BACAM.
Figures & tables
Figure 1: (a) Batch agent merging combines all experts at once. (b) Continual agent merging integrates each incoming expert into the current merged model. Red blocks indicate potential forgetting of earlier capabilities.
Figure 2: Overview of BACAM. (a) BACAM constructs a merged candidate from the current merged model and incoming expert, collects interaction trajectories, and optimizes the gates through task- and tensor-level control. (b) On candidate-generated histories, new-task plasticity control (NPC) uses forward KL to acquire the incoming expert’s behavior, while old-task stability control (OSC) constrains reverse KL to the current merged model to preserve existing behavior. (c) Tensor-level conflict-aware plasticity budgeting (CAPB) uses local gradient probes to identify conflicts and restrict gate updates toward the incoming expert in conflicting tensors.
Method
WebShop
Tool
Search
ALFWorld
Avg ↑
IID
OOD
Base model and individual experts
Qwen2.5-7B-Instruct
0.00
7.00
12.49
20.71
15.67
11.18
WebShop expert
78.00
4.00
7.34
24.29
20.90
26.90
Tool expert
0.00
30.00
12.74
10.71
13.43
13.38
Search expert
0.80
11.00
24.34
9.29
10.45
11.18
Table 1: Final SR (%) after four experts. Continual methods use WTSA; batch methods use the same experts. Avg averages five task columns. Yellow highlights expert domains; blue highlights BACAM. Bold / underline mark the best/second-best merging results.
Figure 3: BACAM’s stage-wise SR (%) under four arrival orders. W, T, S, and A denote WebShop, Tool, Search, and ALFWorld. Cell values are SR; shading shows SR relative to the corresponding expert. — marks tasks not yet integrated.
Method
WebShop
Tool
Search
ALFWorld
Avg ↑
IID
OOD
Reference methods
WUDI-Merging
38.20
0.00
25.14
72.14
70.15
41.13
OPCM
22.60
1.00
21.52
46.43
41.79
26.67
(1) Task-level behavioral constraints
Forward KL for all tasks
76.80
30.00
23.30
89.29
85.07
60.89
Table 2: Four-expert ablation SR (%) under WTSA. WUDI-Merging and OPCM are reference methods.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Setting
WebShop
Tool
Search
ALFWorld
Evaluation instances
500
100
2,017
140/134
Temperature
0.4
0.001
0
0.4
Max. output tokens
512
4,096
8,192
512
Context length
8,192
32,768
8,192
8,192
Recent history steps
2
–
–
2
Max. environment steps
15
–
–
50
Appendix
Table 3: Evaluation settings. ALFWorld instance counts are shown as IID/OOD; – indicates that a setting does not apply or has no fixed limit.
Setting
Value
Rollout-refresh rounds per stage
3
Gate updates per round
20 / 30 / 50
Training states per task stream per round
256
States per update per task stream
16
Probe trajectories per task stream
24
Gate learning rate / schedule
2×10−2 / cosine
Appendix
Table 4: Optimization settings shared by the measured BACAM runs.
Method
Task instances
Optimization signal
RAM / RAM++
None
Shared/unique task-vector statistics
Other instance-free baselines
None
Parameter-derived rules or objectives; no sample-level targets
Token distributions from the incoming expert and current merged model
Appendix
Table 5: Task-instance access and optimization signals during merging. Instance-dependent methods use unlabeled data; teacher targets are model-generated.
Method
2 experts
3 experts
WebShop
Tool
Avg
WebShop
Tool
Search
Avg
General model merging
Weight Average
26.60
1.00
13.80
7.00
0.00
22.21
9.74
Task Arithmetic
26.60
1.00
13.80
24.60
1.00
21.86
15.82
TIES-Merging
31.20
0.00
15.60
30.60
0.00
16.31
15.64
TSV-Merge
35.40
1.00
18.20
36.80
0.00
23.75
20.18
Appendix
Table 6: SR (%) after merging two or three experts. Avg is computed within each expert group. Continual methods follow WebShop → Tool → Search; batch methods merge the same expert subset in each group. Blue shading marks BACAM. Bold and underlined values mark the highest and second-highest measured results per column; ties share the same mark.
Method
ALFWorld Round ↓
WebShop
IID
OOD
TS ↑
Round ↓
Base model and individual experts
Qwen2.5-7B-Instruct
44.34
46.19
1.79
14.78
Search expert
48.00
47.10
4.45
14.49
Tool expert
47.32
47.19
1.96
14.85
ALFWorld expert
8.43
12.52
25.16
11.46
Appendix
Table 7: Task score and interaction length for all evaluated models. WebShop TS is on a 0–100 scale. Round averages interaction steps over all episodes, including failures. SR results appear in Table 1 .
Figure 4: Value-projection tensors during ALFWorld integration in TWAS. (a) Mean gate change by layer, with layers 14–19 highlighted. (b) Final-refresh budgets for Tool and WebShop. Lower budgets restrict updates toward the incoming expert more strongly; WebShop has lower budgets across the highlighted layers.
Figure 6: Layer-wise diagnostics across TWAS integrations. Rows follow incoming WebShop, ALFWorld, and Search experts; columns show (a) mean absolute gate movement and (b) minimum plasticity budget by layer and weight type. Lower budgets restrict updates toward the incoming expert more strongly, with tighter limits in selected tensors.
Figure 7: Tensor-level gate movement versus minimum plasticity budget across TWAS integrations. Each point is one tensor; (a)–(c) correspond to incoming WebShop, ALFWorld, and Search experts. Lower budgets restrict updates toward the incoming expert more strongly.
Figure 8: Value-projection tensors during WebShop integration in SAWT. (a) Mean gate change by layer, with layers 14–19 highlighted. (b) Final-refresh budgets for Search and ALFWorld. Lower budgets restrict updates toward the incoming expert more strongly; ALFWorld has lower budgets across the highlighted layers.
Figure 9: Gate movement and plasticity budgets across SAWT integrations, ordered by incoming ALFWorld, WebShop, and Tool experts. (a) Per-refresh mean absolute gate change, which declines across stages; (b) movement share by tensor family, dominated by MLP; (c) median minimum budget by family, where lower values impose stricter limits on updates toward the incoming expert; and (d) cross-stage Spearman rank correlations, showing more persistent movement than budgets.
Figure 10: Layer-wise diagnostics across SAWT integrations. Rows follow incoming ALFWorld, WebShop, and Tool experts; columns show (a) mean absolute gate movement and (b) minimum plasticity budget by layer and weight type. Lower budgets restrict updates toward the incoming expert more strongly.
Figure 11: Tensor-level gate movement versus minimum plasticity budget across SAWT integrations. Each point is one tensor; (a)–(c) correspond to incoming ALFWorld, WebShop, and Tool experts. Lower budgets restrict updates toward the incoming expert more strongly.