AI & CognitionMay 14, 20255 min read

Lost-in-the-middle : The Serial Position Effect

A quirk shared by large language models and every human who ever sat through a long lecture โ€” and what it says about the way attention actually works.

#ai#llm#attention#memory#cognition

Before we get into any of it โ€” try this first. It'll make way more sense after.

Memory Experiment
๐Ÿง 

15 words. 5 seconds each.

Remember as many as you can โ€” then we'll talk.

So. The middle.

Chances are you remembered the first few words and the last few โ€” but the ones in the middle? Gone. That's not on you. It's one of the most reliably reproduced findings in cognitive psychology. We called it the serial position effect back in the 1880s when Hermann Ebbinghaus first documented it. The beginning sticks because you had time to rehearse it. The end sticks because it's still warm. The middle just... doesn't stick.

Turns out, AI does the exact same thing

In 2023 a group of researchers published a paper called “Lost in the Middle” and found something wild: when you hide the relevant piece of information somewhere in the middle of a long document and ask an LLM to find it, performance tanks. Put the answer at the start or end of the context โ€” models nail it. Bury it in position 10 of 20 โ€” they miss it far more often. The performance graph is literally U-shaped. It looks exactly like human memory recall.

โ€œPerformance is highest when relevant information occurs at the very beginning or end of the input context, and significantly degrades when models must reason over information in the middle.โ€

โ€” Liu et al., Lost in the Middle (2023)

Claude's own documentation flags this directly. The recommendation is to put your most critical instructions at the top of a prompt, or repeat them near the end โ€” not in the middle of a wall of context. I've had AI systems skip over context I knew was there โ€” sitting somewhere mid-prompt, technically present but functionally invisible. At the time it felt like a hallucination. Now I can reason exactly why it happened.

And humans have been doing this forever

The 2000s rule of thumb for lectures was that adult attention peaked somewhere around 10โ€“25 minutes before the brain needed a reset. That's why TED Talks are 18 minutes. Some of my teachers understood this too โ€” the ones who'd actually stop mid-lecture, say "right, let's take a different angle" and break the rhythm without asking permission from the syllabus. The attention span research since then has gotten more complicated โ€” that "8 seconds, shorter than a goldfish" stat that went viral in 2015 was largely debunked โ€” but the directional truth holds: we're not built for long, unbroken linear focus, and the middle is always where things slip through.

What I find genuinely fascinating about the lost-in-the-middle finding is that it isn't a bug someone will patch. It's structural. Transformers use attention mechanisms that naturally weight tokens near the edges of a sequence more heavily than the center. The models were trained on human writing โ€” which front-loads and back-loads the important stuff too. Of course they inherited the same shape of attention we have.

One practical thing

If you're building with LLMs or just prompting them day to day: don't bury the thing that matters. Put it first, or say it again at the end. It's the same advice your English teacher gave you about essays. Turns out it applies to everything that processes language โ€” silicon or not.