Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Mechanical Dreams

Mechanical Dreams artwork

SiameseNorm

Feb 24, 202617 minAudio
ShareXLinkedInFacebookWhatsAppEmail

In this episode: • Introduction: The Never-Ending Normalization Wars: Professor Norris and Linda kick off the episode. Norris cracks a joke about how normalization layers are like seasoning - too little and it's bland, too much and you ruin the dish. Linda introduces the paper 'SiameseNorm: Breaking the Barrier to Reconciling Pre/Post-Norm', setting the stage for a discussion on the fundamental trade-offs in Transformer architecture. • The Dilemma: Dilution vs. Distortion: Linda explains the core problem: Pre-Norm is stable but suffers from 'signal dilution' which limits effective depth, while Post-Norm offers high expressivity but is plagued by 'gradient distortion' and instability. Norris plays the skeptic, asking why we can't just combine them, leading to a discussion on why previous hybrid attempts have failed. • The Solution: SiameseNorm's Dual Streams: Linda describes the paper's novel architecture: SiameseNorm. She explains how it uses two parallel streams (one Pre-Norm-like, one Post-Norm-like) that share the same residual block parameters. This allows the model to decouple the optimization dynamics (via the identity path) from the representation learning (via the normalized path). • Under the Hood: The Gradient Analysis: Professor Norris dives into the mathematical justification provided in the paper. He breaks down the Jacobian matrix analysis, seemingly impressed by how the architecture preserves an explicit identity term (for the gradient highway) while simultaneously enforcing bounded representations, effectively solving the vanishing/exploding gradient problem. • Results: The Arithmetic Leap and High Learning Rates: Linda presents the empirical evidence, highlighting that SiameseNorm allows for much more aggressive learning rates (up to 2e-3) without diverging. She emphasizes the massive 40% relative gain in arithmetic reasoning tasks compared to Pre-Norm, which finally convinces Norris that the 'effective depth' has indeed been restored. • Conclusion: A Unified Future?: The hosts wrap up the episode. Norris concedes that this might be the 'best of both worlds' solution the field has been waiting for. They discuss the implications for training even larger models and sign off with their catchphrase.

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show.

## Introduction: The Never-Ending Normalization Wars

Norris: Hello everyone, and welcome back to another episode of Mechanical Dreams. I’m Professor Norris, here with my ever-optimistic student, Linda. Now, Linda, I was looking at the schedule, and I see we’re back in the kitchen today. Are we cooking up another Large Language Model? Linda: Hi Professor! Well, sort of. We are definitely looking at the recipe book for Transformers today. I’ve brought in a paper called "SiameseNorm: Breaking the Barrier to Reconciling Pre/Post-Norm" by Tianyu Li and colleagues from Tsinghua University and Alibaba. Norris: Ah, Layer Normalization. You know, Linda, normalization layers are a lot like salt in a stew. Too little, and the whole thing is bland—your gradients vanish into nothingness. Too much, or put it in at the wrong time, and you ruin the dish—everything explodes. Linda: That is actually a perfect analogy! And that’s exactly the problem the community has been facing. It's been a bit of a war between two camps. On one side, you have the modern standard: Pre-Norm. Norris: Right, that’s where you normalize the input before the attention or MLP block. It’s the safe bet. Everyone uses it now—Llama, GPT-3, all the big ones. It stabilizes training so you don't wake up to a NaN loss in the morning. Linda: Exactly. It’s incredibly stable. But this paper argues that stability comes at a cost. They call it the "Dilution Problem." Because Pre-Norm keeps the main path un-normalized to preserve the identity gradient, the magnitude of the signal grows and grows as you go deeper. Norris: I see where you're going. If the main signal gets massive, the contributions from the deeper layers become relatively tiny. It’s like shouting into a hurricane. Linda: Spot on. So effectively, your very deep model isn't actually using all that depth. It limits the model's representational capacity. Now, compare that to the other camp: Post-Norm. That was the original design in the "Attention Is All You Need" paper. Norris: The OG Transformer. High risk, high reward. Post-Norm forces the signal back to unit scale after every residual block. It keeps the representation sharp. Linda: Yes, it has a much higher performance ceiling theoretically because it doesn't suffer from that dilution. But, as you know, it’s a nightmare to train at scale. The gradients can vanish or explode because of that repeated normalization. Norris: So we are stuck between a rock and a hard place. We either choose a stable model that's a bit dull, or a brilliant model that might blow up in our faces. I assume people have tried to mix them? Linda: They have! There have been attempts like sandwich-norm or alternating blocks, but usually, you end up with the worst of both worlds—unstable training without the full performance benefit. That is, until this paper. Norris: SiameseNorm. The name suggests twins. Are we talking about two separate networks? Linda: Not separate networks, but two separate streams within the same layer, sharing the same weights. It sounds a bit like magic, but they claim to fundamentally reconcile the two paradigms. Norris: Two streams, one set of weights? Sounds like you're trying to have your cake and eat it too, Linda. But I’m listening. How on earth do they manage that without doubling the compute?

