SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.03703 · 2024

CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications

arXiv · PDF · Open in the Atlas

Code that ran

6 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 0 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/2408.03703.json · badge: /api/ran/2408.03703.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
tianfang-zhang/cas-vit canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
Stage Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tianfang-zhang/cas-vit/classification/model/rcvit.py
code served (permissive licence) · get_code("a4cb506c560f097d")
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 Sequential. 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 timm.models.layers import DropPath, trunc_normal_, to_2tuple

torch.manual_seed(0)

ARGS = {
    "dim": 64,
    "index": 0,
    "layers": [2, 3, 4],
    "mlp_ratio": 4.0,
    "act_layer": nn.ReLU,
    "attn_bias": False,
    "drop": 0.0,
    "drop_path_rate": 0.1,
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
cosine_scheduler Ran
ran, honoured the contract we drafted
tianfang-zhang/cas-vit/classification/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from boyazeng/understand_bias, is pointer only (licence: NONE) · get_code("b700fb0a3496b255")
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 boyazeng/understand_bias, 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.

count_parameters Ran
ran, honoured the contract we drafted
tianfang-zhang/cas-vit/classification/model/rcvit.py
code served (permissive licence) · get_code("f6b944f50d3f15ae")
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 int, ndim 0, dtype family int, shape () 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 int, ndim 0, dtype family int, shape () — shape () 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
get_num_layer_for_convnext Ran
ran, honoured the contract we drafted
tianfang-zhang/cas-vit/classification/optim_factory.py
pointer only (licence: MIT); the stored copy get_code serves, from boyazeng/understand_bias, is pointer only (licence: NONE) · get_code("199223de2f9704cf")
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 boyazeng/understand_bias, 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.

get_parameter_groups Ran
ran; our contract draft was wrong, not the code
tianfang-zhang/cas-vit/classification/optim_factory.py
code served (permissive licence) · get_code("979fc7d0ba424da1")
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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.bias_param = nn.Parameter(torch.randn(2))
        self.single_dim = nn.Parameter(torch.randn(5))
        
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

model = SimpleModel()

def get_num_layer_fn(name):
    if 'layer1' in name:
        return 0
    elif 'layer2' in name:
        return 1
    else:
        return 2

def get_layer_scale_fn(layer_id):
    if layer_id is None:
        return 1.0
    return 1.0 / (layer_id + 1)

ARGS = {
    'model': model,
    'weight_decay': 1e-05,
    'skip_list': (),
    'get_num_layer': get_num_layer_fn,
    'get_layer_scale': get_layer_scale_fn,
}
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
stem Ran
ran; our contract draft was wrong, not the code
tianfang-zhang/cas-vit/classification/model/rcvit.py
pointer only (licence: MIT); the stored copy get_code serves, from snap-research/efficientformer, is pointer only (licence: NOASSERTION) · get_code("b72ba06382340c08")
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 snap-research/efficientformer, 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.

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 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
count_parameters 180 other papers
142 dated earlier, 32 later, 6 same year, order not determinable · 8 only as an assembly brick
1705.08415 (2017-05)
Supervised Community Detection with Line Graph Neural Networks
1707.01926 (2017-07)
Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting
1808.09367 (2018-08)
Deriving Machine Attention from Human Rationales
and 177 more not named here
cosine_scheduler 26 other papers
23 dated earlier, 2 later, 1 same year, order not determinable
1905.02244 (2019-05)
Searching for MobileNetV3
136810051 (2022 (year only))
AMixer: Adaptive Weight Mixing for Self-Attention Free Vision Transformers
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
and 23 more not named here
get_num_layer_for_convnext 12 other papers
10 dated earlier, 1 the same month, 1 later
1905.02244 (2019-05)
Searching for MobileNetV3
2211.05781 (2022-11)
Demystify Transformers & Convolutions in Modern Image Deep Networks
ijcai2023_0111 (2023 (year only))
RaMLP: Vision MLP via Region-aware Mixing
and 9 more not named here
stem 1 other paper
1 dated earlier
2206.01191 (2022-06)
EfficientFormer: Vision Transformers at MobileNet Speed

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

Vision Transformers (ViTs) mark a revolutionary advance in neural networks with their token mixer's powerful global context capability. However, the pairwise token affinity and complex matrix operations limit its deployment on resource-constrained scenarios and real-time applications, such as mobile devices, although considerable efforts have been made in previous works. In this paper, we introduce CAS-ViT: Convolutional Additive Self-attention Vision Transformers, to achieve a balance between efficiency and performance in mobile applications. Firstly, we argue that the capability of token mixers to obtain global contextual information hinges on multiple information interactions, such as spatial and channel domains. Subsequently, we propose Convolutional Additive Token Mixer (CATM) employing underlying spatial and channel attention as novel interaction forms. This module eliminates troublesome complex operations such as matrix multiplication and Softmax. We introduce Convolutional Additive Self-attention(CAS) block hybrid architecture and utilize CATM for each block. And further, we build a family of lightweight networks, which can be easily extended to various downstream tasks. Finally, we evaluate CAS-ViT across a variety of vision tasks, including image classification, object detection, instance segmentation, and semantic segmentation. Our M and T model achieves 83.0\%/84.1\% top-1 with only 12M/21M parameters on ImageNet-1K. Meanwhile, throughput evaluations on GPUs, ONNX, and iPhones also demonstrate superior results compared to other state-of-the-art backbones. Extensive experiments demonstrate that our approach achieves a better balance of performance, efficient inference and easy-to-deploy. Our code and model are available at: \url{https://github.com/Tianfang-Zhang/CAS-ViT}

For agents

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

get_harvested_code_for_paper("2408.03703")
get_code_for_paper("2408.03703")
have("2408.03703")

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

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

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

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

Connect an agent — have() is free.