Topic 3 of 5 · 4 min read
How order and emphasis steer answers
Goal: Predict how moving, repeating or reframing one piece of context changes the answer, and reorder a request so the key material gets used.
The model does not weigh every part of the window equally: where something sits, how often it appears and how it is framed all change how much it counts. The same facts in a different order can give a different answer.
Check yourself · 1 of 3
You paste three long documents and have one question. Which layout usually works best?
Why it matters
Many people assume that if a fact is somewhere in the window, it will be used. That is not guaranteed. In long inputs, models often use material near the start and the end better than material buried in the middle. A research paper called "Lost in the Middle" (2023) tested this by moving a key passage around in a long input and measuring answer quality. Newer models do better, but the habit is still worth guarding against.
Three levers you control
- Position. Put the material first and the question last. Google's long-context guide and Anthropic's prompting guide both suggest placing the question after long documents. Put the rules that must not be missed near the end too, close to where the model starts writing.
- Repetition. If one rule is critical, state it once clearly at the top and once briefly at the end. Do not repeat everything. Repeating ten things teaches the model that nothing is special.
- Framing. Label what each piece is. "Contract (source of truth)" and "Email from the customer (may be wrong)" tell the model how to treat each piece. Unlabeled blocks of text blur together.
Helpful structure is cheap: use clear headings or tags such as <document> and <question>, one block per source, and keep the instructions apart from the data.
Before and after
Before: You paste a 40-page report, then a note saying "Be careful with the Q3 figures, they were restated", then 20 more pages of appendix, and ask at the very top: "Summarise revenue." The summary uses the old Q3 numbers.
The warning is buried in the middle and the question comes before the material.
After: Report and appendix first, each labelled. Then: "Rule: Q3 figures were restated; use the restated table in section 6, not the original. Task: summarise revenue by quarter." The summary uses the restated figures.
What goes wrong
- Buried instructions. A key rule in the middle of a long paste gets missed or underweighted.
- Shouting. Capital letters and "VERY IMPORTANT" on every line cancel each other out. Modern models are also quite responsive, so loud emphasis can cause over-correction.
- Recent beats old. Late in a long chat, a newer message can override an older rule without you noticing. Restate rules you still need.
- Leading framing. Phrasing like "Explain why this plan is great" pushes the answer toward agreement. Frame neutral questions neutrally.
Examples
Reordering a long request
Before: Question first, then six pasted documents, with the one important caveat in the fourth document.
After: The six documents, each labelled with a title and date. Then a short block: "Caveat: the March memo replaces the February policy. Question: what is the current approval limit?"
Nothing was added. The caveat moved to the end and was named, so it is much harder to miss.
A framing change that flips the answer
Leading: "Why is switching to a four-day week a good idea for our team?" The model gives reasons in favour.
Neutral: "List the strongest arguments for and against a four-day week for our team, then say what evidence we would need to decide." Same topic, balanced answer.
Key points
- Position, repetition and framing change how much a piece of context counts in the answer.
- Models often use the start and end of a long input better than the middle, so avoid burying key rules.
- Put long source material first and the question and critical rules last.
- Repeat only the one or two rules that must not be missed; repeating everything dilutes all of it.
- Label each block by what it is and how far to trust it, and keep instructions separate from data.
Common mistakes
- Putting the question before a long paste and the key caveat in the middle.
- Marking everything as critical so that nothing stands out.
- Mixing instructions and data in one unlabelled block of text.
- Assuming a rule from the start of a long session still wins over later messages.
Check yourself · 2 of 3
A rule must not be missed in a long prompt. What is the best way to protect it?
Check yourself · 3 of 3
Which question is framed to avoid pushing the model toward agreement?
Practice items, not counted towards your mastery.
Start here
- Effective context engineering for AI agents (Anthropic) (opens in a new tab)ArticleFree
Defines context as the full set of tokens given to the model and shows how to curate it across turns, tools and memory.
- Context engineering (Simon Willison) (opens in a new tab)ArticleFree
Short post on why 'context engineering' describes the work better than 'prompt engineering' does.
- Context windows (Claude docs) (opens in a new tab)DocsFree
Explains what the window holds, how each turn adds to it, and what happens as it fills.
More for this topic
- Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)PaperFree
The research behind the finding that models use material at the start and end of a long input better than the middle.
- Long context (Gemini API docs) (opens in a new tab)DocsFree
Google's guide to putting large inputs in the window, with advice on placing the question after the material.