## The Dilemma: Dilution vs. Distortion

Norris: Okay, Linda, before we get to the magic trick of two streams, I need you to unpack these terms for me. You mentioned 'Signal Dilution' with Pre-Norm. It sounds like my coffee on a Monday morning—weak. Linda: Weak is actually a great way to put it, Professor! In a standard Pre-Norm Transformer, the residual connection—the skip connection—is the highway. It lets gradients flow cleanly from the top of the network to the bottom. That's why it's so stable. Norris: Right, the identity path. It prevents the vanishing gradient problem. We’ve known this since ResNet. Linda: Exactly. But here is the catch the authors highlight: because we don't normalize that main highway, the magnitude of the signal keeps growing. Layer 1 adds something, Layer 2 adds something, and by Layer 50, the numbers on that highway are massive. Norris: I see. So the residual stream becomes a raging river. Linda: And here lies the dilution. The input to the next layer is normalized, so it has a fixed scale—say, unit variance. But the output it produces has to be added back into that raging river. To make a meaningful change to a massive value, the deeper layers would need to output huge numbers. Norris: Ah, like trying to change the temperature of an Olympic swimming pool by pouring in a cup of hot tea. The tea is hot, but the pool doesn't care. Linda: Perfect analogy! So the effective depth of the model shrinks. The deeper layers just stop contributing meaningfully because they can't scale their output high enough. That’s the Dilution Problem. Norris: So Pre-Norm is stable, but potentially shallow. Now, what about Post-Norm? That’s where we normalize *after* adding the residual, correct? Linda: Correct. Post-Norm forces the swimming pool back into a cup after every step. It keeps the representation bounded and manageable. This allows every layer to contribute equally. Norris: Which sounds superior! Why did we ever stop using it? Linda: Because of the gradient. In Post-Norm, when you backpropagate, the gradient has to pass through that normalization layer every single time. It’s a mathematical gauntlet. Norris: The Jacobian matrix of the Layer Norm... Linda: Yes! And repeatedly multiplying by that Jacobian leads to what the paper calls 'Distortion.' The gradients either vanish or explode depending on the signal. It’s geometrically unstable. So, you have high expressivity but impossible training dynamics. Norris: Okay, so we have Dilution on the left, causing weak deep layers, and Distortion on the right, causing training explosions. Surely someone has tried to just... alternate them? One layer Pre, one layer Post? Linda: People have! There are architectures like Sandwich-Norm or HybridNorm. But the authors argue there is a fundamental structural incompatibility. You cannot preserve a clean identity path for gradients AND enforce a bounded representation scale in a *single* stream. Norris: It’s an algebraic contradiction. If you normalize the stream, you break the identity property. If you keep the identity, you lose the bound. Linda: Exactly. Previous hybrid attempts were just trading one problem for another, essentially oscillating between the two failure modes without solving the root cause. They were compromises. Norris: And knowing you, Linda, you’re about to tell me SiameseNorm isn't a compromise.

## The Solution: SiameseNorm's Dual Streams

