SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.07613 · 2024

Token Turing Machines are Efficient Vision Models

arXiv · PDF · Open in the Atlas

Code that ran

11 of 14 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; 10 failures of our instrument; 3 no recorded run), measured 2026-11-21; 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/2409.07613.json · badge: /api/ran/2409.07613.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
pjjajal/efficientttms canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
apply_flexi_patch_embed Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/models/flexivit/apply.py
code served (permissive licence) · get_code("864d874e1a38fae9")
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 SimpleModel. 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
from typing import Tuple

torch.manual_seed(0)

# Mock the pi_resize_patch_embed function since it's not defined in the provided code
def pi_resize_patch_embed(tensor, new_patch_size, interpolation='bicubic', antialias=True):
    """Mock function that simulates resizing patch embeddings"""
    return torch.randn_like(tensor)

# Inject the mock into the module namespace
import sys
current_module = sys.modules[__name__]
current_module.pi_resize_patch_embed = pi_resize_patch_embed

# Create a minimal nn.Module that has state_dict and load_state_dict methods
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Create two dummy parameters with meaningful names
        self.register_buffer('process_emb', torch.randn(4, 3))
        self.register_buffer('patch_emb', torch.randn(4, 3))
    
    def forward(self, x):
        return x

# Instantiate the model
model = SimpleModel()

# Define arguments for apply_flexi_patch_embed
ARGS = {
    'model': model,
    'process_embedding_name': 'process_emb',
    'patch_embedding_name': 'patch_emb',
    'new_patch_size': (2, 2),
    'interpolation': 'bicubic',
    'antialias': True
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
benchmark_compvit_milliseconds Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/benchmark.py
code served (permissive licence) · get_code("88000e625cf8cf24")
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 Measurement. 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

torch.manual_seed(0)

# Create a small input tensor (batch_size=2, channels=3, height=4, width=4)
x = torch.randn(2, 3, 4, 4)

# Create a minimal nn.Module that implements forward()
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, kernel_size=3, padding=1)
    
    def forward(self, x):
        return self.conv(x)

model = SimpleModel()

ARGS = {
    'x': x,
    'model': model
}
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 Measurement — a Measurement output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Measurement 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
create_directory Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/train_lt.py
code served (permissive licence) · get_code("024778ed3c596e91")
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 PosixPath. 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.

from pathlib import Path
import tempfile

# Create a temporary directory to use as the base path
temp_dir = tempfile.mkdtemp()
save_base_path = Path(temp_dir)

# Create a timestamp-like string
now = "2024-01-15_10-30-45"

