Stability of Transformers under Layer Normalization
This paper presents a principled theoretical and numerical analysis of how different layer normalization placements affect the forward and backward stability of Transformers, deriving explicit bounds on hidden state growth and gradient propagation to guide architectural design and residual scaling for improved training dynamics.
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 write a story. You give it a massive brain made of thousands of tiny layers, like a skyscraper with hundreds of floors. Every time the robot reads a word, it passes that information up the elevator, floor by floor, changing its understanding a little bit at each stop. This is how modern AI, known as "Transformers," works. They are the engines behind the smartest chatbots and image generators today. But there's a catch: as these buildings get taller, they become unstable. Sometimes, the information gets so distorted on the way up that the robot starts screaming nonsense numbers, or the math used to teach it gets so wild that the whole system crashes. To stop this, engineers use a safety device called "Layer Normalization." Think of it like a speed bump or a governor on a car engine; it keeps the information from speeding out of control. For years, people just guessed where to put these speed bumps—sometimes before the engine, sometimes after—and hoped for the best. But nobody really knew why one spot worked better than another, or if the robot was secretly building a house of cards that would collapse under its own weight.
This paper is like a group of detectives who decided to stop guessing and start using the laws of physics to solve the mystery. The authors treat the AI's learning process like a journey through time, using a branch of math called "optimal control theory" (which is usually used to figure out the best way to steer a rocket or a drone). They ask: "If we want this robot to learn perfectly, what happens to the information as it travels up the tower?" They discovered that the old way of placing the safety device (called "Pre-LN") is actually a trap. Their math proves that even if the robot tries its absolute hardest to learn, the information will eventually grow so huge that it explodes, leading to a chaotic mess. It's like trying to fill a bucket with a firehose; no matter how hard you try to aim, the water will overflow.
However, they found a better way. By moving the safety device to both the entrance and exit of each floor (a new method they call "Peri-LN"), the information stays calm and controlled. Their equations show that instead of exploding, the data grows in a predictable, gentle line, like a well-behaved plant. They also found a simple trick to make this even better: slowing down the steps the robot takes at each floor. Imagine if the robot took tiny, careful steps instead of giant leaps; this keeps the whole building steady. When they tested this on real AI models, the results matched their math perfectly. The "Peri-LN" models didn't crash, and they learned just as well, if not better, than the old ones. The paper doesn't just say "this feels right"; it provides a mathematical guarantee that this new design keeps the AI stable, offering a clear blueprint for building the next generation of super-smart machines without them falling apart.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.