SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.08908 · ICCV · 2023

What Can Simple Arithmetic Operations Do for Temporal Modeling?

Chang Xu, Wanli Ouyang, Jingdong Wang, Wenhao Wu, Yuxin Song, Zhun Sun

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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 3 have no contract verdict; 0 failures of our instrument; 3 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/2307.08908.json · badge: /api/ran/2307.08908.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
whwu95/ATM community
Papers with Code archive
3 ran · 3 no recorded run
FunctionStatusWhere it lives
Conv2D_UV2C Ran
ran on a synthesized input
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("252ed3e3ac78c561")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 5, dtype family float, shape (10, 64, 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 torch.nn as nn
from einops import rearrange, reduce, repeat

class Conv2D_UV2C(nn.Module):

    def __init__(self, num_segments, window=(5, 9, 9), chnls=(4, 16, 64, 64)):
        super(Conv2D_UV2C, self).__init__()
        self.num_segments = num_segments
        self.window = window
        self.chnls = chnls
        self.conv0 = nn.Sequential(nn.Conv3d(1, chnls[0], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[0]), nn.ReLU(inplace=True))
        self.conv1 = nn.Sequential(nn.Conv3d(chnls[0], chnls[1], kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[1]), nn.ReLU(inplace=True))
        self.conv2 = nn.Sequential(nn.Conv3d(chnls[1], chnls[2], kernel_size=(1, 3, 3), stride=(1, 2, 2), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[2]), nn.ReLU(inplace=True))
        self.conv3 = nn.Sequential(nn.Conv3d(chnls[2], chnls[3], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 0, 0), bias=False), nn.BatchNorm3d(chnls[3]), nn.ReLU(inplace=True))

    def forward(self, x):
        b, t, h, w, _, l, u, v = x.size()
        x = rearrange(x, 'b t h w 1 l u v -> (b t h w) 1 l u v')
        x = self.conv0(x)
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        x = rearrange(x, '(b t h w) c l 1 1 -> (b l) c t h w', t=t, h=h, w=w)
        return x

INIT_ARGS = {
    'num_segments': 2,
    'window': (5, 9, 9),
    'chnls': (4, 16, 64, 64)
}

ARGS = {
    'x': torch.randn(2, 3, 4, 5, 1, 5, 9, 9)
}

