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

Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings

Jan 16, 202620 minAudio
ShareXLinkedInFacebookWhatsAppEmail

In this episode: • To PE or Not to PE?: Professor Norris and Linda kick off the episode by introducing the paper 'Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings' (DroPE). Norris expresses immediate skepticism about removing such a fundamental component of the Transformer architecture, setting the stage for the debate. • The Inductive Bias Paradox: Linda explains the paper's first major observation: Positional Embeddings (PEs) are necessary scaffolding for fast training convergence but become a straitjacket for zero-shot generalization. They discuss the theoretical findings regarding 'attention positional bias' and why NoPE models struggle to learn initially. • Why Scaling Frequency Breaks Meaning: The hosts dive into the technical critique of current context-extension methods like YaRN and RoPE-scaling. Linda details how compressing low frequencies to fit longer contexts distorts 'semantic heads' - the parts of the model that match content rather than position - causing failures in retrieval tasks. • The DroPE Solution: Remove the Training Wheels: They discuss the proposed method: training with RoPE, then stripping it away and doing a quick recalibration. Norris warms up to the analogy of PEs acting as 'scaffolding' that should be removed once the building (the model) is self-supporting. • Needles in Haystacks and Future Architectures: Reviewing the empirical results, including the massive improvements on Needle-in-a-Haystack benchmarks compared to YaRN. The episode concludes with a discussion on whether future foundation models will all be trained with this 'drop-and-recalibrate' paradigm.

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

Transcript

From the show.

## To PE or Not to PE?

Norris: Hello everyone, and welcome back to another episode of Mechanical Dreams. I am, as always, Professor Norris. I’ve got my coffee, I’ve got my skepticism, and I’ve got my brilliant student, Linda, sitting across from me. How are we doing today, Linda? Linda: I'm doing great, Professor! And you might want to put that coffee down, because today’s paper is going to make you spill it. It’s titled 'Extending the Context of Pretrained LLMs by Dropping Their Positional Embeddings'. Norris: Dropping... their positional embeddings? Wait, hold on. Linda, we teach this in week one of the NLP course. The Self-Attention mechanism is permutation invariant. Without positional embeddings, a Transformer is just a very expensive bag-of-words model. 'The dog bit the man' becomes mathematically identical to 'The man bit the dog.' Linda: Exactly! That’s the dogma. Without position encoding, the model shouldn't know left from right or start from finish. Norris: It’s not dogma, it’s linear algebra! If they drop the position information, aren't they just lobotomizing the model? Linda: You’d think so, right? But this paper by Gelberg and colleagues from Sakana AI and Oxford argues that while Positional Embeddings—specifically RoPE, or Rotary Positional Embeddings—are crucial for learning, they actually become a straitjacket when we try to push the model beyond its training context length. Norris: A straitjacket? They are the map, Linda! They tell the model where the tokens are. If I take away your map while you're driving, you don't suddenly become better at exploring new cities. Linda: Good analogy, but let me tweak it. Imagine positional embeddings are like training wheels on a bicycle. You absolutely need them to learn how to ride without falling over immediately. That’s the 'convergence' part. Norris: Okay... Linda: But once you know how to ride, those training wheels prevent you from banking into turns or going off-road. The authors claim PEs provide a strong inductive bias that helps the model learn initially, but explicit reliance on them prevents zero-shot generalization to longer sequences. Norris: So the proposal is... what? We train with the training wheels, and then mid-ride, we just unbolt them and hope the model doesn't crash? Linda: Essentially, yes! They call it DroPE. You take a fully pretrained model, remove the positional embeddings entirely, run a very short recalibration phase—just a tiny fraction of the original training budget—and suddenly the model can handle contexts far longer than it ever saw during training. Norris: That sounds incredibly risky. If you remove the explicit position signal, how does the model know which token is which? Does it just guess based on context? Linda: It turns out the causal mask—the fact that tokens can only attend to previous tokens—already provides a lot of implicit positional information. But the really interesting part is why keeping the old embeddings hurts so much. It has to do with how we currently try to stretch context, like with RoPE-scaling. Norris: Ah, yes, the dark art of frequency scaling. I've always felt that was a bit of a hack. 'Just squeeze the sine waves, it'll be fine,' they say. Linda: Exactly. And this paper mathematically shows why that 'squeeze' breaks the model's semantic understanding. It’s not just a hack; it’s a destructive one. Norris: Well, color me intrigued. I’m still terrified of a model with no sense of direction, but if they have the math to back it up, let’s hear it. Take me through this 'Inductive Bias' argument.

