Dense Local Dependencies Induce Attention-Logit Explosion and Training Instability During Long-Sequence Transformer Training
This paper identifies dense local dependencies as the primary cause of attention-logit explosion and subsequent training instability in long-sequence autoregressive transformers, demonstrating that explicitly modeling these dependencies mitigates the issue by preventing the high-rank attention structures that low-rank self-attention mechanisms struggle to approximate under low-precision arithmetic.
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 super-smart robot how to write stories, one word at a time. This robot is built on a special kind of brain architecture called a "Transformer." Think of a Transformer as a massive, hyper-organized librarian who can read a book and instantly understand how every single word relates to every other word in the text. This ability has revolutionized how computers understand language, art, and even speech. However, there's a catch: when we ask this librarian to read very long books (thousands of words long), the robot's brain starts to glitch. It gets confused, the numbers inside it start to go haywire, and the whole training process crashes. Scientists have been trying to figure out why this happens, especially when the robot is running on "low-precision" math (a faster but less exact way of calculating). This paper dives into that mystery, looking for the hidden reason why these long stories make the robot's brain explode with confusion.
The authors of this paper discovered that the problem isn't just about the length of the story, but about how the robot tries to connect words that are close together. They found that when a story has lots of "dense local dependencies"—which is a fancy way of saying "words that rely heavily on their immediate neighbors," like how the word "the" almost always needs a noun right after it—the robot's standard way of paying attention breaks down.
Here is the core of their discovery: Imagine the robot's attention mechanism as a spotlight. In a standard setup, this spotlight is low-resolution; it can only focus on a limited number of distinct patterns at once. When the robot tries to read a long sentence where every word is tightly connected to the ones right next to it, it's like asking that low-resolution spotlight to project a high-definition, complex image of a crowded city street. The spotlight simply can't handle the detail. To force the image to fit, the robot has to crank the brightness of the spotlight up to blinding levels. These "brightness levels" are called logits. As the story gets longer, the robot has to crank the brightness up higher and higher until the numbers become so huge that the computer can't handle them anymore, causing the training to crash.
The paper suggests that this "logit explosion" is the main culprit behind the training instability. They tested this idea in two ways. First, they created a fake, synthetic puzzle where the robot had to learn a pattern of dense local connections. They watched the "brightness" (logits) grow wildly as the puzzle got longer, just like they predicted. Then, they tried this on real language models using a dataset of long books. The results were the same: longer sequences led to bigger, more unstable numbers.
Crucially, the paper argues against the idea that this is just a general problem with long sequences or the optimizer used. Instead, they show it's specifically about the density of the local connections. If you make the connections between nearby words less dense (like randomly removing some of the links), the explosion stops. They also found that if you give the robot a "super-resolution" spotlight (by increasing the attention dimension), the problem gets better, but it doesn't go away completely.
The most exciting part of their solution is a simple fix: give the robot a second, specialized spotlight just for the nearby words. They call this "Full-Local Attention." Imagine the robot has a main spotlight for the whole room (long-range connections) and a tiny, high-definition flashlight for the immediate neighborhood (local connections). By letting the flashlight handle the messy, dense details of the nearby words, the main spotlight doesn't have to work so hard. The authors found that when they added these local flashlights, the "brightness" (logits) stayed low and stable, even for very long sequences. This suggests that for future AI models to handle long contexts without crashing, they shouldn't just try to make the main spotlight brighter; they need to design the system to explicitly handle those tight, local connections with dedicated tools.
In short, the paper suggests that the reason long-sequence training is so unstable is that standard Transformers are trying to use a low-resolution tool to solve a high-resolution, locally-dense problem. By acknowledging this and adding specific tools to handle the local details, we can stop the numbers from exploding and build more stable, efficient AI.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.