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

Perplexity Cannot Always Tell Right from Wrong

Apr 1, 202624 minAudio
ShareXLinkedInFacebookWhatsAppEmail

In this episode: • Introduction: The Gold Standard in Question: Professor Norris and Linda introduce the episode's paper from DeepMind, setting the stage by defining perplexity and explaining why it is universally used to evaluate language models. • The Copy Task and the Illusion of Confidence: Linda breaks down the theoretical proof using a bitstring copy task, explaining how high confidence in a decoder-only Transformer mathematically guarantees blind spots that perplexity fails to capture. • Iso-Perplexity Curves: Trading Accuracy for Arrogance: The hosts dive into the mathematics of iso-perplexity curves. Professor Norris plays devil's advocate while Linda explains how an overconfident, less accurate model can achieve a better perplexity score than a well-calibrated, accurate one. • Out of Distribution: Gemma 3 and the Parity Problem: They discuss the empirical evidence, including tests on Gemma 3 4B and the parity prediction task, highlighting how distribution shifts exacerbate the metric's failure and cause vanishing gradients. • Conclusions: Rethinking Model Selection: Wrapping up the discussion, Norris and Linda summarize the practical implications for AI researchers and discuss what the community should consider instead of blindly trusting perplexity.

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

Transcript

From the show.

## Introduction: The Gold Standard in Question

Linda: Welcome to another episode of Mechanical Dreams, the podcast where we dive deep into the gears of machine learning and natural language processing! I am your host, Linda. Norris: And I am Professor Norris. Welcome back, everyone. Linda, I see you have brought a rather provocative paper to the studio today. Usually, you bring me flashy new architectures or scaling laws, but today it seems you are taking aim at one of the foundational pillars of our field. Linda: That is right, Professor! Today we are looking at a brand new preprint from researchers at Google DeepMind titled 'Perplexity Cannot Always Tell Right from Wrong'. Norris: A title perfectly designed to raise the blood pressure of any classical NLP practitioner. Perplexity is practically the gold standard for evaluating language models! For our listeners who might just be starting their graduate studies, perplexity is essentially a measure of how 'surprised' a model is by ground-truth data. Linda: Exactly. Mathematically, it is the exponentiated average negative log-likelihood of a sequence. So, a lower perplexity means the model is assigning a higher probability to the correct sequence of tokens. Norris: It is simple, elegant, and universally used. When we train autoregressive models, we are basically optimizing for log-likelihood anyway. It is computationally cheap, and if you have no other readily available performance metric, you report perplexity and call it a day. And historically, it works! A model with low perplexity generally generates coherent text. So, why is DeepMind telling us our favorite metric might be leading us astray? Linda: Well, the paper argues that we should not blindly trust perplexity for model selection, especially as context windows get longer and models get more capable. The core issue they highlight is that perplexity bundles two completely different things together: the correctness of the prediction, and the model's confidence in that prediction. Norris: Hmm. Correctness and confidence. If a model predicts the right token, it should be confident. I am failing to see the disconnect. If it is wrong but highly confident, the log penalty is massive. Perplexity punishes overconfident mistakes heavily, does it not? Linda: In theory, yes. But what if a model is slightly less accurate overall, meaning it gets more total tokens wrong across a dataset, but is extremely confident when it happens to be right? The authors show that such a model can actually achieve a lower, theoretically 'better', perplexity than a model that gets more answers right but is better calibrated and slightly less arrogant about its predictions. Norris: Wait. You are telling me that a more accurate model can lose a head-to-head perplexity comparison just because it exercises a little mathematical humility? Linda: Precisely! And the authors do not just show this empirically. They provide rigorous analytical proofs leveraging recent theoretical results on Transformer continuity. They show that if a decoder-only Transformer is highly confident, it mathematically guarantees the existence of severe blind spots that barely make a dent in the overall perplexity score. Norris: Color me highly skeptical, Linda. To claim that a fundamental mathematical metric is structurally biased towards confident but incorrect models is a massive, paradigm-shifting claim. I am going to need to see some incredibly strong evidence before I rewrite my syllabus and throw perplexity out the window. Linda: Oh, I brought the receipts, Professor. In the next segment, we will dive right into their first theoretical proof involving a bitstring copy task. Grab your notepad, because the math is both beautiful and a little bit terrifying.