## The Inductive Bias Paradox

Norris: Alright, Linda, I'm stuck on this 'training wheels' idea. If the model can ride the bike without the wheels—if it can function without Positional Embeddings—why do we bolt them on in the first place? Why not just train a 'naked' Transformer from scratch? I believe the cool kids call them 'NoPE' models? Linda: They do call them NoPE models—short for No Positional Embeddings. And that’s exactly the first thing the authors investigated. They trained a NoPE model alongside a standard RoPE model. And Professor? The NoPE model was a disaster. Norris: Aha! Vindication! So the bag-of-words strikes back. Linda: Not exactly. It’s not that the NoPE model *couldn't* learn; it’s that it learned painfully slowly. The loss curve was consistently worse throughout training. It turns out that while the causal mask—the thing that prevents looking into the future—technically provides enough information to distinguish positions, extracting that information is an optimization nightmare. Norris: Optimization nightmare? You mean the gradients aren't flowing? Linda: Precisely. The paper defines something called 'Attention Positional Bias.' It’s a metric quantifying how much an attention head focuses on specific relative positions—like 'look at the previous token' or 'look at the diagonal.' They prove mathematically that in a NoPE model, this bias develops at a bounded rate. Norris: Bounded rate... meaning it can't learn to focus on position quickly? Linda: Right. Consider a thought experiment they propose: imagine feeding the model a constant sequence. Just the word 'Buffalo' repeated ten times. Norris: Buffalo buffalo Buffalo buffalo buffalo... yes, a grammatically valid sentence, I might add. Linda: If you feed that into a NoPE model at initialization, every token looks identical. The attention mechanism sees no difference between the first 'Buffalo' and the fifth. The output is uniform. The gradients for the queries and keys vanish because there's no variation to latch onto. The model is stuck in a symmetry trap. Norris: But with RoPE... Linda: With RoPE, even if the tokens are identical, the vectors are rotated differently based on their position. The fifth 'Buffalo' points in a different direction in vector space than the first one. The symmetry is broken immediately. The model instantly knows, 'Hey, these things are distinct,' and the gradients can flow. Norris: I see. So RoPE is an inductive bias that shouts, 'Order matters!' right from step one. It effectively shapes the loss landscape so the model falls into the right pits of success. Linda: Exactly! It accelerates convergence massively. But here is the paradox, and it’s the crux of the paper: That same strong signal—those specific rotations—becomes a liability later. Norris: Because the rotations are frequency-based, right? If you train on a sequence of length 1,000, the model learns specific rotation patterns. If you suddenly hand it token 2,000... Linda: The rotation at position 2,000 is something it has never seen. It’s out of distribution. The explicit scaffolding that helped build the structure is now rigid and inflexible. The NoPE model, theoretically, wouldn't have this problem because it has no rigid position codes—but we can't train it! Norris: So we are caught between a rock and a hard place. We need the embeddings to build the house, but we need to demolish them to expand the rooms. It really is a paradox. We use RoPE to teach the model that position exists, but once it knows that... Linda: ...we don't need the teacher anymore. The paper argues that once the weights have adjusted to the flow of language, the deep network has internalized the concept of position. The explicit rotations become redundant scaffolding. Norris: Fascinating. So the solution isn't to build a better map, but to trust that the driver has memorized the route. But Linda, you mentioned earlier that 'stretching' the map—this scaling business everyone does—actually breaks things. Why can't we just adjust the rotations? Linda: That is where things get really interesting, Professor. It turns out that when we mess with those frequencies to fit longer contexts, we aren't just shifting positions; we're destroying meaning. It has to do with 'Semantic Heads'. Norris: Semantic Heads? Sounds like a band name. Let's get into that.

## Why Scaling Frequency Breaks Meaning