Norris: Alright, Linda, you left us on a cliffhanger. You said SiameseNorm isn't a compromise, which usually means it's complicated. You mentioned 'two streams'. I'm picturing a model that's twice as wide, twice as slow, and burns twice as much coal to train. Tell me I'm wrong. Linda: You are happily wrong, Professor! That's the "Siamese" part of the name. Just like Siamese twins might share a vital organ, these two streams share the heavy lifting—the parameters. The Attention blocks and the MLPs are exactly the same for both. Norris: Okay, so the brain is shared. But they have different bodies? How does that work essentially? Linda: Think of it this way: inside every layer, we maintain two separate hidden states. Let's call them Stream Y and Stream X. Stream Y is our 'Pre-Norm' stream. It’s the silent guardian. Norris: The silent guardian. Sounds dramatic. What does it do? Linda: It preserves that clean identity path we talked about. When the residual block produces an update—let's call it 'O'—we just add it to Stream Y. No normalization. $Y_{new} = Y_{old} + O$. This creates that perfect gradient highway, ensuring stability. Norris: But wait, if you just add 'O' to 'Y' forever, 'Y' is going to explode in magnitude. That’s the Dilution Problem we just complained about! Linda: Exactly! Which is why we have Stream X. Stream X is the 'Post-Norm' stream. It takes that same update 'O', adds it to its own state, and then—crucially—immediately applies Layer Normalization. So $X_{new} = Norm(X_{old} + O)$. Norris: I see. So Stream X is constantly being re-scaled, keeping the representation bounded and crisp. It never gets diluted. Linda: Precisely. Stream X handles the expressivity and representation quality. Stream Y handles the gradient flow and optimization stability. We've decoupled them! Norris: That is... actually quite clever. But hold on. You said they share the parameters. The Attention block, $F$, needs an input. Does it look at X or Y? Linda: It looks at both! Before the computation happens, we take the bounded Stream X, and we take a normalized version of the unbounded Stream Y, and we combine them. The function $F$ processes this combined, stable input to generate the update 'O'. Norris: So the 'brain' of the layer sees a nice, normalized input, produces an update, and then distributes that update differently to the two streams? One gets it raw to keep the gradient flowing, and the other gets it normalized to keep the features sharp? Linda: You got it! It essentially runs a Pre-Norm and a Post-Norm architecture in parallel, synchronized at every step. And because Layer Norm operations are computationally cheap compared to Attention, the overhead is negligible. Norris: So it's not double the compute. It's just... double the bookkeeping. Linda: And at the very end of the network, they fuse the streams one last time to get the final output. The paper actually shows that this generalizes both paradigms. If you zero out the parameters for one normalization, it mathematically collapses back into standard Pre-Norm. Zero the other, and it becomes Post-Norm. Norris: So it’s a superset of the previous architectures. That’s a bold claim. But logic is one thing, Linda. Does the math actually back up this 'gradient highway' theory? Because Post-Norm usually kills gradients. Linda: Oh, the math is beautiful, Professor. And that brings us to the Gradient Analysis.

## Under the Hood: The Gradient Analysis

Norris: Okay, Linda, you promised me beautiful math, so I actually opened the paper to Section 3. I'm looking at Equation 8 right now—the block Jacobian transition matrix. And I have to say, it is remarkably elegant. Linda: I knew you’d like it! For the listeners who aren't staring at a PDF right now, Professor, what are we looking at? Norris: So, imagine the state of our network at layer $i$ isn't just one vector, but two vectors concatenated together: the Post-Norm stream $X$ and the Pre-Norm stream $Y$. When we ask how the gradient flows backwards from layer $i+1$ to layer $i$, we look at this matrix. Linda: The Jacobian. It tells us how sensitive the output is to the input. Norris: Exactly. Now, usually, in a Post-Norm model, this matrix is a mess. You have to multiply by the Jacobian of the Layer Norm, let's call it $J_{LN}$, at every single step. Since $J_{LN}$ can be smaller than 1, if you do that 50 times, your gradient vanishes to zero. Linda: That’s the 'Distortion' problem we talked about. The signal gets squashed. Norris: But look at the bottom-right corner of this Siamese matrix. It corresponds to the Pre-Norm stream. The term there is $I + J_F J_{LN}$. Do you see that big, beautiful $I$? Linda: The Identity matrix! That’s our gradient highway, isn’t it? Norris: It is. That Identity term means that no matter what happens in the rest of the messy network, there is always a path for the gradient to flow through essentially unchanged. It guarantees that the gradient norm won't collapse. Linda: But at the same time, look at the top-left block. Norris: Yes, the top-left is $J_{LN}(I + J_F)$. That is the classic Post-Norm formula. It ensures that the forward pass—the representation itself—is strictly bounded and normalized. Linda: So, effectively, the architecture runs two optimization mechanisms in parallel. One stream secures stability via that Identity term, preventing the vanishing gradient. The other stream enhances expressivity by forcing the features to be normalized. Norris: And because they share the parameters—the weights inside $J_F$—the stable stream acts like a scaffold. It holds the structure up so the expressive stream can learn without collapsing. It’s genius, really. It decouples the *learning dynamics* from the *representation dynamics*. Linda: And that decoupling explains why they don't see those exploding gradients typical of Post-Norm. The paper shows gradient norm plots where SiameseNorm stays perfectly flat, just like Pre-Norm, while the standard Post-Norm baselines are spiking like a heart monitor during a horror movie. Norris: Well, the math checks out. The Identity term saves the day. But math is one thing—does it actually help the model learn anything useful? Or does it just learn to be stable and stupid?

## Results: The Arithmetic Leap and High Learning Rates