## The Copy Task and the Illusion of Confidence

Linda: Alright Professor, we established that perplexity might be flawed. Let us look at the actual theoretical proof from the paper. I hope you have your mental chalkboard ready. Norris: I always do, Linda. You said they used a copy task to prove this? Mechanistically, that is a great proxy. A sequence of bits, a separator token, and the model just has to spit the exact sequence back out. It is simple to define correctness, but notoriously tricky for language models to learn robustly. Linda: Exactly. They specifically look at decoder-only Transformers using Compact Position Embeddings, or CPE. That covers models using Rotary Position Embeddings, which is practically the industry standard right now. Norris: Right, RoPE is everywhere. So what is the mathematical trap? Linda: It relies on a recent theorem by Pasten et al. regarding Transformer continuity. The theorem states that for these CPE models, if two input sequences are close enough in relativised Hamming distance, the model's output probabilities will be incredibly close. Small changes in input guarantee small changes in output. Norris: That sounds like a desirable property. We generally want our neural networks to be continuous and not chaotic. Linda: It is desirable, until the model becomes too confident! Let us say we have a very long bitstring, which we will call sequence Alpha. The model has learned the task well and copies Alpha perfectly with extremely high confidence. We will call that confidence 1 minus gamma, where gamma is a tiny number. Norris: Okay, so the model is practically certain of its prediction for every single bit in sequence Alpha. Linda: Yes! But now, because sequence Alpha is so long, we can construct a second sequence, Beta, by flipping exactly one bit in Alpha. Because the sequences are very long, that single bit flip means the relativised Hamming distance between Alpha and Beta is almost zero. Norris: Ah. I see the jaws of the trap closing. Because the distance is tiny, the continuity theorem forces the model to produce almost the exact same logits for sequence Beta as it did for sequence Alpha. Linda: Precisely! So when prompted with sequence Beta, the model confidently outputs the bits for sequence Alpha. It completely fails the copy task. Norris: Well, to play devil's advocate, models make mistakes on slightly perturbed data all the time. That alone does not indict perplexity. Linda: Ah, but calculate the perplexity for sequence Beta, Professor! Assuming greedy decoding, the model makes exactly one mistake at the flipped bit, but gets every other bit right with near-perfect confidence. Norris: Let me think. Perplexity is derived from the average negative log-likelihood across the sequence length, N. For sequence Beta, we have N minus 1 highly confident correct tokens, and one token with a terrible log-likelihood. But wait... as N goes to infinity... Linda: Exactly! Norris: Good heavens. The massive penalty from that single incorrect token gets divided by N. The limit of the log-perplexity for sequence Beta approaches zero! The averaging process literally washes the failure away. Linda: You nailed it! The authors state it plainly: the log-perplexity of wrong next-token predictors can arbitrarily approach zero. The model is confidently wrong, but your metric tells you it is absolutely perfect. Norris: That is actually terrifying for long-context evaluations. We are routinely feeding models hundreds of thousands of tokens. If a model hallucinates a critical financial figure in a massive document, but perfectly recites all the boilerplate text around it, perplexity will completely hide the error! Linda: Exactly! And they proved this holds under stochastic sampling too, using Boole's inequality, not just greedy decoding. The very thing we train models to do, which is to become highly confident on the training distribution, mechanistically guarantees these blind spots. Norris: I have to admit, Linda, the math is undeniable. It exposes a fundamental flaw in using an averaged metric over long contexts. But this is a constructed, adversarial sequence. Does this mathematical quirk actually ruin model selection in practice across a realistic dataset? Linda: Oh, it absolutely does. Because this dynamic allows models to do something very sneaky: trade actual accuracy for pure arrogance. In our next chapter, we will look at their iso-perplexity curves to see exactly how models game the system.

