Context EngineeringLesson 34 of 87

Module 4 · Position, order and what the model actually reads

Top, bottom, or both

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 4 of 9 in this chapter

This chapter’s goalPredict and measure how position changes whether material in the window gets used: run a position probe on your own model and corpus, place instructions, examples and evidence deliberately, mark boundaries the model cannot confuse, and choose an evidence order that matches the task rather than the retriever’s ranking.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
Where the output contract sits, in a 60,000-token requestTop only71%Bottom only84%Top and bottom91%Three arms, everything else held fixed, scoring adherence rather than answer quality. At 2,000 tokensthe same three arms sat within a point of each other, which is why placement is a long-context problemand caching should decide it below about eight thousand. The winning arm is a forty-token remindernext to the question, not a second copy of the system prompt.
Three arms, everything else held fixed, scoring adherence rather than answer quality. At 2,000 tokens the same three arms sat within a point of each other, which is why placement is a long-context problem and caching should decide it below about eight thousand. The winning arm is a forty-token reminder next to the question, not a second copy of the system prompt.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

The conflict

Two good rules point in opposite directions.

Caching wants instructions first. Prefix caching matches from the first token forward, so everything stable belongs at the top. Instructions are the most stable thing you have.

Attention favours the end. In a long window, an instruction 40,000 tokens above the question is competing with everything in between, and the model’s strongest attention is near where generation begins.

With a 2,000-token request the conflict does not exist; put the instructions at the top and stop thinking about it. With a 60,000-token request it is real, and teams discover it as “the model stopped following the format when we added the documents”, which is exactly what happened, and the format instruction did not move, the distance did.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Data, SQL and Getting to the Answer exam.

Stuck on something?Ask Sayali, your AI tutor

How to cite: Addaly (2026) ‘Top, bottom, or both’, in Context Engineering. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/context-engineering/where-the-instruction-goes (Accessed: 29 November 2026).