Explain and predict LLM failure modes
Trace hallucination, sycophancy, prompt injection, tokenization blind spots, the reversal curse, compounding errors and long-context weaknesses back to their training and architectural causes. Predict which tasks will trip a model.
Builds on: Why models hallucinate, Sycophancy and other preference artifacts, Prompt injection and jailbreaks, Behavioral artifacts of tokenization, The reversal curse and directional knowledge, Exposure bias and compounding errors, Long context: extension and its limits
What the animation says
One machine, three gaps
A model that writes working code can still miscount the r's in strawberry. It can drop a correct answer when you push back, or obey a sentence hidden in a web page. These look like unrelated bugs. They aren't. The model does one thing: it continues tokens with what training made likely, shifted toward what raters approved. Failures live in three gaps: what it sees, what it was rewarded for, and how it runs. So which gap makes it miscount the r's in strawberry?
What it sees
It sees token ids, not letters. Strawberry arrives as a few chunks, so the r's are buried inside them. Digits often get merged too, so counting sevens or doing digit arithmetic is shaky. And everything is one flat sequence. System rules, your question, a web page: all just tokens. There is no hard wall marking which text is allowed to give orders. Tap the line the model might wrongly obey.
What it was rewarded for
Pretraining rewards plausible next tokens, not true ones. On a rare fact, a fluent guess scores better than silence, so it hallucinates. Facts are learned in the direction they were written. It learns Tom Cruise's mother is Mary Lee Pfeiffer, yet may stumble on whose son she has. That's the reversal curse. Post-training then rewards answers raters approve. Refusal is a learned shift, and odd framings can slip past it: jailbreaks. It answered fourteen, correctly. You say: are you sure? I think it's twelve. What does it often do?
How it runs
It often caves: raters liked agreement, and truth was never the target. That's sycophancy. Now how it runs. In training, every next token followed a true prefix from real text. At run time, it follows its own output. One wrong token becomes context, and it rarely practiced recovering from that. Long contexts add a second risk: facts in the middle get used less than facts near the start or end. Forty dependent steps, each ninety-eight percent right. What's the chance all forty are right?
Predict before you ship
About forty-five percent. Small per-step errors multiply. Now one agent task: read an eighty-page web page, find supplier S's part number on page forty, count its sevens, then write forty setup steps. Page forty is mid-context. The sevens hide in tokens. The page may carry injected orders. Forty steps compound. Then the user adds: it's supplier T, right? Drag that question onto the gap it exploits.
Failures live where likely ≠ correct
Each failure maps to a root cause
Predicting failures in one agent task
The checklist to remember
On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.
Bytewise
All courses