## Iso-Perplexity Curves: Trading Accuracy for Arrogance

Linda: So, Professor, we have seen how perplexity can completely mask a severe failure in a single, long sequence. But I know what you are thinking. Norris: You usually do, Linda. I am thinking that a single adversarial sequence is a fantastic parlor trick, but we do not train or evaluate models on a single sequence. We evaluate them across vast datasets. Does this anomaly actually scale up to ruin our dataset-wide model selection? Linda: I am so glad you asked! Because the authors did not stop at the copy task. They wanted to prove that this is not just an artifact of how perplexity is averaged over sequence length. To do that, they constructed an analytic framework to study pointwise perplexity. No averaging over tokens, just pure, isolated predictions. Norris: Okay, stripping away the context length. How did they set that up? You cannot easily analyze the logits of a 50-thousand word vocabulary mathematically. Linda: Exactly, so they abstracted the problem into a binary classification setup. This lets us treat the model's accuracy, which we will call 'a', and its confidence, '1 minus gamma', as simple scalar variables between 0 and 1. We assume the model makes all its decisions with identical confidence. Norris: A spherical cow in a vacuum! I love a good toy model. It makes the math tractable. So if we have accuracy 'a' and confidence '1 minus gamma', the log-perplexity over the dataset is just a weighted sum of two terms: the times it is right, and the times it is wrong. Linda: Precisely. The formula becomes: negative 'a' times the log of '1 minus gamma', minus '1 minus a' times the log of 'gamma'. With that formula, the authors plotted what they call 'iso-perplexity curves'. Norris: Iso-perplexity curves... So, like a topological map. You have accuracy on one axis, confidence on the other, and the curve represents a single, fixed perplexity score. Any point on that line is evaluated exactly the same by our metric, regardless of its underlying accuracy or confidence. Linda: That is exactly it. Now, suppose we have a base model, and we want to select a new model that has become slightly more confident. Its confidence shifts by a factor of delta gamma. Because the log function has a drastically higher rate of change near zero than near one, the change in the perplexity terms is not symmetrical. Norris: Ah, I see where this is going. If you increase confidence, the penalty for the answers you get wrong grows much faster than the reward for the answers you get right. So logically, to keep the perplexity score from getting worse, the model must simultaneously increase its accuracy to compensate. Linda: That is the critical accuracy point! And that is where the curves reveal something incredibly troubling. The authors looked at two specific regimes. First, they fixed the accuracy at 0.5—an entirely unreliable model—and varied the starting confidence. They found that for many confidence shifts, the model requires an accuracy increase of 5 to 10 percentage points just to justify its new confidence! Norris: A 5 to 10 percent jump in accuracy is massive in practice! Are you saying that if a model improves its accuracy by, say, 3 percent, but becomes significantly more confident, its perplexity might actually get worse? Linda: Yes! The metric will tell you to reject the 3 percent more accurate model because it does not like the confidence shift. But it gets even worse in the second regime they tested. They started with an unconfident model and varied the starting accuracy. This revealed clear 'unfavourable regions', or what they call 'unjustified free lunch' zones. Norris: An unjustified free lunch in machine learning? Now you are speaking my language. What does this free lunch look like on the graph? Linda: If a model is unconfident but already sufficiently accurate, it is possible to improve its perplexity simply by making it more confident, even if that leads to a significant drop in actual accuracy! Norris: Wait. Let me make sure I am grasping the magnitude of this. I have Model A, which correctly answers 75% of my dataset but is mathematically hesitant. I also have Model B, which only answers 70% correctly, but is stubbornly, loudly certain about everything it says. Linda: Under these iso-perplexity curves, Perplexity will point at Model B and crown it the winner. Norris: That is astonishing. It completely violates the core assumption of model selection. We assume perplexity is a proxy for predictive power, but here, it is acting as a proxy for pure arrogance. We are selecting models that are worse at the actual task just because they have louder logits. Linda: It is a chilling thought for AI deployment, especially in fields where accuracy is hard to measure directly. However, the authors do point out one mathematical safeguard. No matter what the starting confidence is, truly extraordinary confidence requires truly extraordinary evidence. Norris: Meaning as confidence approaches absolute certainty—100%—the penalty for being wrong finally reaches infinity and overwhelms the system? Linda: Exactly. A perfectly confident model must be perfectly accurate, otherwise it will always be rejected by perplexity. The math holds at the absolute limit. Norris: Well, thank goodness for small favors! But in the real world, neural networks rarely output probabilities of exactly 1.0 or 0.0. They live in those messy middle regions, 80%, 90%, 95% confidence. And what you are telling me is that in those very typical operating ranges, our gold standard metric has a massive blind spot for confident incompetence. Linda: That is the perfect way to put it. And it begs the question: how often does this theoretical 'free lunch' actually happen during real-world training? Norris: I am almost afraid to ask. Let me guess, the paper has empirical data on exactly that? Linda: They do! And we are going to dive into their experiments with the parity prediction task and out-of-distribution data right after the break. Spoiler alert, Professor: the models fall for it hook, line, and sinker.