if __name__ == '__main__':
    model = Conv2D_UV2C(**INIT_ARGS)
    model.eval()
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 5, dtype family float, shape (10, 64, 3, 4, 5) — shape (10, 64, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DiffBlock Ran
ran on a synthesized input
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("4c4d884517c1250d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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
import torch.nn.functional as F
from einops import rearrange, reduce, repeat
from einops.layers.torch import Rearrange, Reduce

class DomainTransfer(nn.Module):

    def __init__(self, d_in, d_out, num_segments, context=5, chnls=(64, 64, 64), downsample=True):
        super(DomainTransfer, self).__init__()
        self.num_segments = num_segments
        self.chnls = chnls
        self.conv1 = nn.Sequential(nn.Conv3d(d_in, chnls[0], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[0]), nn.ReLU(inplace=True))
        self.conv2 = nn.Sequential(nn.Conv3d(chnls[0], chnls[1], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[1]), nn.ReLU(inplace=True))
        self.conv3_fuse = nn.Sequential(Rearrange('(b z) c t h w -> b (z c) t h w', z=context), nn.Conv3d(chnls[1] * context, chnls[2], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[2]), nn.ReLU(inplace=True))
        if downsample:
            self.upsample = nn.Sequential(nn.ConvTranspose3d(chnls[2], d_out, kernel_size=1, stride=(1, 2, 2), padding=(0, 0, 0), output_padding=(0, 1, 1), bias=False), Rearrange('b c t h w -> (b t) c h w'))
        else:
            self.upsample = nn.Sequential(nn.Conv3d(chnls[2], d_out, kernel_size=1, stride=(1, 1, 1), padding=(0, 0, 0), bias=False), Rearrange('b c t h w -> (b t) c h w'))
        nn.init.constant_(self.upsample[0].weight, 0)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3_fuse(x)
        x = self.upsample(x)
        return x

class DiffBlock(nn.Module):

    def __init__(self, d_in, d_hid=64, num_segments=8, context=5, res=True, downsample=True):
        super(DiffBlock, self).__init__()
        self.num_segments = num_segments
        self.context = context
        self.downsample = nn.Sequential(nn.Conv2d(d_in, d_hid, kernel_size=3, stride=2 if downsample else 1, padding=1, bias=False), nn.BatchNorm2d(d_hid), nn.ReLU(inplace=True))
        self.diff2vis = DomainTransfer(d_in=d_hid, d_out=d_in, num_segments=num_segments, context=context, downsample=downsample)
        self.res = res

    def forward(self, x):
        identity = x
        x = self.downsample(x)
        if self.context > 1:
            x = rearrange(x, '(b t) c h w -> b t c h w', t=self.num_segments)
            x_pre = repeat(x, 'b t c h w -> (b t z) c h w', z=self.context)
            x_post = F.pad(x, (0, 0, 0, 0, 0, 0, self.context // 2, self.context // 2), 'constant', 0).unfold(1, self.context, 1)
            x_post = rearrange(x_post, 'b t c h w z -> (b t z) c h w')
        else:
            x_post = x
            bt, c, h, w = x.size()
            x = rearrange(x, '(b t) c h w -> b t c h w', t=self.num_segments)
            x_pre = torch.cat((x[:, 0].unsqueeze(1), x[:, :-1]), 1).view(-1, c, h, w)
        diff = x_post - x_pre
        x = rearrange(diff, '(b t z) c h w -> (b z) c t h w', t=self.num_segments, z=self.context)
        out = self.diff2vis(x)
        if self.res:
            out = out + identity
        out = F.relu(out)
        return out

INIT_ARGS = {
    'd_in': 4,
    'd_hid': 8,
    'num_segments': 8,
    'context': 3,
    'res': True,
    'downsample': True,
}

ARGS = {
    'x': torch.randn(16, 4, 16, 16),
}

if __name__ == '__main__':
    model = DiffBlock(**INIT_ARGS)
    model.eval()
    with torch.no_grad():
        output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output dtype: {output.dtype}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DomainTransfer Ran
ran on a synthesized input
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("bc490bc7c211e0c1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 2, 8, 8) 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 as nn
from einops.layers.torch import Rearrange, Reduce

class DomainTransfer(nn.Module):

    def __init__(self, d_in, d_out, num_segments, context=5, chnls=(64, 64, 64), downsample=True):
        super(DomainTransfer, self).__init__()
        self.num_segments = num_segments
        self.chnls = chnls
        self.conv1 = nn.Sequential(nn.Conv3d(d_in, chnls[0], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[0]), nn.ReLU(inplace=True))
        self.conv2 = nn.Sequential(nn.Conv3d(chnls[0], chnls[1], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[1]), nn.ReLU(inplace=True))
        self.conv3_fuse = nn.Sequential(Rearrange('(b z) c t h w -> b (z c) t h w', z=context), nn.Conv3d(chnls[1] * context, chnls[2], kernel_size=(1, 3, 3), stride=(1, 1, 1), padding=(0, 1, 1), bias=False), nn.BatchNorm3d(chnls[2]), nn.ReLU(inplace=True))
        if downsample:
            self.upsample = nn.Sequential(nn.ConvTranspose3d(chnls[2], d_out, kernel_size=1, stride=(1, 2, 2), padding=(0, 0, 0), output_padding=(0, 1, 1), bias=False), Rearrange('b c t h w -> (b t) c h w'))
        else:
            self.upsample = nn.Sequential(nn.Conv3d(chnls[2], d_out, kernel_size=1, stride=(1, 1, 1), padding=(0, 0, 0), bias=False), Rearrange('b c t h w -> (b t) c h w'))
        nn.init.constant_(self.upsample[0].weight, 0)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3_fuse(x)
        x = self.upsample(x)
        return x


INIT_ARGS = {
    'd_in': 3,
    'd_out': 2,
    'num_segments': 8,
    'context': 5,
    'chnls': (16, 16, 16),
    'downsample': True,
}

ARGS = {
    'x': torch.randn(10, 3, 1, 4, 4),
}

if __name__ == '__main__':
    model = DomainTransfer(**INIT_ARGS)
    model.eval()
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output dtype: {output.dtype}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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, 2, 8, 8) — shape (2, 2, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ATMBlock Not yet run
unverified (harvested, no recorded run)
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("84a9fb91857b60cf")
How it ran

no invocation recorded.

SimBlock Not yet run
unverified (harvested, no recorded run)
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("17fe85569ab1f3e9")
How it ran

no invocation recorded.

SimTransform Not yet run
unverified (harvested, no recorded run)
whwu95/ATM/modules/ATM.py
code served (permissive licence) · get_code("4faabb379a6b7d0c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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-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

Temporal modeling plays a crucial role in understanding video content. To tackle this problem, previous studies built complicated temporal relations through time sequence thanks to the development of computationally powerful devices. In this work, we explore the potential of four simple arithmetic operations for temporal modeling. Specifically, we first capture auxiliary temporal cues by computing addition, subtraction, multiplication, and division between pairs of extracted frame features. Then, we extract corresponding features from these cues to benefit the original temporal-irrespective domain. We term such a simple pipeline as an Arithmetic Temporal Module (ATM), which operates on the stem of a visual backbone with a plug-andplay style. We conduct comprehensive ablation studies on the instantiation of ATMs and demonstrate that this module provides powerful temporal modeling capability at a low computational cost. Moreover, the ATM is compatible with both CNNs-and ViTs-based architectures. Our results show that ATM achieves superior performance over several popular video benchmarks. Specifically, on Something-Something V1, V2 and Kinetics-400, we reach top-1 accuracy of 65.6%, 74.6%, and 89.4% respectively. The code is available at https://github.com/whwu95/ATM .

For agents

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

get_harvested_code_for_paper("2307.08908")
get_code_for_paper("2307.08908")
have("2307.08908")

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

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

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

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

Connect an agent — have() is free.