SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_20099 · AAAI · 2022

Less is More: Pay Less Attention in Vision Transformers

Jing Liu, Bohan Zhuang, Zizheng Pan, Jianfei Cai, Haoyu He

Open in the Atlas

Code that ran

9 of 11 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 6 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/aaai_20099.json · badge: /api/ran/aaai_20099.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
zip-group/LIT canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
bboxes_iou Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/utils.py
code served (permissive licence) · get_code("4673440c036f73eb")
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 2, dtype family float, shape (2, 3) 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

torch.manual_seed(0)

# Create two sets of bounding boxes in xyxy format
# bboxes_a: (N, 4) where N=2
# bboxes_b: (K, 4) where K=3
bboxes_a = torch.tensor([
    [10.0, 20.0, 50.0, 60.0],
    [100.0, 150.0, 200.0, 250.0]
], dtype=torch.float32)

bboxes_b = torch.tensor([
    [15.0, 25.0, 55.0, 65.0],
    [100.0, 150.0, 210.0, 260.0],
    [500.0, 500.0, 600.0, 600.0]
], dtype=torch.float32)

ARGS = {
    "bboxes_a": bboxes_a,
    "bboxes_b": bboxes_b,
    "xyxy": 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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
build_scheduler Ran
ran; our contract draft was wrong, not the code
zip-group/LIT/classification/code_for_lit_s_m_b/lr_scheduler.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ghrua/seqpe, is pointer only (licence: NONE) · get_code("c02cc4e0b5720211")
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 ghrua/seqpe, 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.

conv_flops Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/models/attentions.py
code served (permissive licence) · get_code("25517cf1e6458c39")
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 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 math

def conv_flops(k, c_in, c_out, stride, padding, resolution, bias=True, dialation=1):
    batch_size = 1
    output_dims = math.floor((resolution + 2 * padding - dialation * (k - 1) - 1) / stride + 1)
    kernel_dims = k
    in_channels = c_in
    out_channels = c_out
    groups = 1
    filters_per_channel = out_channels // groups
    conv_per_position_flops = int(kernel_dims ** 2) * in_channels * filters_per_channel
    active_elements_count = batch_size * int(output_dims ** 2)
    overall_conv_flops = conv_per_position_flops * active_elements_count
    bias_flops = 0
    if bias is not None:
        bias_flops = out_channels * active_elements_count
    overall_flops = overall_conv_flops + bias_flops
    return int(overall_flops)

ARGS = {
    "k": 3,
    "c_in": 16,
    "c_out": 32,
    "stride": 1,
    "padding": 1,
    "resolution": 28,
    "bias": True,
    "dialation": 1
}
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 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
create_logger Ran
ran; our contract draft was wrong, not the code
zip-group/LIT/classification/code_for_lit_s_m_b/logger.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ghrua/seqpe, is pointer only (licence: NONE) · get_code("80450600f7f09b0a")
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 ghrua/seqpe, 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.

matrix_iou Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/utils.py
code served (permissive licence) · get_code("f1f823695040297a")
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 ndarray, ndim 2, dtype family float, shape (2, 3) 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 numpy as np

# Create sample bounding boxes in format [x1, y1, x2, y2]
# 'a' will be shape (2, 4) - 2 boxes with 4 coordinates each
a = np.array([
    [10.0, 20.0, 50.0, 60.0],
    [30.0, 40.0, 70.0, 80.0]
], dtype=np.float32)

# 'b' will be shape (3, 4) - 3 boxes with 4 coordinates each
b = np.array([
    [15.0, 25.0, 55.0, 65.0],
    [35.0, 45.0, 75.0, 85.0],
    [5.0, 10.0, 40.0, 50.0]
], dtype=np.float32)

ARGS = {
    'a': a,
    'b': b
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
postprocess Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/utils.py
code served (permissive licence) · get_code("9b8d355984e33a51")
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 torchvision

torch.manual_seed(0)

# Create a prediction tensor with shape (N, B, 4 + 1 + num_classes)
# N=2 (batch size), B=3 (number of boxes), 4 for box coords, 1 for objectness, 5 for class scores
num_classes = 5
N = 2  # batch size
B = 3  # number of boxes per image

# prediction shape: (N, B, 4 + 1 + num_classes)
# dimensions: xc, yc, w, h, objectness, class_scores (5 classes)
prediction = torch.randn(N, B, 4 + 1 + num_classes)

# Make sure values are in reasonable ranges
# Box coordinates (xc, yc, w, h) - keep them positive and reasonable
prediction[:, :, :4] = torch.abs(prediction[:, :, :4]) * 100 + 10
# Objectness score (0-1)
prediction[:, :, 4] = torch.sigmoid(prediction[:, :, 4])
# Class scores (0-1)
prediction[:, :, 5:] = torch.sigmoid(prediction[:, :, 5:])

ARGS = {
    "prediction": prediction,
    "num_classes": num_classes,
    "conf_thre": 0.7,
    "nms_thre": 0.45,
}
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 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
reduce_loss_dict Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/distributed_util.py
code served (permissive licence) · get_code("9b8aa876c71b0665")
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 dict. 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

torch.manual_seed(0)

# The function expects a loss_dict with string keys and tensor values
# The tensors are stacked and reduced, so they should be scalar or 1D tensors
loss_dict = {
    "loss_classifier": torch.tensor(0.5),
    "loss_box": torch.tensor(0.3),
    "loss_objectness": torch.tensor(0.2),
}

ARGS = {
    "loss_dict": loss_dict,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
scatter_gather Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/distributed_util.py
code served (permissive licence) · get_code("a98b48e2e2be4ce8")
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. 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 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 pickle

torch.manual_seed(0)

# The scatter_gather function takes one parameter: data
# It should be serializable (can be pickled)
# The function will pickle it, encode it, and later unpickle it
# So we can pass any serializable Python object

# Let's create some test data that is serializable
test_data = {
    "tensor": torch.randn(2, 4),
    "list": [1, 2, 3],
    "string": "test",
    "number": 42
}

ARGS = {
    "data": test_data
}
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
vis Ran
ran on a synthesized input
zip-group/LIT/classification/code_for_lit_s_m_b/mm_modules/vis_utils.py
code served (permissive licence) · get_code("29413e543e79fad8")
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 ndarray, ndim 3, dtype family int, shape (100, 150, 3) 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
import cv2

torch.manual_seed(0)

# Create a small dummy image (height=100, width=150, channels=3)
img = np.random.randint(0, 256, (100, 150, 3), dtype=np.uint8)

# Create boxes in format [x, y, width, height]
boxes = torch.FloatTensor([
    [10.0, 20.0, 30.0, 40.0],
    [60.0, 50.0, 25.0, 35.0]
])

# Create scores (confidence values)
scores = torch.FloatTensor([0.9, 0.7])

# Create class IDs
cls_ids = torch.LongTensor([0, 1])

# Create class names
class_names = ["cat", "dog", "bird"]

ARGS = {
    "img": img,
    "boxes": boxes,
    "scores": scores,
    "cls_ids": cls_ids,
    "conf": 0.5,
    "class_names": class_names,
    "color": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (100, 150, 3) — shape (100, 150, 3) 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
build_model Not yet run
unverified (harvested, no recorded run)
zip-group/LIT/classification/code_for_lit_s_m_b/models/build.py
code served (permissive licence) · get_code("45732831d1539a53")
How it ran

no invocation recorded.

get_config Not yet run
unverified (harvested, no recorded run)
zip-group/LIT/classification/code_for_lit_s_m_b/config.py
code served (permissive licence) · get_code("02a9e80c2bb81815")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 11 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 4 later) and 0 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_config 51 other papers
7 dated earlier, 37 later, 7 same year, order not determinable
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.03746 (2021-06)
Efficient Training of Visual Transformers with Small Datasets
and 48 more not named here
create_logger 35 other papers
5 dated earlier, 24 later, 6 same year, order not determinable
2104.13840 (2021-04)
Twins: Revisiting the Design of Spatial Attention in Vision Transformers
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.03746 (2021-06)
Efficient Training of Visual Transformers with Small Datasets
and 32 more not named here
build_scheduler 13 other papers
4 dated earlier, 5 later, 4 same year, order not determinable
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.03746 (2021-06)
Efficient Training of Visual Transformers with Small Datasets
2106.04263 (2021-06)
On the Connection between Local Attention and Dynamic Depth-wise Convolution
and 10 more not named here
bboxes_iou 2 other papers
1 later, 1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
aaai_25158 (2023 (year only))
TransVCL: Attention-Enhanced Video Copy Localization Network with Flexible Supervision
build_model 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
conv_flops 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
matrix_iou 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
postprocess 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
reduce_loss_dict 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
scatter_gather 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention
vis 1 other paper
1 same year, order not determinable
2205.13213 (2022-05)
Fast Vision Transformers with HiLo Attention

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Transformers have become one of the dominant architectures in deep learning, particularly as a powerful alternative to convolutional neural networks (CNNs) in computer vision. However, Transformer training and inference in previous works can be prohibitively expensive due to the quadratic complexity of self-attention over a long sequence of representations, especially for high-resolution dense prediction tasks. To this end, we present a novel Less attention vIsion Transformer (LIT), building upon the fact that the early self-attention layers in Transformers still focus on local patterns and bring minor benefits in recent hierarchical vision Transformers. Specifically, we propose a hierarchical Transformer where we use pure multi-layer perceptrons (MLPs) to encode rich local patterns in the early stages while applying self-attention modules to capture longer dependencies in deeper layers. Moreover, we further propose a learned deformable token merging module to adaptively fuse informative patches in a nonuniform manner. The proposed LIT achieves promising performance on image recognition tasks, including image classification, object detection and instance segmentation, serving as a strong backbone for many vision tasks. Code is available at https://github.com/zip-group/LIT.

For agents

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

get_harvested_code_for_paper("aaai_20099")
get_code_for_paper("aaai_20099")
have("aaai_20099")

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

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

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

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

Connect an agent — have() is free.