## Out of Distribution: Gemma 3 and the Parity Problem

Linda: Welcome back! Before the break, we left off on a bit of a cliffhanger. We saw mathematically how perplexity can favor a confident, inaccurate model over a more accurate but cautious one. But Professor, you rightly asked if this actually happens in practice. Norris: Indeed. A mathematical vulnerability is one thing, but neural networks are messy, stochastic beasts. Did the DeepMind team actually catch models behaving this way in the wild? Linda: They absolutely did. First, they actually prompted Gemma 3, specifically the 4-billion parameter version, with the copy task we discussed earlier. And sure enough, the continuity held. The gap between the probability distributions on the correct sequence and the corrupted sequence diminished just as the theory predicted. Norris: Fascinating. So even a state-of-the-art LLM falls into the continuity trap. Though, I imagine analyzing a full language model with a massive vocabulary was a bit noisier than a simple bitstring toy model. Linda: It was! They noted some funny caveats. Because LLMs famously struggle to count, Gemma sometimes tried to prematurely predict newline characters or end-of-turn tokens, which added some noise to the probability distributions. But the overall trend of the perplexities collapsing completely held up. Norris: And you mentioned earlier something about vanishing gradients? How does that tie into this empirical testing? Linda: Ah, yes! This is a crucial corollary they proved. As the model perfectly learns the correct sequence, its loss goes to zero. But because of the continuity forcing the model's outputs to be identical for the corrupted sequence, the mathematical gradient on that incorrect sample also vanishes to zero! The training signal completely disappears, meaning the model literally cannot learn to fix its mistake. Norris: Good heavens. It is not just a blind spot in evaluation; it is a blind spot baked into the learning dynamics themselves. The model becomes blind to its own confident errors. Linda: Exactly! But the real nail in the coffin for perplexity as a model selector came when they tested for distribution shifts using the Parity task. Norris: The Parity task! Oh, I know this one. You give the model a string of ones and zeros, and it has to predict the exclusive-or, or XOR, of all the bits. It is mechanistically very simple to calculate, but we know theoretically that Transformers struggle immensely to generalize that logic to longer sequence lengths. Linda: Spot on. It is the perfect testbed for out-of-distribution, or OOD, performance. They trained a Transformer on bitstrings up to length 16. Then, they saved checkpoints every 100 training steps and evaluated them on a held-out dataset of much longer bitstrings—length 128. Norris: A classic length-generalization stress test. And what metrics were they tracking across these checkpoints? Linda: They tracked the log-perplexity, the micro-F1 score to measure actual accuracy, and the averaged Shannon entropy to act as a proxy for the model's overall confidence. Lower entropy means higher confidence. Norris: Let me guess the in-distribution results first. On the shorter length-16 strings, perplexity probably did its job perfectly fine, right? Linda: You are correct. In-distribution, there was a very strong negative correlation between perplexity and F1 score—a Pearson coefficient of negative 0.94. As the model got more accurate, perplexity reliably went down. Everything working exactly as it says on the tin. Norris: But I am bracing myself for the out-of-distribution results on the length-128 strings. Linda: It completely fell apart! In the OOD regime, the correlation flipped. They observed a positive correlation of 0.31. That means lower perplexity actually correlated with lower accuracy! Norris: Wait. Are you saying that if a researcher used perplexity to pick the best checkpoint for deployment on longer sequences, they would actively choose a worse model? Linda: Yes! In fact, the specific checkpoint that achieved the absolute optimal OOD accuracy was one of the worst checkpoints in terms of OOD perplexity. Norris: That is incredible. And does the Shannon entropy data explain why? Does it map back to the 'arrogance' we saw on the iso-perplexity curves? Linda: Perfectly. The checkpoint with the best OOD accuracy actually had one of the lowest entropies in the entire dataset. It was highly accurate and highly confident. Norris: Ah! I see it now. Because it was so highly confident, when it did inevitably make a mistake on those challenging 128-bit strings, the log-penalty from the cross-entropy loss was astronomical. Perplexity punished the best model because its confidence amplified its few errors. Linda: Exactly! Meanwhile, models that were worse at the actual parity task, but were perhaps a bit more hesitant and had higher entropy, didn't suffer those massive spikes in their loss function. They achieved better perplexity scores despite being worse predictors. Norris: They fell perfectly into that 'unjustified free lunch' zone we discussed. The metric rewarded their hesitation more than it rewarded actual predictive power. Linda, I have to concede. When distribution shifts are involved—which is almost always the case in real-world AI deployment—perplexity is actively misleading. Linda: It is a paradigm-shifting realization. In our final chapter, we will wrap up what this means for the field, and discuss how we should rethink model selection moving forward.

