Despite the continuous research and evolution of language models, they sometimes underperform previous versions. Existing approaches to overcome these challenges are resource-intensive, highlighting the need for alternatives that enable immediate action. We assume that each language model has a local module inside that is suitable for a specific function. First, this work identifies a set of modules showing consistent and local activation changes under an inference workload through activation-based analysis. Subsequently, we transplant an internal module that is properly activated for a specific task into the target model, leading to immediate and measurable functional changes without additional training or fine-tuning. To experimentally demonstrate the effectiveness of the transplant technique, we quantify the relationship between transplant strength and performance improvement under different conditions for two language models. In the cross-generation setting, we find that transplanting activation-selected modules can substantially improve the underperforming model, reaching up to twice the target baseline and achieving gap-based recovery above 100%. Moreover, in transplant experiments between a base model and its instruction-tuned counterpart, transplantation improves the underperforming model toward the stronger baseline, yielding up to about 2.33 times the target baseline with gap-based recovery reaching up to 100% in the best case. These results show that meaningful capacity transfer can be realized through the implantation of highly localized modules implied by language models. Overall, this work provides empirical evidence for task-localized modularity in language models and presents a new research area: model transplantation.
Figures & tables
Figure 1: Illustration of module-level transplantability in language models.
Component
Phi-3-mini-4k
Phi-3.5-mini
Gemma-2-2B
Gemma-2-2B-IT
Context Length
4,096 tokens
128K tokens
8K tokens
8K tokens
Vocabulary Size
32,064 tokens
32,064 tokens
256K tokens
256K tokens
Architecture
Decoder-only
Decoder-only
Decoder-only
Decoder-only
Training Corpus
Curated Phi-3 dataset
Expanded Phi-3.5 data
Gemma pretraining corpus
Gemma pretraining corpus + instruction tuning
Table 1: Comparison of key architectural and training characteristics across Phi and Gemma model variants.
Model Pair
Tokens
Dir.
Acc target (%)
Acc source (%)
Acc after (%)
Best K
TIR
Recovery (%)
Intervention Type
Phi-3 (A) ↔ Phi-3.5 (B)
32
B → A
6.0
8.0
12.0
16
2.00
300.0
FFN + Attention
64
A → B
16.0
20.0
20.0
16
1.25
100.0
FFN + Attention
128
A → B
16.0
30.0
26.0
64
1.625
71.4
FFN + Attention
256
A → B
34.0
34.0
36.0
8
1.059
–
FFN + Attention
512
B → A
36.0
40.0
40.0
8
1.111
100.0
FFN + Attention
Table 2: Best-performing transplantation settings between Phi-3 and Phi-3.5 across decoding token lengths.
K
FFN count
Attn count
Attn ratio
8
7
1
0.125
16
12
4
0.250
32
14
18
0.563
64
25
39
0.609
128
64
64
0.500
Table 3: Intervention composition as a function of transplantation scale K for Phi-3 ↔ Phi-3.5.
Figure 2: The TIR and Recovery of Phi-3 ↔ Phi-3.5 as a function of the number of transplanted modules K for different decoding lengths with max_new_tokens .
Model Pair
Tokens
Dir.
Acc B (%)
Acc A (%)
Acc after (%)
Best K
TIR
Recovery (%)
Intervention Type
Gemma-2-2B-IT (A) ↔ Gemma-2-2B (B)
32
B → A
10.0
6.0
10.0
128
1.667
100.0
FFN + Attention
64
A → B
8.0
8.0
8.0
32
1.000
–
FFN + Attention
128
A → B
6.0
22.0
10.0
64
1.667
25.0
FFN + Attention
256
A → B
6.0
36.0
12.0
64
2.000
20.0
FFN + Attention
512
A → B
6.0
30.0
14.0
64
2.333
33.3
FFN + Attention
Table 4: Best-performing transplantation settings between Gemma-2-2B and Gemma-2-2B-IT across decoding token lengths.
K
FFN count
Attn count
Attn ratio
8
0
8
1.000
16
2
14
0.875
32
2
30
0.938
64
7
57
0.891
128
39
89
0.695
Table 5: Intervention composition as a function of transplantation scale K for Gemma-2-2B-IT ↔ Gemma-2-2B.
Figure 3: The TIR and Recovery of Gemma-2-2B-IT ↔ Gemma-2-2B as a function of the number of transplanted modules K for different decoding lengths with max_new_tokens .