# Define arguments for create_directory
ARGS = {
    "save_base_path": save_base_path,
    "now": now,
    "i": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
deit3_small_patch16_224 Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/models/deit/deit.py
code served (permissive licence) · get_code("c61aa5f384e32ab3")
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 DeiT. 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

torch.manual_seed(0)

ARGS = {
    'pretrained': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DeiT — a DeiT output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DeiT 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
deit_tiny_patch16_224 Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/models/deit/deit.py
code served (permissive licence) · get_code("fa4c5a0e665092f9")
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 DeiT. 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
from functools import partial
from timm.models._builder import build_model_with_cfg
from timm.models.vision_transformer import Block, VisionTransformer, checkpoint_filter_fn
from timm.models.deit import VisionTransformerDistilled

torch.manual_seed(0)

# Set up minimal arguments for deit_tiny_patch16_224
ARGS = {
    'pretrained': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DeiT — a DeiT output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DeiT 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
deit_wrapped_class Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/models/deit/deit.py
code served (permissive licence) · get_code("a18e03e2956626a5")
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 type. 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

torch.manual_seed(0)

# Create a minimal base model class that has the methods called by DeiT.forward
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward_features(self, x):
        # Simulates feature extraction
        return self.linear1(x)
    
    def forward_head(self, x, pre_logits=False):
        # Simulates head processing
        if pre_logits:
            return x
        return self.linear2(x)

ARGS = {
    "model_cls": MinimalModel
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
device_info Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/benchmark.py
code served (permissive licence) · get_code("0845f7660a1bdac8")
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 str. 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

class Args:
    def __init__(self, device):
        self.device = device

ARGS = {
    'args': Args(device='cpu')
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
interpolate_resize_patch_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pjjajal/efficientttms/models/flexivit/patch_embed.py
code served (permissive licence) · get_code("ebdf26e4a36a2e07")
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 4, dtype family float, shape (2, 3, 8, 10) 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 torch.nn.functional as F

torch.manual_seed(0)

# Create a small 4D patch embedding tensor [d, c, h, w]
# Using distinct sizes: d=2, c=3, h=4, w=5
patch_embed = torch.randn(2, 3, 4, 5)

# Target patch size [height, width]
new_patch_size = (8, 10)

# Interpolation mode
interpolation = 'bicubic'

# Antialias flag
antialias = True

ARGS = {
    'patch_embed': patch_embed,
    'new_patch_size': new_patch_size,
    'interpolation': interpolation,
    'antialias': antialias
}
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 Tensor, ndim 4, dtype family float, shape (2, 3, 8, 10) — shape (2, 3, 8, 10) 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
make_normalize_transform Ran
ran; our contract draft was wrong, not the code
pjjajal/efficientttms/datasets/imagenet21k/augment.py
code served (permissive licence) · get_code("12acaf3b4607fdc2")
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 Normalize. 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 torchvision.transforms.v2 as tvt
from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD

torch.manual_seed(0)

ARGS = {
    "mean": IMAGENET_DEFAULT_MEAN,
    "std": IMAGENET_DEFAULT_STD,
}
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 Normalize — a Normalize output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Normalize 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
pi_resize_patch_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
pjjajal/efficientttms/models/flexivit/patch_embed.py
code served (permissive licence) · get_code("d0460ecffe0b6043")
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 4, dtype family float, shape (2, 3, 6, 7) 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 a patch embedding tensor of shape [d, c, h, w]
# d=2 (output channels/depth)
# c=3 (input channels)
# h=4, w=5 (old patch size)
patch_embed = torch.randn(2, 3, 4, 5)

# Target patch size [height, width]
new_patch_size = (6, 7)

# Interpolation mode
interpolation = 'bicubic'

# Antialias flag
antialias = True

ARGS = {
    'patch_embed': patch_embed,
    'new_patch_size': new_patch_size,
    'interpolation': interpolation,
    'antialias': antialias,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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 4, dtype family float, shape (2, 3, 6, 7) — shape (2, 3, 6, 7) 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
to_2tuple Ran
ran, honoured the contract we drafted
pjjajal/efficientttms/models/flexivit/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zhu-xlab/Copernicus-FM, is pointer only (licence: NOASSERTION) · get_code("b1ae1923a93132d9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zhu-xlab/Copernicus-FM, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

deit_factory Not yet run
unverified (harvested, no recorded run)
pjjajal/efficientttms/models/deit/factory.py
code served (permissive licence) · get_code("b29923d8aac4281f")
How it ran

no invocation recorded.

lookupvit_factory Not yet run
unverified (harvested, no recorded run)
pjjajal/efficientttms/models/lookup/factory.py
code served (permissive licence) · get_code("abc0a4dfdaf48399")
How it ran

no invocation recorded.

resize_abs_pos_embed Not yet run
unverified (harvested, no recorded run)
pjjajal/efficientttms/models/flexivit/utils.py
code served (permissive licence) · get_code("2db8a00b5d8b2436")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 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
pi_resize_patch_embed 3 other papers
1 dated earlier, 2 later
2212.08013 (2022-12)
FlexiViT: One Model for All Patch Sizes
2503.11849 (2025-03)
Towards a Unified Copernicus Foundation Model for Earth Vision
2507.09391 (2025-07)
Geometric Generative Modeling with Noise-Conditioned Graph Networks
to_2tuple 3 other papers
1 dated earlier, 2 later
2212.08013 (2022-12)
FlexiViT: One Model for All Patch Sizes
2503.11849 (2025-03)
Towards a Unified Copernicus Foundation Model for Earth Vision
2507.09391 (2025-07)
Geometric Generative Modeling with Noise-Conditioned Graph Networks
resize_abs_pos_embed 2 other papers
1 dated earlier, 1 later
2212.08013 (2022-12)
FlexiViT: One Model for All Patch Sizes
2503.11849 (2025-03)
Towards a Unified Copernicus Foundation Model for Earth Vision
interpolate_resize_patch_embed 1 other paper
1 dated earlier
2212.08013 (2022-12)
FlexiViT: One Model for All Patch Sizes

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-21.

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 propose Vision Token Turing Machines (ViTTM), an efficient, low-latency, memory-augmented Vision Transformer (ViT). Our approach builds on Neural Turing Machines and Token Turing Machines, which were applied to NLP and sequential visual understanding tasks. ViTTMs are designed for non-sequential computer vision tasks such as image classification and segmentation. Our model creates two sets of tokens: process tokens and memory tokens; process tokens pass through encoder blocks and read-write from memory tokens at each encoder block in the network, allowing them to store and retrieve information from memory. By ensuring that there are fewer process tokens than memory tokens, we are able to reduce the inference time of the network while maintaining its accuracy. On ImageNet-1K, the state-of-the-art ViT-B has median latency of 529.5ms and 81.0% accuracy, while our ViTTM-B is 56% faster (234.1ms), with 2.4 times fewer FLOPs, with an accuracy of 82.9%. On ADE20K semantic segmentation, ViT-B achieves 45.65mIoU at 13.8 frame-per-second (FPS) whereas our ViTTM-B model acheives a 45.17 mIoU with 26.8 FPS (+94%).

For agents

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

get_harvested_code_for_paper("2409.07613")
get_code_for_paper("2409.07613")
have("2409.07613")

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

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

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

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

Connect an agent — have() is free.