SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.01948 · 2024

Learning Where to Edit Vision Transformers

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 1 has no contract verdict; 3 failures of our instrument; 0 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their level, 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/2411.01948.json · badge: /api/ran/2411.01948.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
hustyyq/where-to-edit canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
2 ran · 0 no recorded run
FunctionStatusWhere it lives
np2th Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from jeonsworld/ViT-pytorch
pointer only · get_code("7d8eaf5537f699e4")
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. A run is recorded.

swish Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from jeonsworld/ViT-pytorch
pointer only · get_code("0f786c407fb1ee4c")
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. A run is recorded.

cutmix Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hustyyq/where-to-edit/meta_train.py
code served (permissive licence) · get_code("56db9a284de50890")
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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# The function expects images tensor with shape (batch_size, channels, height, width)
# The function divides batch_size by 2, so we need an even batch size
# Looking at the function: it accesses images[i] and images[i + batch_size]
# It also does slicing like images[:, yl * 16:yh * 16, xl * 16:xh * 16]
# So we need at least 224 pixels in height and width (14 * 16 = 224)
# Let's create a batch of 4 images (so batch_size // 2 = 2)
# with 3 channels and 224x224 spatial dimensions

images = torch.randn(4, 3, 224, 224)

ARGS = {
    "images": images
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
select_data Ran
ran on a synthesized input
hustyyq/where-to-edit/edit_natural.py
code served (permissive licence) · get_code("22b1eb3cd1235e05")
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 list, ndim 1, dtype family int; no output shape is stated. 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 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 torch.nn as nn
from torch.utils.data import DataLoader, Dataset

torch.manual_seed(0)

# Create a minimal classifier that satisfies the function's usage
class MinimalClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 output classes
    
    def forward(self, x):
        # Function expects output, _ = classifier(images)
        # So it returns a tuple of (output, something)
        batch_size = x.size(0)
        logits = self.fc(x.view(batch_size, -1))
        return logits, None

# Create a minimal dataset
class MinimalDataset(Dataset):
    def __init__(self, num_samples=5):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return (image, target) tuple
        # image shape: (1, 4) - 1 channel, 4 features
        # target: class index (0, 1, or 2)
        image = torch.randn(1, 4)
        target = torch.tensor(idx % 3, dtype=torch.long)
        return image, target

# Construct the arguments
classifier = MinimalClassifier()
part_image_net = MinimalDataset(num_samples=5)

ARGS = {
    'part_image_net': part_image_net,
    'classifier': classifier
}
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 list, ndim 1, dtype family int — 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

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 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
swish 206 other papers
183 dated earlier, 19 later, 4 same year, order not determinable · 44 only as an assembly brick
1408.5882 (2014-08)
Convolutional Neural Networks for Sentence Classification
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
1809.01357 (2018-09)
Zero Shot Learning for Code Education: Rubric Sampling with Deep Learning Inference
and 203 more not named here
np2th 35 other papers
32 dated earlier, 2 later, 1 same year, order not determinable · 5 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2102.04306 (2021-02)
TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
2103.07976 (2021-03)
TransFG: A Transformer Architecture for Fine-grained Recognition
and 32 more not named here

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 editing aims to data-efficiently correct predictive errors of large pre-trained models while ensuring generalization to neighboring failures and locality to minimize unintended effects on unrelated examples. While significant progress has been made in editing Transformer-based large language models, effective strategies for editing vision Transformers (ViTs) in computer vision remain largely untapped. In this paper, we take initial steps towards correcting predictive errors of ViTs, particularly those arising from subpopulation shifts. Taking a locate-then-edit approach, we first address the where-to-edit challenge by meta-learning a hypernetwork on CutMix-augmented data generated for editing reliability. This trained hypernetwork produces generalizable binary masks that identify a sparse subset of structured model parameters, responsive to real-world failure samples. Afterward, we solve the how-to-edit problem by simply fine-tuning the identified parameters using a variant of gradient descent to achieve successful edits. To validate our method, we construct an editing benchmark that introduces subpopulation shifts towards natural underrepresented images and AI-generated images, thereby revealing the limitations of pre-trained ViTs for object recognition. Our approach not only achieves superior performance on the proposed benchmark but also allows for adjustable trade-offs between generalization and locality. Our code is available at https://github.com/hustyyq/Where-to-Edit.

For agents

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

get_harvested_code_for_paper("2411.01948")
get_code_for_paper("2411.01948")
have("2411.01948")

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

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

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

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

Connect an agent — have() is free.