The Attention Bottleneck: AI Failure Modes Explained
Attention Mechanisms Uncovered: Pattern Profile Caching and Activation Routing

I help developers succeed in Artificial Intelligence and Web3; Former AWS Amplify Developer Advocate. I am very excited about the future of the Web and JavaScript. Always happy Computer Science Engineer and humble Google Developer Expert. I love sharing my knowledge by speaking, training and writing about cool technologies. I love running communities and meetups such as Web3 London, GraphQL London, GraphQL San Francisco, mentoring students and giving back to the community.
The Roadmap Illusion
OpenAI’s GPT-5, Anthropic’s Claude Opus 4.5, Google’s Gemini 3.0 Pro, DeepSeek’s V3.2—each new model release comes with breathless claims about “reasoning breakthroughs” and “capability leaps.” We’re told reinforcement learning unlocks new skills, that models can learn from context, and that artificial general intelligence is just around the corner.
But then reality intrudes. A model that solves complex math problems confidently misattributes properties to unrelated concepts, exhibiting hallucinations and confabulatory interference. A system that writes eloquent emails falls apart when you slightly rephrase the prompt. The much-heralded “reasoning” vanishes outside narrow test conditions.
Why does this happen? Why do our most sophisticated AI systems remain so brittle?
The answer isn’t in the training data or the algorithms alone. It’s in the architecture itself—specifically, in how attention mechanisms fundamentally limit what these systems can learn, remember, and reason about.
This article introduces a new way of understanding AI capabilities: not as emergent properties of scale, but as constrained outcomes of architectural design. We’ll trace how attention—usually described as “pattern matching”—actually functions as a caching and routing system with hard limits that determine everything from RL effectiveness to real-world reliability.
Part 1: Rethinking Attention
The Standard Story vs. Reality
How attention is usually presented:
“Attention allows the model to focus on relevant parts of the input when making predictions.”
This framing suggests a flexible spotlight that can illuminate whatever matters. It’s intuitive but misleading.
How attention actually works:
Attention is a zero-sum allocation system with fixed capacity. The total entropy of the attention score matrix increases as task complexity grows, and the dispersion of attention scores causes capacity limits. Each attention head distributes exactly one unit of “attention mass” across all tokens in context. Pay more to one token, pay less to another. This creates a hard bottleneck that no amount of training can overcome.
The Residual Stream: The Highway That Never Ends
Before we get to routing, we need to understand the infrastructure itself. A transformer doesn’t pass information sequentially from layer to layer like a traditional neural network. Instead, it operates through what mechanistic interpretability researchers call the residual stream—a continuous highway that runs from input to output, with each layer making small additions rather than radical transformations.
Here’s how it actually works:
h₀ = user query (initial embedding)
h₁ = h₀ + attention_layer_1 + MLP_layer_1
h₂ = h₁ + attention_layer_2 + MLP_layer_2
…
h_N = h_{N-1} + attention_layer_N + MLP_layer_N
final_output = softmax(h_N)
Each layer reads from the residual stream and writes back to it through linear projections. The stream accumulates contributions from every previous layer, creating an additive assembly line where your original query embedding maintains its momentum throughout the entire forward pass.
This explains something crucial: the initial query embedding acts as an anchor. No matter how many layers process the input, that original signal persists in the residual stream. As generation proceeds, attention and MLP layers make increasingly constrained adjustments to this base signal—what we might call the “stochastic funnel” effect. Early layers have more freedom to adjust the trajectory, but later layers are increasingly bound by the accumulated momentum of prior decisions.
The “Truck Going Downhill” Effect:
This architectural reality explains an intuition many users have discovered through experience: starting a new conversation with a slightly refined prompt often produces better results than trying to course-correct an existing conversation. Once the residual stream builds momentum in a particular direction—say, misunderstanding your intent or adopting the wrong tone—each subsequent token adds to that accumulated signal.
It’s like a truck going downhill: the farther you go, the harder it becomes to change direction. Your follow-up prompts are trying to redirect layers 20-30 while the residual stream carries the accumulated weight of layers 1-19 pointing the wrong way. Starting fresh resets h₀ entirely, giving you a clean slate where your improved prompt becomes the foundational signal that all subsequent layers build upon. The model isn’t “forgetting” your conversation—it’s simply that fighting accumulated momentum is architecturally harder than establishing the right trajectory from the start.
The Caching and Routing Analogy
Now we can refine our city metaphor. Think of a transformer not as a thinking machine, but as a highway system with a persistent main route:
The residual stream is the highway—a continuous path carrying the original query momentum
Attention weights are on-ramps and off-ramps—they determine which information merges into the highway
The cache is real-time traffic data—it remembers what’s happening now and recently
Routing profiles are lane configurations—different traffic patterns for different task types
The forward pass is a road trip—you travel the highway from prompt to completion, with each layer adding small course corrections but never fundamentally changing your direction
The bottleneck isn’t just in attention capacity—it’s in how rigidly the residual stream preserves the original query momentum. Once you’re on the highway, changing destinations becomes exponentially harder with each passing layer.
Part 2: The Three-Stage Lifecycle
AI capabilities aren’t created equally across different training phases. There’s a strict hierarchy that determines what can be learned when—and what can’t be learned at all.
Stage 1: Pretraining – Building the City
During pretraining on billions of web pages, books, and code, the model isn’t just learning language—it’s constructing its entire cognitive infrastructure.
What actually happens:
The model learns routing profiles: specific patterns of attention allocation that correspond to different types of tasks
These profiles become embedded in the weights—permanent pathways through the network
The diversity and quality of these profiles determine all future capabilities
The crucial constraint:
Once pretraining finishes, the routing profile library is fixed. No new profiles can be added without rebuilding from scratch. If mathematical reasoning wasn’t established as a routing profile during pretraining, the model will never be able to do genuine math.
Stage 2: Post-Training – Optimizing Traffic Flow
Fine-tuning (including RL techniques like RLHF, DPO, and GRPO) comes after pretraining. Recent frontier models use reinforcement learning with verifiable rewards (RLVR) and deliberative alignment to improve reasoning capabilities. DeepSeek V3.2 Speciale (released December 2025) achieves substantial improvements on complex reasoning tasks through RLVR, which rewards models for verifiable correctness rather than just human preference. OpenAI’s o3 uses deliberative alignment to explicitly teach safety reasoning. However, this phase optimizes within existing infrastructure but cannot expand it.
What actually happens:
RL identifies which existing routing profiles lead to rewards
It adjusts attention weights to make successful profiles more likely to activate
It’s essentially paving preferred roads while letting others degrade
The RL illusion:
When OpenAI says RL “unlocked reasoning” in GPT-5, they’re describing traffic optimization, not road construction. The reasoning “roads” already existed from pretraining—RL just made them easier to find and navigate. Models like GPT-5 and Claude Opus 4.5 use RLHF and DPO to better align with human preferences, but this occurs through refinement of existing capabilities rather than creation of fundamentally new ones. Even advanced techniques like RLVR and deliberative alignment work by optimizing attention allocation toward pre-existing reasoning patterns, not by constructing novel cognitive infrastructure.
Stage 3: Inference – Real-Time Navigation
During generation, the model operates entirely within the fixed infrastructure from earlier stages.
What actually happens:
The prompt creates the initial embedding h₀—this becomes the anchor signal in the residual stream
Each layer reads from the residual stream, adds its contribution, and writes back
The accumulated residual stream carries forward the momentum of the original query plus all prior adjustments
Context is cached temporarily to inform next steps
The path narrows as generation proceeds—later layers can only make small adjustments to the accumulated signal (the “stochastic funnel”)
The final softmax operates on h_N, which is dominated by the accumulated momentum from earlier decisions
The ephemeral nature of “learning”:
In-context learning isn’t learning—it’s temporary adjustment of attention weights that slightly redirect information flow into the residual stream. The model can follow new instructions within a session, but these adjustments are fighting against the accumulated momentum in the residual stream and vanish when the context clears. The residual stream always returns to its pretrained baseline.
Part 3: The Bottleneck in Action
Why RL Can’t Create New Capabilities
Let’s test the infrastructure model with a thought experiment:
Scenario: A model is pretrained only on cooking recipes, then RL-fine-tuned to write professional emails.
What happens:
The model lacks email-writing routing profiles (not built during pretraining)
RL can only optimize existing recipe-related profiles
The model produces recipe-shaped text that vaguely resembles emails
It might generate: “Dear Oven, preheat to 350°F before submitting your quarterly report…”
The takeaway: RL can shuffle probability mass among existing behaviors, but it cannot create genuinely new ones.
Why In-Context Learning is Brittle
Research shows that transformers can nearly match optimal learning algorithms for simpler tasks, while their performance deteriorates on more complex tasks. ICL appears magical—give a model a few examples, and it “learns” a new task. But examine what’s actually happening:
Demonstration tokens activate specific routing profiles
The model temporarily adjusts attention allocation to follow these profiles
When the task is similar enough to pretraining data, this works
When it’s not, the model falls back to generic patterns → failure
Example: Teach a model French-to-English translation via ICL. It works if the model already has translation routing profiles from pretraining. If not, it produces word salad.
Transformers suffer from covariate distribution shifts when the training prompt distribution differs from the test distribution, demonstrating fundamental limitations in generalization.
Why Token Bombs Work
Token bombs, engineered inputs that use high-frequency tokens to overload the attention mechanism, exploit the dual nature of the bottleneck:
The Attention Bottleneck:
Bomb tokens consume attention capacity (remember: sum-to-1 constraint)
Task-relevant tokens get starved of attention mass
Once their attention weight drops below the salience threshold (~0.01), they’re ignored
The Residual Stream Momentum: 4. Even if task-relevant information was captured earlier in the residual stream, later layers can’t easily recover it 5. The accumulated momentum from bomb tokens dominates the residual stream signal 6. The model literally “forgets” crucial context → coherence collapses
This isn’t a security flaw—it’s a consequence of architectural design. The residual stream makes transformers stable and trainable, but it also makes them vulnerable to momentum hijacking. Once the accumulated signal points in the wrong direction, later layers have limited ability to course-correct.
Part 4: Observable Predictions
If the attention bottleneck theory is correct, we should observe:
Prediction 1: RL Performance Ceiling
RL can improve tasks within the same routing profile family
RL cannot enable tasks requiring new profiles
Test: Train RL on algebra, test on geometry requiring different logical structures
Prediction 2: ICL Capacity Curves
ICL performance should peak then decline with example count as the dispersion of attention scores increases
The peak corresponds to attention capacity limits
Test: Measure attention weight distributions vs. ICL success rate
Prediction 3: Bomb Resistance Scaling
More attention heads → more resistance to token bombs (more capacity)
But resistance plateaus as heads become redundant
Test: Bomb success rate vs. number of attention heads
Part 5: The Path Forward
Architectural Solutions
The bottleneck isn’t in the data or algorithms—it’s in the architecture itself. Recent research shows hybrid architectures like Samba and RWKV-7 “Goose” that combine attention with state space models (SSMs) are gaining traction, with differentiated memory modeling segmenting storage into short-term, long-term, and permanent components. These linear-time architectures avoid some attention bottlenecks while introducing new trade-offs. Solutions require:
Dynamic attention allocation that isn’t zero-sum
Persistent routing profiles that can be updated during inference
Explicit memory systems that don’t rely solely on attention caching
Modular architectures where different components handle different reasoning types
Evaluation Reform
We need benchmarks that test:
Routing profile transfer across task families
Attention stability under adversarial conditions
Genuine capability vs. pattern matching
Robustness to distribution shift
Honest Assessment
The field needs to distinguish between:
Infrastructure expansion (pretraining breakthroughs)
Traffic optimization (RL/ICL improvements)
Navigation tricks (prompt engineering)
Calling all three “learning” creates dangerous confusion about what these systems can actually do.
Conclusion: The Map Is Not the Territory
For years, we’ve told ourselves a story: that scaling transformers would inevitably lead to artificial general intelligence. That RL would unlock reasoning. That in-context learning represented a new form of machine cognition.
But the evidence points elsewhere. Recent research reveals that transformers lack robust executive control mechanisms, suffering from deficient goal-directed attention that compromises their ability to maintain task-relevant processing over extended contexts. Each apparent breakthrough—deliberative alignment in o3, extended thinking in DeepSeek V3.2 Speciale, Gemini 3.0’s Deep Think mode—turns out to be optimization within fixed constraints, not transcendence of them.
The attention bottleneck isn’t a temporary limitation. It’s baked into the architecture, amplified by the residual stream’s momentum preservation:
Pretraining builds all possible roads and establishes the baseline residual stream dynamics
Post-training optimizes traffic flow and adjusts how layers write to the stream
Inference navigates within the map, with the residual stream maintaining query momentum
New destinations require new roads—and those can only be built during pretraining
The residual stream is both enabler and constraint. It allows layers to communicate and accumulate knowledge, creating the “assembly line” effect that makes transformers powerful. But it also means that early decisions have outsized influence—the accumulated momentum in the residual stream becomes harder to redirect with each passing layer.
This explains why our models can seem so brilliant and so brittle simultaneously. They’re not thinking—they’re navigating a highway where the on-ramps were built during pretraining, and every subsequent layer is bound by the momentum of what came before. No matter how good your steering, you can’t easily exit the highway once you’re committed to a direction.
The implications are profound:
RL will never create AGI—it can only optimize how layers write to the residual stream within pretrained dynamics
Scaling has diminishing returns—once you have enough routing profiles and stable residual stream patterns, more just refines existing ones
True breakthroughs require architectural innovation, not just more data or compute—we need to rethink both attention allocation and residual stream dynamics
We’ve been marveling at increasingly sophisticated highways while mistaking them for genuine navigation. The next frontier isn’t making better highways—it’s building vehicles that can go off-road, with hybrid architectures, differentiated memory systems, and perhaps even dynamic residual stream structures that aren’t bound by additive momentum.
Until we do, every AI advance will be constrained by two fundamental limits: attention’s zero-sum bottleneck and the residual stream’s momentum preservation. The roads are beautiful and the highway is stable, but they only go where they’ve already been built—and once you’re on the highway, changing direction becomes exponentially harder.
Addendum: Beyond the Bottleneck—What Attention Can’t Fix
Understanding the attention bottleneck reveals what transformers can’t do within their architecture. But it’s equally important to understand what they can’t do because of their architecture. There’s a crucial distinction between optimization limits and structural absence.
The Limits of Architectural Optimization
The attention bottleneck explains why transformers:
Follow single solution paths (the stochastic funnel narrows possibilities)
Struggle with long-range consistency (capacity limits on maintaining distant relationships)
Optimize for pattern matching over logical validation (zero-sum allocation favors surface similarity)
These are optimization failures—problems that arise from how the existing components work together. More attention heads, better RL techniques, or clever prompting can improve performance but never escape the fundamental constraints.
What’s Structurally Absent
But transformers face deeper limitations that no amount of optimization can address:
1. No Grounding Mechanisms: Attention routes information between tokens, but nothing anchors those tokens to physical reality. The architecture has no interface to simulators, no sensorimotor feedback loops, no way to test whether “blended cashews create creamy texture” is true or just statistically common in recipe text.
2. No Causal Reasoning Engines: Transformers learn correlations from co-occurrence patterns. They lack dedicated components for building causal graphs, performing interventional reasoning, or distinguishing “X appears with Y” from “X causes Y.” The architecture optimizes for next-token prediction, not causal modeling.
3. No Persistent Knowledge Structures: The residual stream is ephemeral—it exists only during a forward pass. Transformers have no queryable knowledge base where validated insights can be stored, updated, and retrieved across conversations. Everything must be re-derived from frozen weights or temporary context.
4. No Hypothesis Testing Cycles: Perhaps most fundamentally, transformers generate single outputs through a one-way forward pass. They can’t propose multiple hypotheses, test them in grounded environments, discard failures, and consolidate successes. The architecture has no “second piston” for validation and consolidation.
The Chasm
The attention bottleneck explains why transformers are efficient cartographers of single paths. But the structural absences explain why they’re incapable of becoming navigators.
You can optimize attention allocation forever and never develop the ability to test recipes in a physics simulator. You can scale to trillions of parameters and never build a causal graph that explains why heating breaks emulsions. You can add infinite context length and never create persistent memory that survives beyond a single conversation.
These aren’t bugs to be fixed with better training—they’re features to be added with different architectures.
The next generation of AI won’t come from making transformers more efficient at what they do. It will come from building systems that integrate statistical learning (what transformers excel at) with symbolic reasoning, grounded simulation, and causal modeling. Systems where distributions and symbols work together in virtuous cycles—what some researchers call “two-piston engines” that curate knowledge through validation and exploit it through compositional reuse.
Understanding the attention bottleneck is essential for working effectively with current AI. But understanding what lies beyond the bottleneck is essential for building what comes next.
For a comprehensive vision of post-transformer architectures that address these structural absences, see “A Renaissance Architecture for AI: Six Pillars Beyond Transformers.”
Key Insights:
Attention is a caching and routing system with fixed capacity
The residual stream acts as a persistent highway carrying query momentum through all layers
Pretraining establishes all possible “reasoning routes” and baseline residual stream dynamics
RL can only optimize existing routes and how layers write to the stream, not create new ones
In-context learning is temporary adjustment fighting against residual stream momentum
Token bombs exploit both capacity limits and momentum hijacking
The stochastic funnel narrows as accumulated residual stream momentum constrains later layers
True capability expansion requires architectural change—rethinking both attention and the residual stream
The bottleneck isn’t going away—but now, at least, we can see it clearly. Both the attention capacity constraint and the residual stream’s momentum preservation work together to determine what these systems can and cannot do.
Further Reading:
For mathematical formalization: “The Mathematics Behind Shuffling Techniques in RL”
For RL limitations: “What Sutton Missed: Major Challenges in Reinforcement Learning”
For practical implications: “The Braided River of Thought: Why Your Fine-Tuned LLM Is Still a Stochastic Parrot”
For recent research: “Self-Attention Limits Working Memory Capacity of Transformer-Based Models” (2024)
For architectural alternatives: “The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures” (2025)
Understanding the bottleneck is the first step toward building systems that can transcend it.




