SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.12491 · 2022

ModelDiff: A Framework for Comparing Learning Algorithms

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 5 have no contract verdict; 0 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/2211.12491.json · badge: /api/ran/2211.12491.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
madrylab/modeldiff canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
get_model Ran
ran on a synthesized input
madrylab/modeldiff/counterfactuals/eval_waterbirds_humanface.py
code served (permissive licence) · get_code("ac04d374ee116819")
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 Linear. 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
from pathlib import Path
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory structure to mimic the expected model directory layout
temp_dir = tempfile.mkdtemp()
models_dir = temp_dir

# Create the directory structure that get_model expects
datamodel_name = 'IN'
index = 0
model_dir = Path(models_dir) / 'waterbirds_imagenet' / 'workers' / str(index)
model_dir.mkdir(parents=True, exist_ok=True)

# Create a simple model and save it
simple_model = torch.nn.Linear(4, 2)
checkpoint_path = model_dir / 'checkpoint_best.pt'
torch.save(simple_model, checkpoint_path)

ARGS = {
    'index': 0,
    'datamodel_name': 'IN',
    'models_dir': models_dir,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
get_residual_attributions Ran
ran on a synthesized input
madrylab/modeldiff/modeldiff/pca.py
code served (permissive licence) · get_code("999976313130caee")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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)

# Create small tensors for scores_A and scores_B
# Shape: [num_test x num_train]
# Using distinct dimensions: 2 test samples, 4 train samples
scores_A = torch.randn(2, 4)
scores_B = torch.randn(2, 4)

ARGS = {
    "scores_A": scores_A,
    "scores_B": scores_B,
}
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 ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
get_thresholded_image Ran
ran on a synthesized input
madrylab/modeldiff/counterfactuals/eval_living17_spiderweb.py
code served (permissive licence) · get_code("ad183272834a0d18")
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 3, dtype family float, shape (3, 4, 5) 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 torchvision.transforms as T

torch.manual_seed(0)

# The function expects:
# - img: a normalized tensor with shape (C, H, W) where C=3
# - threshold: a scalar float value

# Create a small normalized image tensor
# Shape: (3, 4, 5) for (channels, height, width)
img = torch.randn(3, 4, 5)

# Create a threshold value
threshold = 0.5

ARGS = {
    "img": img,
    "threshold": threshold,
}
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 Tensor, ndim 3, dtype family float, shape (3, 4, 5) — shape (3, 4, 5) 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
get_variance_along_directions Ran
ran on a synthesized input
madrylab/modeldiff/modeldiff/pca.py
code served (permissive licence) · get_code("e99be7f1664ac47f")
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 ndarray, ndim 1, dtype family float, shape (3,) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Create small tensors with distinct dimensions
# X: [num_test x num_train] - data attribution matrix
num_test = 2
num_train = 4
X = torch.randn(num_test, num_train)

# P: [num_comp x num_train] - directions in train set space
num_comp = 3
P = torch.randn(num_comp, num_train)

# device parameter
device = 'cpu'

# batch_size parameter
batch_size = 2

ARGS = {
    'X': X,
    'P': P,
    'device': device,
    'batch_size': batch_size
}
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 ndarray, ndim 1, dtype family float, shape (3,) — shape (3,) 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
residual_pca Ran
ran on a synthesized input
madrylab/modeldiff/modeldiff/pca.py
code served (permissive licence) · get_code("941e064be06d7c71")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Create small test tensors
# scores_A: [num_test x num_train] - 2 test samples, 4 train samples
scores_A = torch.randn(2, 4)

# scores_B: [num_test x num_train] - same shape as scores_A
scores_B = torch.randn(2, 4)

# num_pca_comps: number of PCA components (must be <= min(num_test, num_train))
num_pca_comps = 2

ARGS = {
    'scores_A': scores_A,
    'scores_B': scores_B,
    'num_pca_comps': num_pca_comps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
get_model Not yet run
unverified (harvested, no recorded run)
madrylab/modeldiff/counterfactuals/eval_cifar_blackwhite.py
code served (permissive licence) · get_code("acf9b3d8d24c36de")
How it ran

no invocation recorded.

get_model Not yet run
unverified (harvested, no recorded run)
madrylab/modeldiff/counterfactuals/eval_living17_polkadots.py
code served (permissive licence) · get_code("8ea06aa985e30d40")
How it ran

no invocation recorded.

get_model Not yet run
unverified (harvested, no recorded run)
madrylab/modeldiff/counterfactuals/eval_waterbirds_yellowcolor.py
code served (permissive licence) · get_code("5f2b6f178e47ba0a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

We study the problem of (learning) algorithm comparison, where the goal is to find differences between models trained with two different learning algorithms. We begin by formalizing this goal as one of finding distinguishing feature transformations, i.e., input transformations that change the predictions of models trained with one learning algorithm but not the other. We then present ModelDiff, a method that leverages the datamodels framework (Ilyas et al., 2022) to compare learning algorithms based on how they use their training data. We demonstrate ModelDiff through three case studies, comparing models trained with/without data augmentation, with/without pre-training, and with different SGD hyperparameters. Our code is available at https://github.com/MadryLab/modeldiff .

For agents

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

get_harvested_code_for_paper("2211.12491")
get_code_for_paper("2211.12491")
have("2211.12491")

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

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

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

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

Connect an agent — have() is free.