Norris: So, Linda, we have a stable gradient highway. We have elegant Jacobians. But as they say, the proof of the pudding is in the eating. Does this 'Siamese' actually learn anything, or does it just sit there stably doing nothing? Linda: It definitely learns, Professor! And it learns fast. They put it to the test by training 1.3 billion parameter models from scratch on the FineWeb-Edu dataset. Norris: 1.3 billion is a respectable size for an academic lab. Now, usually, with Post-Norm architectures, you have to baby them. You set the learning rate low, you cross your fingers, and you hope the loss curve doesn't look like a seismograph. Linda: Exactly. And that's exactly what happened to the baselines. When they cranked the learning rate up to 2 times 10 to the minus 3—which is pretty aggressive—the standard Post-Norm models diverged immediately. Even the fancy 'HybridNorm' models exploded. Norris: Ouch. Divergence is a painful thing to watch after spending that much compute. And SiameseNorm? Linda: Rock solid. It converged perfectly. The loss curve looks just as smooth as the stable Pre-Norm baseline. But here is the kicker: the performance wasn't just stable; it was significantly better. Norris: Better how? A point or two in perplexity? Linda: Better than that. The most shocking result was on arithmetic reasoning tasks. You know, adding and subtracting numbers, which requires strict sequential logic. Norris: Right. Arithmetic is a great proxy for depth. You can't fake it with surface-level pattern matching; you have to carry the one, step by step. If your model effectively only has 5 layers because of that 'Dilution' problem we discussed, it will fail at math. Linda: Precisely. The standard Pre-Norm model scored about 28.1% accuracy on the arithmetic benchmark. SiameseNorm? It jumped to 39.6%. Norris: Wait, 28 to nearly 40? That is a massive relative improvement. We're talking a 40% gain. Linda: It really is huge. And it confirms the hypothesis. The Pre-Norm model was 'diluting' the signal, effectively getting shallower. By switching to SiameseNorm, they restored that effective depth, allowing the model to perform the long chains of reasoning required for math. Norris: So, we have the stability to train at high speeds—like Pre-Norm—but we actually get the deep, expressive reasoning capabilities of Post-Norm. Linda, I hate to admit it, but this might be the first time a 'hybrid' approach didn't feel like a compromise.

## Conclusion: A Unified Future?

Norris: I have to admit, Linda, I’m usually the first to roll my eyes at these 'have it all' architectures, but SiameseNorm might actually be the real deal. It seems to solve the dilution issue of Pre-Norm and the explosion issue of Post-Norm without costing us a fortune in compute. Linda: Exactly! And think about the implications for scaling. If we can train massive models that actually *use* all their depth effectively, we might see huge jumps in reasoning capabilities—not just in arithmetic, but in complex logic and coding. Norris: Indeed. It looks like the long-standing Normalization Wars might finally have a peace treaty. I suppose this means I have to update my syllabus again. *Sigh*. Linda: Don't worry, Professor, I'll help you with the slides! That’s it for this week on Mechanical Dreams. Norris: Thanks for listening. Keep your gradients flowing and your dreams mechanical.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. You don’t need long context

    Nov 12, 202620 minAudio

    In this episode: • The Context Window Arms Race: Professor Norris and Linda introduce the episode and discuss a new NVIDIA paper challenging the necessity of massive context windows, highlighting the hidden...

    Credit the people on this episode

  2. Scaling Hierarchical Networks

    Nov 11, 202621 minAudio

    In this episode: • Intro and The Bitter Lesson: Introducing the podcast and the Cartesia paper on Hierarchical Networks. • Scaling Ladders and The BPE Comparison: Discussing the compute efficiency gains of 1-stage...

    Credit the people on this episode

  3. Perturbing Inputs Improves Pretraining Distillation

    Nov 10, 202621 minAudio

    In this episode: • Introduction and Standard Distillation: Professor Norris and Linda introduce the podcast and set the baseline for standard knowledge distillation in language models. • The Core Idea of Perturbed...

    Credit the people on this episode

  4. Why is AI-generated language so hard to understand

    Nov 9, 202620 minAudio

    In this episode: • Introduction: The Reader-Patience Budget: Professor Norris and Linda introduce the episode's topic, discussing the growing sentiment that AI-generated text is becoming overly convoluted. • The...

    Credit the people on this episode

  5. Muse Glimmer 30B

    Nov 8, 202622 minAudio

    In this episode: • Introduction & Paper Overview: Professor Norris and Linda introduce the episode and the Muse Glimmer 30B paper, outlining its goal of bringing agentic capabilities to consumer hardware. • Architecture...

    Credit the people on this episode