SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.02705 · ICML · 2024

Representation Surgery for Multi-Task Model Merging

Dacheng Tao, Li Shen, Zhenyi Wang, Enneng Yang, Guibing Guo, Xingwei Wang, Xiaojun Chen

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2402.02705.json · badge: /api/ran/2402.02705.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/representationsurgery canonical (classifier label)
classifier basis: census
3 ran · 0 no recorded run
fskong/FT-Classifier-for-Model-Merging community
Papers with Code archive
1 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
TaskVector Ran
ran on a synthesized input · constructed an object; no result was computed
fskong/FT-Classifier-for-Model-Merging/task_vectors.py
pointer only (licence: NONE) · get_code("aeed07d009914ad2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, fskong/FT-Classifier-for-Model-Merging 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/representationsurgery/src/merging_cofficient.py
code served (permissive licence) · get_code("7d3451f3e4348847")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Based on the function body, it only uses the `method` and `model` parameters
# to construct and return a list of lists (ralpha). No other objects are needed.

ARGS = {
    'method': 'task_arithmetic',
    'model': 'ViT-B-32'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_functional Ran
ran; our contract draft was wrong, not the code
ennengyang/representationsurgery/src/merging_model.py
code served (permissive licence) · get_code("8adbe30621fbeb18")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple neural network module with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Instantiate the model
mod = SimpleModel()

# Verify the model has parameters before passing to make_functional
assert len(list(mod.parameters())) > 0, "Model should have parameters"

ARGS = {
    "mod": mod
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
softmax_entropy Ran
ran; our contract draft was wrong, not the code
ennengyang/representationsurgery/src/merging_model.py
pointer only (licence: MIT); the stored copy get_code serves, from EnnengYang/SurgeryV2, is pointer only (licence: NONE) · get_code("0c501eba6aaad5fa")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from EnnengYang/SurgeryV2, and GitHub detected no licence in that repository 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)
this paper's copy was not recorded; identical code first harvested from ennengyang/surgeryv2
pointer only; the stored copy get_code serves, from ennengyang/surgeryv2, is pointer only (licence: NONE) · get_code("539d129135c1c4c8")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 2 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
softmax_entropy 7 other papers
1 dated earlier, 6 later
2310.02575 (2023-10)
AdaMerging: Adaptive Model Merging for Multi-Task Learning
2407.07089 (2024-07)
Fine-Tuning Attention Modules Only: Enhancing Weight Disentanglement in Task Arithmetic
2408.07362 (2024-08)
BadMerging: Backdoor Attacks Against Model Merging
and 4 more not named here
make_functional 4 other papers
1 dated earlier, 3 later
2310.02575 (2023-10)
AdaMerging: Adaptive Model Merging for Multi-Task Learning
2407.07089 (2024-07)
Fine-Tuning Attention Modules Only: Enhancing Weight Disentanglement in Task Arithmetic
2408.07362 (2024-08)
BadMerging: Backdoor Attacks Against Model Merging
and 1 more not named here
ModelWrapper_Surgery_V2
brick of this paper's assembly: entry
1 other paper
1 later
2410.14389 (2024-10)
SurgeryV2: Bridging the Gap Between Model Merging and Multi-Task Learning with Deep Representation Surgery

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-22.

Repositories linked to this paper

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

Abstract

Multi-task learning (MTL) compresses the information from multiple tasks into a unified backbone to improve computational efficiency and generalization. Recent work directly merges multiple independently trained models to perform MTL instead of collecting their raw data for joint training, greatly expanding the application scenarios of MTL. However, by visualizing the representation distribution of existing model merging schemes, we find that the merged model often suffers from the dilemma of representation bias. That is, there is a significant discrepancy in the representation distribution between the merged and individual models, resulting in poor performance of merged MTL. In this paper, we propose a representation surgery solution called "Surgery" to reduce representation bias in the merged model. Specifically, Surgery is a lightweight task-specific module that takes the representation of the merged model as input and attempts to output the biases contained in the representation from the merged model. We then designed an unsupervised optimization objective that updates the Surgery module by minimizing the distance between the merged model's representation and the individual model's representation. Extensive experiments demonstrate significant MTL performance improvements when our Surgery module is applied to state-of-theart (SOTA) model merging schemes. The code is available at https://github.com/ EnnengYang/RepresentationSurgery.

For agents

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

get_harvested_code_for_paper("2402.02705")
get_code_for_paper("2402.02705")
have("2402.02705")

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

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

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

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

Connect an agent — have() is free.