SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.03576 · NeurIPS · 2023

DropPos: Pre-Training Vision Transformers by Reconstructing Dropped Positions

Zhaoxiang Zhang, Haochen Wang, Junsong Fan, Yuxi Wang, Kaiyou Song, Tong Wang

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 (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 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/2309.03576.json · badge: /api/ran/2309.03576.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
Haochen-Wang409/DropPos canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
haochen-wang409/droppos community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
build_dataset Ran
ran; our contract draft was wrong, not the code
Haochen-Wang409/DropPos/util/datasets.py
code served (permissive licence) · get_code("01d32b851b217f4d")
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 ImageListFolder. 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 tempfile
import torch
import torchvision.transforms
from torchvision import datasets, transforms
from torchvision.datasets.folder import default_loader
from timm.data import create_transform
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

torch.manual_seed(0)

# Create temporary directories and files for the dataset
temp_dir = tempfile.mkdtemp()
train_dir = os.path.join(temp_dir, 'train')
val_dir = os.path.join(temp_dir, 'val')
os.makedirs(train_dir, exist_ok=True)
os.makedirs(val_dir, exist_ok=True)

# Create dummy image files
from PIL import Image
import numpy as np

# Create a few dummy images for training
for i in range(2):
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(train_dir, f'img_{i}.jpg'))

# Create a few dummy images for validation
for i in range(2):
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(val_dir, f'img_{i}.jpg'))

# Create annotation files
train_ann_file = os.path.join(temp_dir, 'train.txt')
val_ann_file = os.path.join(temp_dir, 'val.txt')

with open(train_ann_file, 'w') as f:
    f.write('img_0.jpg 0\n')
    f.write('img_1.jpg 1\n')

with open(val_ann_file, 'w') as f:
    f.write('img_0.jpg 5\n')
    f.write('img_1.jpg 10\n')

# Create args object
class Args:
    def __init__(self):
        self.data_path = temp_dir
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5-inc1'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1

args = Args()

ARGS = {
    'is_train': True,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, timm, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ImageListFolder — a ImageListFolder 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
build_transform Ran
ran; our contract draft was wrong, not the code
Haochen-Wang409/DropPos/util/datasets.py
code served (permissive licence) · get_code("b1528b5a179ebd3f")
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 Compose. 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
import torchvision.transforms
from torchvision import datasets, transforms
from timm.data import create_transform
from timm.data.constants import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

torch.manual_seed(0)

class ArgsConfig:
    def __init__(self):
        self.input_size = 224
        self.color_jitter = 0.4
        self.aa = 'rand-m9-mstd0.5-inc1'
        self.reprob = 0.25
        self.remode = 'pixel'
        self.recount = 1

args = ArgsConfig()

ARGS = {
    'is_train': True,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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_layer_id_for_vit Ran
ran, honoured the contract we drafted
Haochen-Wang409/DropPos/util/lr_decay.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from NikolaCenic/ecg-stenosis-cls, is pointer only (licence: NONE) · get_code("89edf5372214b57d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from NikolaCenic/ecg-stenosis-cls, 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.

param_groups_lrd Ran
ran; our contract draft was wrong, not the code
Haochen-Wang409/DropPos/util/lr_decay.py
code served (permissive licence) · get_code("85f8b25dc390a596")
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 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 torch.nn as nn

torch.manual_seed(0)

class MockViT(nn.Module):
    def __init__(self, num_layers=3):
        super().__init__()
        self.patch_embed = nn.Linear(3, 4)
        self.cls_token = nn.Parameter(torch.randn(1, 1, 4))
        self.pos_embed = nn.Parameter(torch.randn(1, 9, 4))
        
        self.blocks = nn.ModuleList([
            nn.TransformerEncoderLayer(d_model=4, nhead=2, dim_feedforward=8, batch_first=True)
            for _ in range(num_layers)
        ])
        
        self.head = nn.Linear(4, 10)
    
    def forward(self, x):
        return self.head(x.mean(dim=1))

model = MockViT(num_layers=3)

ARGS = {
    'model': model,
    'weight_decay': 0.05,
    'no_weight_decay_list': ['cls_token', 'pos_embed'],
    'layer_decay': 0.75
}
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 list, ndim 1, 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
DropPositionMaskedAutoEncoderViT Not yet run
unverified (harvested, no recorded run)
haochen-wang409/droppos/models_DropPos_mae.py
code served (permissive licence) · get_code("387567cd37ab060e")
How it ran

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 (1 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
get_layer_id_for_vit 13 other papers
4 dated earlier, 8 later, 1 same year, order not determinable
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
aaai_25300 (2023 (year only))
Exploring Stochastic Autoregressive Image Modeling for Visual Representation
2301.11445 (2023-01)
3DShape2VecSet: A 3D Shape Representation for Neural Fields and Generative Diffusion Models
and 10 more not named here
build_dataset 1 other paper
1 later
aaai_28296 (2024 (year only))
Semantic-Aware Autoregressive Image Modeling for Visual Representation Learning
build_transform 1 other paper
1 later
aaai_28296 (2024 (year only))
Semantic-Aware Autoregressive Image Modeling for Visual Representation Learning

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

As it is empirically observed that Vision Transformers (ViTs) are quite insensitive to the order of input tokens, the need for an appropriate self-supervised pretext task that enhances the location awareness of ViTs is becoming evident. To address this, we present DropPos, a novel pretext task designed to reconstruct Dropped Positions. The formulation of DropPos is simple: we first drop a large random subset of positional embeddings and then the model classifies the actual position for each non-overlapping patch among all possible positions solely based on their visual appearance. To avoid trivial solutions, we increase the difficulty of this task by keeping only a subset of patches visible. Additionally, considering there may be different patches with similar visual appearances, we propose position smoothing and attentive reconstruction strategies to relax this classification problem, since it is not necessary to reconstruct their exact positions in these cases. Empirical evaluations of DropPos show strong capabilities. DropPos outperforms supervised pre-training and achieves competitive results compared with state-of-the-art selfsupervised alternatives on a wide range of downstream benchmarks. This suggests that explicitly encouraging spatial reasoning abilities, as DropPos does, indeed contributes to the improved location awareness of ViTs. The code is publicly available at https://github.com/Haochen-Wang409/DropPos.

For agents

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

get_harvested_code_for_paper("2309.03576")
get_code_for_paper("2309.03576")
have("2309.03576")

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

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

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

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

Connect an agent — have() is free.