SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.08297 · ICML · 2026

SEMA: a Scalable and Efficient Mamba like Attention via Token Localization and Averaging

Shuai Zhang, Jiancheng Lyu, Nhat Tran, Jack Xin, Fanghui Xue, Yunling Zheng, Yingyong Qi

arXiv · PDF · Open in the Atlas

Code that ran

10 of 13 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; 2 honoured the contract we drafted, 3 violated it and 0 have no contract verdict; 5 failures of our instrument; 3 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/2506.08297.json · badge: /api/ran/2506.08297.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
nhatthanhtran/SEMA canonical (classifier label)
classifier basis not recorded on the link
10 ran · 3 no recorded run
FunctionStatusWhere it lives
auto_resume_helper Ran
ran; our contract draft was wrong, not the code
nhatthanhtran/SEMA/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("0c32459bef92ff8c")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

broadcat Ran
ran, honoured the contract we drafted
nhatthanhtran/SEMA/models/rope.py
pointer only (licence: MIT) · get_code("f07bf3d46feead4c")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

build_optimizer Ran
ran; our contract draft was wrong, not the code
nhatthanhtran/SEMA/optimizer.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("fcf2d41dd445a70b")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

build_scheduler Ran
ran; our contract draft was wrong, not the code
nhatthanhtran/SEMA/lr_scheduler.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("07e8b4b487c0abb6")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

check_keywords_in_name Ran
ran, violated the contract we drafted
nhatthanhtran/SEMA/optimizer.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("b0a5beb34716d5a6")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

create_logger Ran
ran; our contract draft was wrong, not the code
nhatthanhtran/SEMA/logger.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("82e52feafbf040bb")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

default Ran
ran, violated the contract we drafted
nhatthanhtran/SEMA/models/rope.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("60fff7c3c400d7ff")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

exists Ran
ran, violated the contract we drafted
nhatthanhtran/SEMA/models/rope.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("aa5486a3650902d8")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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_grad_norm Ran
ran, honoured the contract we drafted
nhatthanhtran/SEMA/utils.py
pointer only (licence: MIT) · get_code("eec1e7cba51d5e8e")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

set_weight_decay_and_lr Ran
ran; our contract draft was wrong, not the code
nhatthanhtran/SEMA/optimizer.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("104af48a94364f24")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

build_model Not yet run
unverified (harvested, no recorded run)
nhatthanhtran/SEMA/models/build.py
pointer only (licence: MIT) · get_code("f0da8448e76e4d0e")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

get_config Not yet run
unverified (harvested, no recorded run)
nhatthanhtran/SEMA/config.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("20681a9065c0a731")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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.

load_checkpoint Not yet run
unverified (harvested, no recorded run)
nhatthanhtran/SEMA/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("26a01685ebc8f358")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, nhatthanhtran/SEMA, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. 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 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 12 are also present in other papers whose code we hold (12 with at least one paper dated earlier, 3 the same month, 4 later) and 1 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
exists 486 other papers
447 dated earlier, 4 the same month, 31 later, 2 same year, order not determinable, 2 undated · 78 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.04637 (2018-04)
EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
and 483 more not named here
default 163 other papers
152 dated earlier, 3 the same month, 6 later, 1 same year, order not determinable, 1 undated · 27 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
1907.01470 (2019-07)
Augmenting Self-attention with Persistent Memory
and 160 more not named here
get_config 51 other papers
47 dated earlier, 1 the same month, 1 later, 2 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
check_keywords_in_name 31 other papers
29 dated earlier, 2 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 28 more not named here
get_grad_norm 23 other papers
21 dated earlier, 2 same year, order not determinable
1910.13616 (2019-10)
Multimodal Model-Agnostic Meta-Learning via Task-Aware Modulation
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
and 20 more not named here
auto_resume_helper 20 other papers
19 dated earlier, 1 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.04263 (2021-06)
On the Connection between Local Attention and Dynamic Depth-wise Convolution
and 17 more not named here
build_scheduler 13 other papers
13 dated earlier
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2307.06947 (2023-07)
Video-FocalNets: Spatio-Temporal Focal Modulation for Video Action Recognition
2309.01430 (2023-09)
DAT++: Spatially Dynamic Vision Transformer with Deformable Attention
and 10 more not named here
create_logger 5 other papers
5 dated earlier
2309.01430 (2023-09)
DAT++: Spatially Dynamic Vision Transformer with Deformable Attention
2312.08874 (2023-12)
Agent Attention: On the Integration of Softmax and Linear Attention
00666 (2024 (year only))
AttnZero: Efficient Attention Discovery for Vision Transformers
and 2 more not named here
broadcat 4 other papers
3 dated earlier, 1 later
2212.10554 (2022-12)
A Length-Extrapolatable Transformer
2402.04324 (2024-02)
ConsistI2V: Enhancing Visual Consistency for Image-to-Video Generation
2504.13181 (2025-04)
Perception Encoder: The best visual embeddings are not at the output of the network
and 1 more not named here
build_optimizer 4 other papers
4 dated earlier
2309.01430 (2023-09)
DAT++: Spatially Dynamic Vision Transformer with Deformable Attention
2312.08874 (2023-12)
Agent Attention: On the Integration of Softmax and Linear Attention
00666 (2024 (year only))
AttnZero: Efficient Attention Discovery for Vision Transformers
and 1 more not named here
set_weight_decay_and_lr 4 other papers
4 dated earlier
2309.01430 (2023-09)
DAT++: Spatially Dynamic Vision Transformer with Deformable Attention
2312.08874 (2023-12)
Agent Attention: On the Integration of Softmax and Linear Attention
00666 (2024 (year only))
AttnZero: Efficient Attention Discovery for Vision Transformers
and 1 more not named here
load_checkpoint 2 other papers
2 dated earlier
00666 (2024 (year only))
AttnZero: Efficient Attention Discovery for Vision Transformers
2412.06590 (2024-12)
Bridging the Divide: Reconsidering Softmax and Linear 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

Attention is the critical component of a transformer. Yet the quadratic computational complexity of vanilla full attention in the input size and the inability of its linear attention variant to focus have been challenges for computer vision tasks. We provide a mathematical definition of generalized attention and formulate both vanilla softmax attention and linear attention within the general framework. We prove that generalized attention disperses, that is, as the number of keys tends to infinity, the query assigns equal weights to all keys. Motivated by the dispersion property and recent development of Mamba form of attention, we design Scalable and Efficient Mamba like Attention (SEMA) which utilizes token localization to avoid dispersion and maintain focusing, complemented by theoretically consistent arithmetic averaging to capture global aspect of attention. We support our approach on Imagenet-1k where classification results show that SEMA is a scalable and effective alternative beyond linear attention, outperforming recent vision Mamba models on increasingly larger scales of images at similar model parameter sizes. Source code can be found at: https://github.com/nhatthanhtran/SEMA.

For agents

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

get_harvested_code_for_paper("2506.08297")
get_code_for_paper("2506.08297")
have("2506.08297")

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

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

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

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

Connect an agent — have() is free.