← Latest papers
🤖 AI

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

This paper introduces SEMA, a scalable and efficient attention mechanism that combines token localization to prevent weight dispersion with arithmetic averaging to capture global context, thereby outperforming existing linear attention and vision Mamba models in image classification tasks.

Original authors: Nhat Thanh Tran, Fanghui Xue, Shuai Zhang, Jiancheng Lyu, Yunling Zheng, Yingyong Qi, Jack Xin

Published 2026-07-17
📖 5 min read🧠 Deep dive

Original authors: Nhat Thanh Tran, Fanghui Xue, Shuai Zhang, Jiancheng Lyu, Yunling Zheng, Yingyong Qi, Jack Xin

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to teach a robot to recognize a cat in a photo. To do this, the robot uses a special tool called "attention," which acts like a spotlight. This spotlight scans the entire image, deciding which pixels are important (like the cat's ears) and which are just background noise (like a blurry tree). The problem is that as the photo gets bigger, the spotlight has to check every single pixel against every other pixel. If the photo is small, this is fast. But if the photo is huge, the robot gets overwhelmed, spending so much time checking connections that it runs out of battery before it can even say "cat."

Scientists have tried to fix this by making the spotlight "linear," meaning it checks pixels in a simpler, faster line. But there's a catch: these fast spotlights often lose their focus. As the image gets bigger, they start treating every single pixel as equally important, like a flashlight that has been turned down so low it just glows evenly over the whole room. The robot stops seeing the cat and starts seeing a gray blur. This paper, written by researchers from the University of California, Irvine, and Qualcomm AI Research, tackles this exact problem. They want to build a spotlight that is both fast enough to handle giant images and sharp enough to still see the details.

The researchers, led by Nhat Thanh Tran and colleagues, discovered a mathematical truth that explains why these fast spotlights fail: as the number of pixels (or "tokens") grows toward infinity, the attention mechanism naturally spreads out and becomes useless. They call this the "dispersion" phenomenon. It's like trying to hear a whisper in a stadium; if you try to listen to everyone at once, you end up hearing nothing but noise. The paper proves that no matter how you tweak the math of these fast attention tools, they will eventually lose their focus if the image gets too big.

To solve this, the team invented a new method called SEMA (Scalable and Efficient Mamba like Attention). Instead of fighting the math, they decided to work with it. They realized that while the spotlight should focus on specific details, it also needs a way to understand the "big picture" without getting lost. So, they designed a two-part system. First, they use Token Localization, which is like giving the spotlight a small window to look through. It only focuses on a tiny neighborhood of pixels at a time, ensuring it never gets overwhelmed or distracted. This keeps the focus sharp.

But looking through a small window has a downside: the robot might miss the whole cat if it's only looking at one paw. To fix this, SEMA adds a second step: Averaging. This is like taking a quick, blurry snapshot of the entire room and adding it to the detailed view. The researchers proved mathematically that when the image gets huge, the best way to capture the "global" feel of the image is simply to average everything out. By combining the sharp, local window view with this simple, global average, SEMA gets the best of both worlds.

The paper shows that this approach works incredibly well. When they tested SEMA on standard image datasets like ImageNet-1K, it outperformed other popular models, including the recent "Mamba" models, especially when the images were very large. For example, when the image size was increased to 1024x1024 pixels, other models struggled significantly, dropping in accuracy, while SEMA stayed strong and even improved. The researchers also found that SEMA was faster than its competitors, taking less time to process large images.

One of the most interesting parts of the paper is how they handled the "dispersion" problem. Instead of trying to force the attention to stay sharp in a way that breaks the math, they accepted that for huge images, the attention should spread out. They used this spreading nature to their advantage by using a simple average to represent the global information. It's a bit like realizing that if you have a million friends, you can't remember every detail about every single one, but you can remember the general vibe of the group. SEMA remembers the details of the immediate neighborhood and the general vibe of the whole group, allowing it to recognize the cat perfectly, no matter how big the photo is.

The authors tested their idea on various tasks, from recognizing objects to finding specific parts of an image (segmentation). In every case, SEMA showed it could scale up to larger images without losing its mind. They even showed that as the images got bigger, the "averaging" part of their system became more important, proving their theory that this simple step is crucial for handling massive amounts of data. While the paper focuses on computer vision, the team suggests this idea could help with other problems involving long sequences of data, like analyzing huge medical scans.

In short, SEMA is a clever trick that admits when a spotlight gets too wide to be useful and switches to a different strategy: look closely at the details nearby, and take a quick, simple average of the rest. It's a scalable, efficient, and mathematically sound way to help computers see the world clearly, even when the world gets very big.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →