We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Lost in the Middle

Having a large context window doesn't mean a model uses every part of it equally well. A famous study called "Lost in the Middle" found that models tend to retrieve information better from the beginning and end of long contexts, rather than from the middle.

Funny enough, AI is kinda like a human in this regard. It's like it was trained on human data or something... Send your coworker a 3-page email, and they'll probably read the first 3 sentences and the last 3 sentences most thoroughly, skimming everything between.

What This Means for Prompt Design

The effect varies by model and task, and retrieving facts isn't the same as following instructions. Still, it's a useful reminder: don't bury the important stuff.

This does not mean that you can't have big prompts. You totally can! For longer prompts (and especially reusable prompt templates), just make sure the goal and the key constraints are as easy to find as possible. State them up front, and consider a short reminder at the end when there's a lot of supporting material in the middle.

Assignment

Tell OpenCode to shorten Sloperator's README.md to fewer than 50 lines. Have it move the uv run command and other validation commands into the first 20 lines, and have it simply reference docs/spec.md instead of duplicating the entire language specification.

Then tell OpenCode to run and submit the CLI tests from the project root.