Norris: Okay, Linda, let’s talk about this 'dark art' of frequency scaling. To my simple mind, if I have a ruler that measures 10 inches, and I need to measure something that is 20 inches, I just... get a longer ruler? Or I say, 'Okay, every inch on this ruler now counts as two inches.' Why is this breaking the model? Linda: That strategy you just described—'every inch counts as two'—is basically Linear Position Interpolation. It was the first trick people tried. And it works... sort of. But it reduces the resolution of the model. It makes everything blurry. Norris: Blurry I can understand. But you said these methods 'break meaning.' That sounds far more dramatic than just a loss of resolution. Linda: It is. To understand why, we have to look at what the different frequencies in RoPE are actually doing. The paper makes a fascinating distinction between two types of attention heads: 'Positional Heads' and 'Semantic Heads'. Norris: Semantic Heads? Sounds like a band I saw in the 90s. I assume these are the heads looking for content rather than location? Linda: Exactly. The authors found that attention heads which rely on high-frequency components of RoPE tend to care about relative position—things like 'attend to the previous token' or 'attend to the token three steps back.' These are your syntactic, local structures. Norris: Makes sense. High frequency means rapid changes, good for short distances. Linda: Right. But the low-frequency components—the waves that oscillate very slowly—are used by 'Semantic Heads.' These heads are looking for matching content, like a query for 'capital of France' looking for 'Paris' 5,000 tokens ago. They rely on the dot product of the content vectors, and the positional rotation is just a gentle nudge. Norris: So, high frequency is for 'where is it?', and low frequency is for 'what is it?'. Linda: Precisely. Now, here is the trap. When you want to extend the context length, say by 4x, you have to make sure the position values don't go 'out of bounds'—mathematically, you want the phase of the rotation to stay within the range the model saw during training. Norris: Because if the rotation angle is completely new, the model freaks out. It’s out-of-distribution. Linda: Correct. And to keep the phase in range for very long sequences, you are mathematically forced to compress the low frequencies the most. You have to squash those long waves significantly to fit them into the 'known' window. Norris: I think I see where this is going. If you squash the low frequencies... Linda: ...you are distorting the signal that the Semantic Heads rely on! The paper shows this with heatmaps. In a standard model, if you search for a 'needle' in a haystack, the attention spikes right on the needle. But when you apply scaling methods like YaRN, which aggressively compress low frequencies, that attention spike gets shifted. Norris: Shifted? So the model is looking for 'Paris' but glancing at the word 'baguette' five sentences later? Linda: Or it misses it entirely because the 'semantic match' signal has been warped. The rotation angle it *should* have seen for a match is now different because we squashed the wave. The paper calls this 'inevitable extrapolation failure.' Norris: This explains why these models often pass perplexity benchmarks but fail retrieval tasks. Perplexity is mostly about predicting the next word, which is very local—handled by those high-frequency Positional Heads which aren't compressed as much. Linda: Spot on, Professor! They can write a grammatically correct sentence because the local syntax is intact, but they can't track a plot point from chapter one because we broke their long-term memory mechanism by compressing the semantic frequencies. Norris: So, in our attempt to give them a longer map, we essentially erased the landmarks. We can drive further, but we have no idea what we're looking at. Linda: And that is why the authors argue we shouldn't be trying to fix RoPE. We should just get rid of it. If the scaffolding is preventing the building from expanding... tear it down. Norris: Tear it down. It sounds so radical. But if RoPE is the training wheels, and scaling RoPE is like trying to bend the training wheels into a highway shape... I suppose taking them off makes sense. But surely there is a catch? You can't just delete a matrix and expect the code to run.

## The DroPE Solution: Remove the Training Wheels