## Conclusions: Rethinking Model Selection

Linda: Welcome back to the final segment of our show. Professor, we have officially taken perplexity to the woodshed today. Norris: We certainly have, Linda. From the mathematical traps of the copy task to the complete breakdown of correlation in the parity problem, it is clear our beloved metric has some serious explaining to do. Linda: The authors wrap up their paper by referencing recent work by Fang and colleagues. Fang argued that averaging perplexity over thousands of tokens washes out the signal. The DeepMind team agrees, but their theoretical proofs show the rot goes even deeper. Norris: Indeed. It is not merely the averaging process that is flawed. It is the metric's inherent skew. It actively punishes well-calibrated, highly accurate models that happen to be confident when they make a rare mistake, while rewarding hesitant, less accurate models. That is a fundamental misalignment for out-of-distribution tasks. Linda: So, the million-dollar question for our listeners, who are out there training and deploying these models: what do we do? If we cannot trust perplexity for long-context or out-of-distribution model selection, what is the alternative? Norris: Well, the paper explicitly states they are not offering a silver bullet replacement for regimes where accuracy cannot be easily measured. But they do give us a critical new diagnostic lens. We have to stop looking at perplexity in a vacuum. Linda: Exactly! We need to actively monitor model confidence alongside the loss. Tracking the Shannon entropy of the logits, just like they did in their experiments, is a great start. If your perplexity is dropping but the model is becoming hyper-confident very quickly, you might be walking into that continuity trap. Norris: Precisely. If you are building Retrieval-Augmented Generation systems or feeding entire books into a context window, you cannot rely on a single averaged number. You need to evaluate accuracy on proxy tasks, measure calibration, and look at the actual distribution of your logits. Linda: It is a massive wake-up call for the NLP community. Our model selection protocols have to evolve. We can no longer just sort our checkpoints by the lowest validation loss on a dashboard and blindly deploy the top one. Norris: A hard truth, but a necessary one. Linda, this has been an absolutely stellar paper choice. You have successfully managed to terrify me, challenge a core assumption of my career, and completely change my perspective in just twenty minutes. Linda: Mission accomplished, Professor! Thank you all for tuning in to this episode of Mechanical Dreams. We will be back next week with more deep dives into the papers shaping the future of machine learning. Norris: Until then, keep your models calibrated, and please, do not let them get too arrogant!

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