SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1906.05909 · 2019

Stand-Alone Self-Attention in Vision Models

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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; 1 failure of our instrument; 1 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/1906.05909.json · badge: /api/ran/1906.05909.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
JoeRoussy/adaptive-attention-in-cv extension (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
leaderj1001/Stand-Alone-Self-Attention community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
MartinGer/Stand-Alone-Self-Attention-in-Vision-Models reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
get_logger Ran
ran; our contract draft was wrong, not the code
JoeRoussy/adaptive-attention-in-cv/config.py
code served (permissive licence) · get_code("62d701bd9f6f7ffd")
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 Logger. 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 logging.handlers
import tempfile
import shutil

# Create a temporary directory for logs
temp_log_dir = tempfile.mkdtemp()
original_cwd = os.getcwd()
os.chdir(temp_log_dir)

try:
    # Define arguments for get_logger
    ARGS = {
        'filename': 'test_logger'
    }
finally:
    # Cleanup will happen after execution
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
load_data Ran
ran on a synthesized input
leaderj1001/Stand-Alone-Self-Attention/preprocess.py
code served (permissive licence) · get_code("5e6067e23503825f")
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
from unittest.mock import Mock, MagicMock, patch
import sys

torch.manual_seed(0)

# Create a mock args object with all required attributes
class Args:
    def __init__(self):
        self.dataset = 'CIFAR10'
        self.batch_size = 2
        self.num_workers = 0

# Mock the datasets module to avoid actual downloads
sys.modules['torchvision.datasets.cifar'] = MagicMock()
sys.modules['torchvision.datasets.mnist'] = MagicMock()

# Create minimal mock dataset classes
class MockCIFAR10:
    def __init__(self, root, train=True, download=False, transform=None):
        self.data = torch.randn(4, 3, 32, 32)
        self.targets = torch.randint(0, 10, (4,))
        self.transform = transform
    
    def __len__(self):
        return 4
    
    def __getitem__(self, idx):
        img = self.data[idx]
        target = self.targets[idx].item()
        if self.transform:
            img = self.transform(img)
        return img, target

class MockCIFAR100:
    def __init__(self, root, train=True, download=False, transform=None):
        self.data = torch.randn(4, 3, 32, 32)
        self.targets = torch.randint(0, 100, (4,))
        self.transform = transform
    
    def __len__(self):
        return 4
    
    def __getitem__(self, idx):
        img = self.data[idx]
        target = self.targets[idx].item()
        if self.transform:
            img = self.transform(img)
        return img, target

class MockMNIST:
    def __init__(self, root, train=True, download=False, transform=None):
        self.data = torch.randn(4, 1, 28, 28)
        self.targets = torch.randint(0, 10, (4,))
        self.transform = transform
    
    def __len__(self):
        return 4
    
    def __getitem__(self, idx):
        img = self.data[idx]
        target = self.targets[idx].item()
        if self.transform:
            img = self.transform(img)
        return img, target

# Patch the dataset classes
import torchvision.datasets as datasets_module
datasets_module.CIFAR10 = MockCIFAR10
datasets_module.CIFAR100 = MockCIFAR100
datasets_module.MNIST = MockMNIST

ARGS = {
    'args': Args()
}
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, 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
prepare_data Not yet run
unverified (harvested, no recorded run)
MartinGer/Stand-Alone-Self-Attention-in-Vision-Models/train_SASA.py
pointer only (licence: NONE) · get_code("10b86d2ef7ff73c5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, MartinGer/Stand-Alone-Self-Attention-in-Vision-Models 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. No invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 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
prepare_data 2 other papers
1 dated earlier, 1 later
1904.09925 (2019-04)
Attention Augmented Convolutional Networks
2003.07853 (2020-03)
Axial-DeepLab: Stand-Alone Axial-Attention for Panoptic Segmentation

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

Convolutions are a fundamental building block of modern computer vision systems. Recent approaches have argued for going beyond convolutions in order to capture long-range dependencies. These efforts focus on augmenting convolutional models with content-based interactions, such as self-attention and non-local means, to achieve gains on a number of vision tasks. The natural question that arises is whether attention can be a stand-alone primitive for vision models instead of serving as just an augmentation on top of convolutions. In developing and testing a pure self-attention vision model, we verify that self-attention can indeed be an effective stand-alone layer. A simple procedure of replacing all instances of spatial convolutions with a form of self-attention applied to ResNet model produces a fully self-attentional model that outperforms the baseline on ImageNet classification with 12% fewer FLOPS and 29% fewer parameters. On COCO object detection, a pure self-attention model matches the mAP of a baseline RetinaNet while having 39% fewer FLOPS and 34% fewer parameters. Detailed ablation studies demonstrate that self-attention is especially impactful when used in later layers. These results establish that stand-alone self-attention is an important addition to the vision practitioner's toolbox.

For agents

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

get_harvested_code_for_paper("1906.05909")
get_code_for_paper("1906.05909")
have("1906.05909")

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

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

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

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

Connect an agent — have() is free.