← Latest papers
🤖 machine learning

AdaSplash-2: Faster Differentiable Sparse Attention

AdaSplash-2 introduces a novel histogram-based initialization and sparsity-aware GPU implementation to drastically accelerate α\alpha-entmax sparse attention, enabling training speeds comparable to FlashAttention-2 at moderate-to-high sparsity levels while achieving superior performance in long-context settings.

Original authors: Nuno Gonçalves, Hugo Pitorro, Vlad Niculae, Edoardo Ponti, Lei Li, Andre Martins, Marcos Treviso

Published 2026-04-17
📖 4 min read☕ Coffee break read

Original authors: Nuno Gonçalves, Hugo Pitorro, Vlad Niculae, Edoardo Ponti, Lei Li, Andre Martins, Marcos Treviso

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 running a massive library (a Transformer AI model) where every book (a word in a sentence) needs to read every other book to understand the context.

In a traditional library, this is a nightmare. If you have 1,000 books, you have to read 1,000,000 pairs of connections. If you have 100,000 books, the number of connections explodes to 10 billion. This is the quadratic bottleneck that slows down modern AI when it tries to read long documents.

To fix this, researchers invented Sparse Attention. Instead of reading every book, the AI learns to ignore the irrelevant ones and only focus on the important ones. This is like a librarian who only pulls out the top 5 most relevant books for a query, ignoring the rest.

However, there was a catch. The "smart librarian" algorithm they were using (called α\alpha-entmax) was too slow to figure out which books to pick. It had to do a lot of heavy math, like a librarian trying to calculate the perfect probability for every single book before deciding what to ignore. This calculation was so slow that it canceled out the speed gains from ignoring the books.

Enter ADASPLASH-2: The "Super-Speedy Librarian."

This paper introduces a new, faster way to run this smart librarian algorithm. Here is how it works, using some everyday analogies:

1. The Problem: The "Guessing Game"

To decide which books to ignore, the algorithm needs to find a specific "cutoff score" (called τ\tau).

  • Old Way: Imagine trying to find the exact temperature where water boils. You have to keep guessing, checking, and adjusting your guess over and over again. This takes a long time.
  • The Issue: In the previous version (ADASPLASH), the computer had to scan the entire list of scores multiple times to find this cutoff. It was accurate but slow.

2. The Solution: The "Histogram Shortcut"

The authors of ADASPLASH-2 came up with a brilliant trick: The Histogram.

Instead of looking at every single score one by one, imagine you have a giant bucket with 100 slots (bins).

  • As the computer scans the scores, it doesn't store the exact numbers. Instead, it just drops a marble into the slot that matches the score's range.
  • The Magic: By the time it finishes scanning, it has a quick "map" (a histogram) of where all the scores are clustered.
  • The Result: This map gives the computer a very good guess at the cutoff score immediately. It's like looking at the distribution of marbles and saying, "Okay, the boiling point is definitely between 90 and 95 degrees," without needing to measure every single drop of water.

Because this "map" is built instantly in the computer's super-fast internal memory (SRAM), the algorithm only needs 1 or 2 quick checks to find the exact answer, instead of dozens.

3. The "Skip the Empty Boxes" Trick

Once the computer knows the cutoff, it knows which books (or blocks of data) are irrelevant.

  • The Old Way: The computer would still drive past the empty shelves, check them, realize they are empty, and then move on. This wastes fuel (energy and time).
  • The New Way: ADASPLASH-2 uses a bit-packed mask. Think of this as a highly efficient checklist where a single "1" or "0" tells the computer exactly which shelves to visit. If a shelf is empty, the computer literally skips the drive to that shelf. It doesn't even load the data into memory.

Why Does This Matter?

  1. Speed: In situations where the AI is reading very long documents (like a whole novel or a legal contract), the "smart librarian" (ADASPLASH-2) is now faster than the standard "dumb librarian" (FlashAttention-2) that reads everything.
  2. Smarter Long-Context: Because the AI can handle long texts more efficiently without getting bogged down by math, it actually gets smarter at long tasks. It stops getting confused by irrelevant details and focuses on the story.
  3. No Trade-off: Usually, making things faster makes them less accurate. But here, the new method is so efficient that the AI performs just as well (or better) on short tasks and significantly better on long tasks.

The Bottom Line

ADASPLASH-2 is like upgrading a librarian from someone who reads every single page of every book to find the answer, to a super-intelligent assistant who:

  1. Quickly scans the spines to make a rough guess (The Histogram).
  2. Instantly knows exactly which books to pull off the shelf.
  3. Ignores the empty shelves entirely.

This allows AI models to read longer books, understand complex stories, and do it all in the blink of an eye.

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 →