AI engineering glossary · Prompt context engineering

What is lost in the middle?

Lost in the middle: A documented pattern where models use information at the start and end of a long input better than information placed in the middle. It means where you place key facts in a long prompt can change answer accuracy.

Level: advancedTopic: Prompt context engineering

Lost in the middle: an example

In a 20-document prompt, a model answers correctly when the relevant passage is first or last, but misses it in position 10.

Related terms

More Prompt context engineering terms

Where you learn it

Lost in the middle is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.