Norris: So, let's get down to brass tacks. You are telling me that the proposed solution to this grand paradox is to simply... delete the positional embeddings? Just hit 'backspace' on that part of the code? Linda: Essentially, yes! That is the 'Dro' in DroPE—Dropping Positional Embeddings. The recipe is surprisingly simple. You take a standard, state-of-the-art model pretrained with RoPE—like a Llama or a Qwen model—and you strip out the rotation mechanism from the attention layers. Norris: And the model doesn't immediately suffer a nervous breakdown? If I suddenly woke up and realized I had no sense of direction, I’d panic. Linda: Oh, it panics a little bit. If you just drop RoPE and try to run inference immediately, the perplexity spikes. It’s like taking the training wheels off while the bike is moving—there’s a moment of wobble. Norris: A moment of wobble sounds like an understatement for a multi-billion parameter model. Linda: But that’s where the second step comes in: Recalibration. You continue training the model for a tiny fraction of the original budget—we're talking about 1% or less of the total training tokens. And here is the magic part: you do this recalibration on the *original* short context length. Norris: Wait, run that by me again. To get the model to understand long contexts... you train it on short contexts? Linda: Yes! Because you aren't trying to teach it 'long distance relationships' from scratch. You are just teaching it to stop relying on the explicit rotations. Once it stops looking for those specific frequency patterns we discussed, it naturally falls back on the implicit positional information provided by the causal mask and the semantic content. Norris: So the 'wobble' is just the model realizing, 'Oh, I don't need to check the rotation angle anymore, I can just look at the content and the order the words came in.' Linda: Exactly. And because the model has already learned the deep structure of language during the massive pretraining phase, this adjustment happens incredibly fast. The paper shows that within a few billion tokens—which is nothing in LLM terms—the performance recovers to match the original model. Norris: That is remarkably efficient. Usually, context extension requires fine-tuning on massive, computationally expensive long sequences. 'Long-context fine-tuning' is the bane of every GPU cluster's existence. Linda: Right? That's the beauty of it. DroPE gives you what they call 'Zero-Shot Context Extension.' You recalibrate on short sequences, but because you've removed the rigid RoPE map that constrained the model, it can suddenly generalize to sequences 2x, 4x, or even 8x longer without ever seeing them during training. Norris: It really does fit your analogy perfectly. The training wheels—RoPE—got you up to speed. You take them off, you wobble for a second—recalibration—and then suddenly you can ride as far as you want because there's nothing mechanically stopping the wheels from turning. Linda: And the best part? It works on existing models. You don't have to train from scratch. You can take a Llama-2 or a SmolLM that’s already been trained on trillions of tokens, apply DroPE, and boom—you’ve unlocked long context for a fraction of the cost. Norris: Well, that sounds almost too good to be true, Linda. Usually, when you get something for free in machine learning, you pay for it in stability or accuracy. Does this actually hold up when you really push it? I want to see the numbers.

## Needles in Haystacks and Future Architectures

Norris: Right, Linda. You've sold me on the theory. The training wheels are off, the scaffolding is down. But as we say in the faculty lounge when the grant money runs out: show me the numbers. Linda: I thought you'd never ask. Let’s look at the 'Needle-in-a-Haystack' test. You know the one—hide a specific passcode in a mountain of text and ask the model to find it. But the authors didn't just do the easy version; they did the 'Multi-Key' version, where you have to retrieve multiple specific items associated with different keys. Norris: The nightmare scenario for a model with 'blurry' attention, as we discussed. Linda: Exactly. So, they took a standard RoPE model and extended it using YaRN—that popular frequency scaling method. On the Multi-Key task at 2x context length, the YaRN model scored... wait for it... 0.5%. Norris: Zero point five percent? That's statistically indistinguishable from a random guess. Actually, it might be worse than a random guess. Linda: It basically failed completely. It couldn't handle the frequency compression. Now, the DroPE model? 41.6%. Norris: Forty-one percent? That is... well, that’s an order of magnitude difference. That’s the difference between a broken product and a working one. Linda: And remember, this is Zero-Shot. The DroPE model never saw sequences that long during its recalibration. It just... understood how to look for the information because we stopped confusing it with warped position signals. Norris: It really validates that 'Semantic Head' theory. Once you remove the distorted position signal, the model can actually use its semantic understanding to match 'Key' to 'Value', regardless of how far apart they are. Linda: They also tested this on real-world models, like 'SmolLM' and even a Llama-2-7B. In every case, DroPE outperformed the scaling methods on long-context QA and summarization. It’s consistent across scales. Norris: So, where does this leave us? Is RoPE dead? Should we hold a funeral for Rotary Embeddings? Linda: Not at all! RoPE is dead; long live RoPE. We still need it desperately for that initial training phase. But I think the standard pipeline for Foundation Models is going to change. Norris: I can see it now. Phase 1: Train with RoPE to build the brain. Phase 2: Drop the RoPE and recalibrate to free the mind. It’s almost philosophical. Linda: It is! It suggests that 'position' is a scaffold we use to learn 'meaning,' but true understanding is independent of absolute position. It’s a very elegant finding. Norris: Well, I have to admit, I started this episode ready to defend my precious coordinate systems, but you—and the authors—have convinced me. Sometimes you have to let go of the map to see the territory. Linda: I’m glad to hear it, Professor. Maybe next week I can convince you to drop your 'scaffolding'—that old tweed jacket? Norris: Let’s not get carried away, Linda. Some inductive biases are permanent. That’s all for this week on Mechanical Dreams. Read the paper, drop your embeddings, and we’ll see you next time.

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