Instructions placed in the middle of a very long prompt are followed far less often than the same words at…
Instructions placed in the middle of a very long prompt are followed far less often than the same words at the start or end.
- AWrap them in bold and asterisks so they stand out
- BRepeat the whole prompt twice so the middle becomes an edge
- CMove what MUST be obeyed to the edges - system prompt or the last message - and cut the middle down
- DUse a model with a bigger context window, so the middle of the prompt sits further from the limit and gets the same attention as the start and end
Answer: C
Move what MUST be obeyed to the edges - system prompt or the last message - and cut the middle down
Why
Attention is not uniform across a long input, so POSITION is a design decision, not a formatting detail. A bigger window makes the middle longer, which is the opposite of the fix; duplicating the prompt doubles the cost to create a second middle.
- ContextYour agent resends a long system prompt on every step, yet DeepSeek’s usage shows almost no cache hits.
- ContextAfter many tool calls returning huge blobs, the agent slows down and loses the thread.
- ContextA long conversation is nearing the context-window limit and you must free space.
- ContextAs the context grows you must decide what MUST always stay in the window.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path