SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.14389 · ICML · 2024

SurgeryV2: Bridging the Gap Between Model Merging and Multi-Task Learning with Deep Representation Surgery

Dacheng Tao, Jie Zhang, Li Shen, Zhenyi Wang, Enneng Yang, Guibing Guo, Xingwei Wang, Xiaochun Cao

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2410.14389.json · badge: /api/ran/2410.14389.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
EnnengYang/SurgeryV2 canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
ennengyang/surgeryv2 canonical (classifier label)
classifier basis: classifier_2025
1 ran · 1 no recorded run
FunctionStatusWhere it lives
cosine_lr Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from BAIKLAB/SiM, is pointer only (licence: NONE) · get_code("2d5d7a12d8de02b7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_merging_cofficients Ran
ran, honoured the contract we drafted
EnnengYang/SurgeryV2/src/merging_cofficient.py
pointer only (licence: NONE) · get_code("f52df35accf87444")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

l1losses Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/merging_model.py
pointer only (licence: NONE) · get_code("2ca594138c45f6d6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_functional Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/merging_model.py
pointer only (licence: NONE) · get_code("8adbe30621fbeb18")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

softmax_entropy Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/merging_model.py
pointer only (licence: NONE) · get_code("0c501eba6aaad5fa")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

split_train_into_train_val Ran
ran; our contract draft was wrong, not the code
ennengyang/surgeryv2/src/datasets/registry.py
pointer only (licence: NONE) · get_code("1e9d453dc1605e8c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ennengyang/surgeryv2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

state_dict_to_vector Ran
ran, honoured the contract we drafted
EnnengYang/SurgeryV2/src/ties_merging_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from thunlp-mt/adamms, is pointer only (licence: NONE) · get_code("72391ca34e9a8cfe")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

vector_to_state_dict Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/ties_merging_utils.py
pointer only (licence: NONE); the stored copy get_code serves, from thunlp-mt/adamms, is pointer only (licence: NONE) · get_code("bf6efec91354af72")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

vector_to_state_dict_unsort Ran
ran; our contract draft was wrong, not the code
EnnengYang/SurgeryV2/src/ties_merging_utils.py
pointer only (licence: NONE) · get_code("2b9cb736cd2df186")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

ModelWrapper_Surgery_V2 Not yet run
unverified (harvested, no recorded run)
ennengyang/surgeryv2/src/merging_model.py
pointer only (licence: NONE) · get_code("539d129135c1c4c8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ennengyang/surgeryv2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

accuracy Not yet run
unverified (harvested, no recorded run)
EnnengYang/SurgeryV2/src/utils.py
pointer only (licence: NONE) · get_code("aafcff3ad1ccef6e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

torch_load_old Not yet run
unverified (harvested, no recorded run)
EnnengYang/SurgeryV2/src/utils.py
pointer only (licence: NONE); the stored copy get_code serves, from BAIKLAB/SiM, is pointer only (licence: NONE) · get_code("7d051a7adefedb6c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, EnnengYang/SurgeryV2 when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 4 the same month, 6 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
accuracy 22 other papers
11 dated earlier, 1 the same month, 9 later, 1 same year, order not determinable
2207.05333 (2022-07)
IDEA: Increasing Text Diversity via Online Multi-Label Recognition for Vision-Language Pre-training
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2211.12914 (2022-11)
Open-vocabulary Attribute Detection
and 19 more not named here
cosine_lr 11 other papers
3 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2305.12827 (2023-05)
Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models
2308.12213 (2023-08)
CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
and 8 more not named here
softmax_entropy 7 other papers
4 dated earlier, 1 the same month, 2 later
2310.02575 (2023-10)
AdaMerging: Adaptive Model Merging for Multi-Task Learning
2402.02705 (2024-02)
Representation Surgery for Multi-Task Model Merging
2407.07089 (2024-07)
Fine-Tuning Attention Modules Only: Enhancing Weight Disentanglement in Task Arithmetic
and 4 more not named here
torch_load_old 7 other papers
1 dated earlier, 1 the same month, 5 later
2305.12827 (2023-05)
Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models
2410.05583 (2024-10)
NegMerge: Sign-Consensual Weight Merging for Machine Unlearning
2412.12153 (2024-12)
Revisiting Weight Averaging for Model Merging
and 4 more not named here
make_functional 4 other papers
4 dated earlier
2310.02575 (2023-10)
AdaMerging: Adaptive Model Merging for Multi-Task Learning
2402.02705 (2024-02)
Representation Surgery for Multi-Task Model Merging
2407.07089 (2024-07)
Fine-Tuning Attention Modules Only: Enhancing Weight Disentanglement in Task Arithmetic
and 1 more not named here
state_dict_to_vector 3 other papers
1 dated earlier, 2 later
2405.17461 (2024-05)
EMR-MERGING: Tuning-Free High-Performance Model Merging
2503.23733 (2025-03)
AdaMMS: Model Merging for Heterogeneous Multimodal Large Language Models with Unsupervised Coefficient Optimization
2605.12960 (2026-05)
DiM 3 : Bridging Multilingual and Multimodal Models via Direction-and Magnitude-Aware Merging
vector_to_state_dict 2 other papers
1 dated earlier, 1 later
2405.17461 (2024-05)
EMR-MERGING: Tuning-Free High-Performance Model Merging
2503.23733 (2025-03)
AdaMMS: Model Merging for Heterogeneous Multimodal Large Language Models with Unsupervised Coefficient Optimization
ModelWrapper_Surgery_V2
brick of this paper's assembly: entry
1 other paper
1 dated earlier
2402.02705 (2024-02)
Representation Surgery for Multi-Task Model Merging

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Model merging-based multitask learning (MTL) offers a promising approach for performing MTL by merging multiple expert models without requiring access to raw training data. However, in this paper, we examine the merged model's representation distribution and uncover a critical issue of "representation bias". This bias arises from a significant distribution gap between the representations of the merged and expert models, leading to the suboptimal performance of the merged MTL model. To address this challenge, we first propose a representation surgery solution called Surgery. Surgery is a lightweight, task-specific module that aligns the final layer representations of the merged model with those of the expert models, effectively alleviating bias and improving the merged model's performance. Despite these improvements, a performance gap remains compared to the traditional MTL method. Further analysis reveals that representation bias phenomena exist at each layer of the merged model, and aligning representations only in the last layer is insufficient for fully reducing systemic bias because biases introduced at each layer can accumulate and interact in complex ways. To tackle this, we then propose a more comprehensive solution, deep representation surgery (also called SurgeryV2), which mitigates representation bias across all layers, and thus bridges the performance gap between model merging-based MTL and traditional MTL. Finally, we design an unsupervised optimization objective to optimize both the Surgery and SurgeryV2 modules. Our experimental results show that incorporating these modules into state-of-the-art (SOTA) model merging schemes leads to significant performance gains. Notably, our SurgeryV2 scheme reaches almost the same level as individual expert models or the traditional MTL model. The code is available at https://github.com/EnnengYang/SurgeryV2.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.14389")
get_code_for_paper("2410.14389")
have("2410.14389")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2410.14389.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2410.14389.svg)](https://syntology.ai/paper/2410.14389)

Connect an agent — have() is free.