SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.03053 · 2023

ZipIt! Merging Models from Different Tasks without Training

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 3 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/2305.03053.json · badge: /api/ran/2305.03053.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
gstoica27/zipit canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
create_df Ran
ran on a synthesized input
gstoica27/zipit/non_imnet_evaluation_scripts/zipit_concept_merging.py
code served (permissive licence) · get_code("b35b2bfe810e02a0")
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 DataFrame. 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 numpy as np
import pandas as pd

# Analyze the function:
# - create_df takes search_results parameter
# - It iterates over search_results.items() expecting key-value pairs
# - Values are expected to be dicts (results) that get passed to dict_update
# - dict_update expects dicts with keys mapping to either lists or scalar values
# - The function transposes np.array(list(base.values())) so all values must be iterables of same length
# - Creates a DataFrame from the resulting 2D array

# Construct search_results: dict of dicts
# Each inner dict has string keys mapping to lists (which will be transposed into rows)
search_results = {
    "search_1": {
        "feature_a": [1, 2],
        "feature_b": [3, 4],
        "feature_c": [5, 6]
    },
    "search_2": {
        "feature_d": [7, 8],
        "feature_e": [9, 10]
    }
}

ARGS = {
    "search_results": search_results
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family int describe that coercion, not the output, and are not 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
create_subsets Ran
ran on a synthesized input
gstoica27/zipit/datasets/imagenet_pytorch_to_ffcv.py
code served (permissive licence) · get_code("fb95252bd0e6f666")
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. 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 numpy as np
from torch.utils.data import Dataset

torch.manual_seed(0)

class SimpleDataset(Dataset):
    def __init__(self, num_samples=10, num_classes=4):
        self.num_samples = num_samples
        self.num_classes = num_classes
        self.classes = [f'class_{i}' for i in range(num_classes)]
        self.targets = [i % num_classes for i in range(num_samples)]
        self.data = torch.randn(num_samples, 4)
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

train_dset = SimpleDataset(num_samples=12, num_classes=4)
test_dset = SimpleDataset(num_samples=8, num_classes=4)

model_class_splits = [
    [0, 1],
    ['class_2', 'class_3'],
    np.array([1, 3], dtype=np.int64)
]

ARGS = {
    'train_dset': train_dset,
    'test_dset': test_dset,
    'model_class_splits': model_class_splits
}
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 — a list 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
dict_update Ran
ran on a synthesized input
gstoica27/zipit/non_imnet_evaluation_scripts/zipit_concept_merging.py
code served (permissive licence) · get_code("26301db692522f51")
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 dict. 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - dict_update(d, u) takes two parameters: d and u
# - d is a dict that gets modified
# - u is a dict with items()
# - The function iterates through u.items()
# - For each value v in u:
#   - If v is a list, append it to d[k] (or create empty list first)
#   - Otherwise, set d[k] = v
# - Returns the modified d

# Create test dictionaries
d = {
    "existing_key": 42,
    "list_key": [1, 2],
    "nested": {"a": 1}
}

u = {
    "new_scalar": 100,
    "new_list": [3, 4, 5],
    "list_key": [6, 7],  # This should be appended to d["list_key"]
    "tensor_value": torch.randn(2, 4)
}

ARGS = {
    "d": d,
    "u": u
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
generate_random_class_splits Ran
ran on a synthesized input
gstoica27/zipit/datasets/imagenet_pytorch_to_ffcv.py
code served (permissive licence) · get_code("f7b72bbb20075e3f")
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. 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 numpy as np
from sklearn.model_selection import train_test_split

# Set random seed for reproducibility
np.random.seed(0)

# Define arguments for generate_random_class_splits
ARGS = {
    "total_classes": 10,
    "split_proportions": [0.6, 0.2, 0.2]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
get_task_mapping Ran
ran on a synthesized input
gstoica27/zipit/non_imnet_evaluation_scripts/zipit_concept_merging.py
code served (permissive licence) · get_code("25dcab2fb8ad45d5")
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 Tensor, ndim 1, dtype family int, shape (8,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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)

# Analyze the function:
# - labels: iterated over with enumerate, each element checked with "in" against splits
# - splits: iterated over with enumerate, each element is checked with "in" operator against label
# This suggests labels is a list/array of items and splits is a list of collections

# Create simple test data where labels are integers and splits are sets/lists containing those integers
labels = [0, 1, 2, 1, 0]

# splits should be a list where each element supports the "in" operator
# For example, each split could be a set or list of label values
splits = [
    {0, 1},      # split 0 contains labels 0 and 1
    {1, 2},      # split 1 contains labels 1 and 2
    {2},         # split 2 contains label 2
]

ARGS = {
    "labels": labels,
    "splits": splits,
}
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 Tensor, ndim 1, dtype family int, shape (8,) — shape (8,) as a later run recorded it
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
load_meta_file Ran
ran; our contract draft was wrong, not the code
gstoica27/zipit/datasets/imagenet_class.py
code served (permissive licence) · get_code("9e5419c45da574db")
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 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 os
import torch
import tempfile
from typing import Dict, List, Tuple

torch.manual_seed(0)

# Create a temporary directory to use as root
temp_dir = tempfile.mkdtemp()

# Create a mock meta file with valid content
meta_content = (
    {
        "class_to_idx": {"cat": 0, "dog": 1},
        "idx_to_class": {0: "cat", 1: "dog"}
    },
    ["cat", "dog"]
)

# Save the meta file to the temporary directory
meta_file_path = os.path.join(temp_dir, "meta.bin")
torch.save(meta_content, meta_file_path)

# Define ARGS with all parameters
ARGS = {
    "root": temp_dir,
    "file": "meta.bin"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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
prepare_loaders Ran
ran on a synthesized input
gstoica27/zipit/datasets/imagenet.py
code served (permissive licence) · get_code("b1be6a2b6ea086a9")
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 tuple, ndim 1, 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock config dict for prepare_loaders
config = {
    'dir': '/tmp/imagenet_mock',
    'batch_size': 2,
    'device': 'cpu',
    'res': 224,
    'crop_ratio': 224 / 256,
    'inception_norm': True,
    'num_workers': 0,
}

# Mock the ffcv.loader.Loader to avoid file I/O
import sys
from unittest.mock import Mock, patch

mock_loader = Mock()
mock_loader.dataset = Mock()
mock_loader.dataset.__len__ = Mock(return_value=100)
mock_loader.__iter__ = Mock(return_value=iter([
    (torch.randn(2, 3, 224, 224), torch.randint(0, 1000, (2,)))
    for _ in range(5)
]))

# Patch ffcv modules before importing
sys.modules['ffcv'] = MagicMock()
sys.modules['ffcv.loader'] = MagicMock()
sys.modules['ffcv.transforms'] = MagicMock()
sys.modules['ffcv.fields'] = MagicMock()
sys.modules['ffcv.fields.decoders'] = MagicMock()

# Mock the Loader class to return our mock_loader
sys.modules['ffcv.loader'].Loader = Mock(return_value=mock_loader)

ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
ffcv, numpy, timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
split_even Ran
ran on a synthesized input
gstoica27/zipit/datasets/imagenet_pytorch_to_ffcv.py
code served (permissive licence) · get_code("f87d51b0cd440842")
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. 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 numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - total_classes: an integer representing total number of classes
# - split_proportions: a list that is indexed with [0], has len() called on it,
#   and items are deleted from the front (del split_proportions[0])
#   The values are used in multiplication with total_classes and int() conversion
#   suggesting they are numeric (floats representing proportions)

total_classes = 10
split_proportions = [0.5, 0.3, 0.2]

ARGS = {
    "total_classes": total_classes,
    "split_proportions": split_proportions,
}
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 — a list 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
evaluate_ensemble Not yet run
unverified (harvested, no recorded run)
gstoica27/zipit/evaluation_scripts/base_model_concept_merging.py
code served (permissive licence) · get_code("fefce9d2a7890200")
How it ran

no invocation recorded.

get_intervals Not yet run
unverified (harvested, no recorded run)
gstoica27/zipit/evaluation_scripts/base_model_concept_merging.py
code served (permissive licence) · get_code("91459bef0e99ac6d")
How it ran

no invocation recorded.

parse_devkit_archive Not yet run
unverified (harvested, no recorded run)
gstoica27/zipit/datasets/imagenet_class.py
code served (permissive licence) · get_code("9857e199c34a404f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 10 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
load_meta_file 1 other paper
1 later
2411.02853 (2024-11)
ADOPT: Modified Adam Can Converge with Any β 2 with the Optimal Rate

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

Typical deep visual recognition models are capable of performing the one task they were trained on. In this paper, we tackle the extremely difficult problem of combining distinct models with different initializations, each solving a separate task, into one multi-task model without any additional training. Prior work in model merging permutes one model to the space of the other then averages them together. While this works for models trained on the same task, we find that this fails to account for the differences in models trained on disjoint tasks. Thus, we introduce "ZipIt!", a general method for merging two arbitrary models of the same architecture that incorporates two simple strategies. First, in order to account for features that aren't shared between models, we expand the model merging problem to allow for merging features within each model by defining a general "zip" operation. Second, we add support for partially zipping the models up until a specified layer, naturally creating a multi-head model. We find that these two changes combined account for 20-60% improvement over prior work, making it more feasible to merge models trained on disjoint tasks without retraining.

For agents

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

get_harvested_code_for_paper("2305.03053")
get_code_for_paper("2305.03053")
have("2305.03053")

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

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

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

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

Connect an agent — have() is free.