{"course":{"slug":"prompting","title":"Getting Real Work out of a Model","url":"https://addaly.com/learn/prompting","level":"beginner","track":"start"},"lesson":{"slug":"where-the-instruction-goes","title":"Where the instruction goes, and why it matters","url":"https://addaly.com/learn/prompting/where-the-instruction-goes","position":13,"of":72,"minutes":8,"answer":"In a long prompt, state the task before the material and repeat it after, put the most important document last.","keyIdea":"In a long prompt, state the task before the material and repeat it after, put the most important document last, and prefer the right extract to the whole file even when the whole file would fit."},"body":{"format":"markdown","text":"## Position is not neutral\n\nWith a two-line prompt, order is irrelevant. With four thousand words of pasted report it stops being irrelevant, and the effect is large enough to notice without measuring anything.\n\nThree findings, in plain terms.\n\n**Instructions after long material are followed more reliably than instructions before it.** If the task sits at the top and then six thousand words follow, the model works out what to do, then reads an enormous amount of other text before producing anything. Putting the task at the end, immediately before it answers, keeps the request close to the answer.\n\n**Instructions before the material help the model read purposefully.** Knowing you want parental-leave rules changes how the rest is processed.\n\nThose two pull in opposite directions, so the practical answer is to do both. Task at the top in one sentence, material in the middle, the specific instruction repeated at the bottom. It costs twenty words.\n\n```\nExtract every payment deadline from the contract below.\n\n<contract>\n... 4,000 words ...\n</contract>\n\n> Figure: Accuracy by where the relevant passage sits. Line chart of % of questions answered correctly against Position of the relevant passage, % of the way through the context: 2023 study, long context (0, 75) (25, 63) (50, 55) (75, 60) (100, 72); Newer long-context model (0, 91) (25, 86) (50, 81) (75, 85) (100, 90). The 2023 study that named 'lost in the middle', and the shape newer long-context models show on the same kind of test. Better is not solved: the dip is shallower and it is still there.\n\nList every payment deadline in the contract above: date, amount,\nand the clause number it comes from. If a date is described rather\nthan stated (\"30 days after signature\"), quote the description.\n```\n\n**Material in the middle of a long context gets used less well than material at either end.** This is the effect usually called *lost in the middle*, first shown clearly in a 2023 study where the position of a relevant passage inside a long context changed accuracy substantially, with the worst results when it sat in the middle. Newer long-context models handle this better than the models in that study. Better is not solved: independent long-context benchmarks continue to show accuracy falling as the material grows, even for models advertising a million-token window.\n\n## What follows for real work\n\n**Put the most important document last.** If you paste three documents and one of them is the one the question is about, it goes at the end.\n\n**Say where to look.** \"The payment terms are in section 9; the termination clause is near the end.\" One sentence of navigation is worth more than a firmer instruction, and it costs nothing to be wrong about: a model told to check section 9 will still read the rest.\n\n**Prefer the chapter to the book.** A 12-page extract that certainly contains the answer beats a 300-page manual that certainly contains the answer somewhere. This is not about the limit: it is about accuracy inside the limit.\n\n**Do not trust a big window as a filing system.** A million-token context is a genuine engineering achievement and a poor substitute for choosing what to include. If you have ever pasted an entire codebase and got a confidently wrong answer about one function, you have met this directly.\n\n**Watch for the quiet quality drop.** The failure here is not an error message. It is a slightly worse answer that looks exactly like a good one: a summary that misses the third of four conditions, a comparison that silently drops one candidate. Nothing announces that the middle of your document was skimmed. This is why the fix has to be structural rather than reactive: you cannot wait to notice, because the symptom is an absence.\n\n## The counter-case\n\nThere are jobs where you must give it everything: finding a contradiction between two sections you have not located, checking whether *any* clause covers termination, summarising a whole report. Selecting in advance would beg the question.\n\nFor those, two things help. Ask for an intermediate pass (\"first list every section that mentions termination, with clause numbers; then answer\") which turns one hard retrieval into a cheap enumeration followed by a small task. And ask for quotes, so a claim about the middle of the document is checkable.\n\n## The habit\n\nOnce your prompt exceeds a page, treat it as a document with a structure rather than a message. Top: what I want. Middle: labelled material, most important last. Bottom: the precise instruction again, plus the output shape and the escape hatch.\n\nThat layout takes no longer to write and it fails much less often, especially on the day you paste something three times bigger than usual and cannot work out why the quality dropped."},"check":{"question":"A researcher pastes six papers, asks a question at the top, and gets an answer that draws almost entirely on the first and last papers. What is the most accurate diagnosis?","options":[{"text":"The model summarised what it read first and last because those are the parts a summariser is trained to weight.","correct":false,"tempting":"Invents a training objective; the effect is about retrieval within a long context, not a summarisation habit."},{"text":"The middle papers were probably truncated to fit the context window.","correct":false,"tempting":"Truncation removes text from the end of the block, and would not produce even coverage of the first and last items."},{"text":"The question was too broad, so the model sampled a few sources rather than reading all six.","correct":false,"tempting":"The model does not choose to sample sources; every token was present and processed."},{"text":"Material in the middle of a long context is used less reliably, so the papers that mattered needed to be positioned or pointed at explicitly.","correct":true}]},"prev":{"slug":"marking-where-your-material-starts","title":"Marking where your material starts and stops","url":"https://addaly.com/learn/prompting/marking-where-your-material-starts"},"next":{"slug":"the-standing-brief","title":"The background you should stop retyping","url":"https://addaly.com/learn/prompting/the-standing-brief"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Where the instruction goes, and why it matters', in Getting Real Work out of a Model. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/prompting/where-the-instruction-goes (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Where the instruction goes, and why it matters","courseTitle":"Getting Real Work out of a Model","module":{"index":2,"slug":"the-material-you-give-it","title":"The material you give it"},"answer":null,"keyIdea":"In a long prompt, state the task before the material and repeat it after, put the most important document last, and prefer the right extract to the whole file even when the whole file would fit.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"type":"line","title":"Accuracy by where the relevant passage sits","series":[{"label":"2023 study, long context","points":[[0,75],[25,63],[50,55],[75,60],[100,72]]},{"label":"Newer long-context model","points":[[0,91],[25,86],[50,81],[75,85],[100,90]]}],"xLabel":"Position of the relevant passage, % of the way through the context","yLabel":"% of questions answered correctly","caption":"The 2023 study that named ‘lost in the middle’, and the shape newer long-context models show on the same kind of test. Better is not solved: the dip is shallower and it is still there."},"alt":"Figure: Accuracy by where the relevant passage sits. Line chart of % of questions answered correctly against Position of the relevant passage, % of the way through the context: 2023 study, long context (0, 75) (25, 63) (50, 55) (75, 60) (100, 72); Newer long-context model (0, 91) (25, 86) (50, 81) (75, 85) (100, 90). The 2023 study that named ‘lost in the middle’, and the shape newer long-context models show on the same kind of test. Better is not solved: the dip is shallower and it is still there."}},"blocks":[{"t":"h2","id":"position-is-not-neutral","runs":[{"text":"Position is not neutral"}]},{"t":"p","runs":[{"text":"With a two-line prompt, order is irrelevant. With four thousand words of pasted report it stops being irrelevant, and the effect is large enough to notice without measuring anything."}]},{"t":"p","runs":[{"text":"Three findings, in plain terms."}]},{"t":"p","runs":[{"text":"Instructions after long material are followed more reliably than instructions before it.","b":true},{"text":" If the task sits at the top and then six thousand words follow, the model works out what to do, then reads an enormous amount of other text before producing anything. Putting the task at the end, immediately before it answers, keeps the request close to the answer."}]},{"t":"p","runs":[{"text":"Instructions before the material help the model read purposefully.","b":true},{"text":" Knowing you want parental-leave rules changes how the rest is processed."}]},{"t":"p","runs":[{"text":"Those two pull in opposite directions, so the practical answer is to do both. Task at the top in one sentence, material in the middle, the specific instruction repeated at the bottom. It costs twenty words."}]},{"t":"code","lang":"","label":"Text","text":"Extract every payment deadline from the contract below.\n\n<contract>\n... 4,000 words ...\n</contract>\n\nList every payment deadline in the contract above: date, amount,\nand the clause number it comes from. If a date is described rather\nthan stated (\"30 days after signature\"), quote the description."},{"t":"p","runs":[{"text":"Material in the middle of a long context gets used less well than material at either end.","b":true},{"text":" This is the effect usually called "},{"text":"lost in the middle","i":true},{"text":", first shown clearly in a 2023 study where the position of a relevant passage inside a long context changed accuracy substantially, with the worst results when it sat in the middle. Newer long-context models handle this better than the models in that study. Better is not solved: independent long-context benchmarks continue to show accuracy falling as the material grows, even for models advertising a million-token window."}]},{"t":"h2","id":"what-follows-for-real-work","runs":[{"text":"What follows for real work"}]},{"t":"p","runs":[{"text":"Put the most important document last.","b":true},{"text":" If you paste three documents and one of them is the one the question is about, it goes at the end."}]},{"t":"p","runs":[{"text":"Say where to look.","b":true},{"text":" “The payment terms are in section 9; the termination clause is near the end.” One sentence of navigation is worth more than a firmer instruction, and it costs nothing to be wrong about: a model told to check section 9 will still read the rest."}]},{"t":"p","runs":[{"text":"Prefer the chapter to the book.","b":true},{"text":" A 12-page extract that certainly contains the answer beats a 300-page manual that certainly contains the answer somewhere. This is not about the limit: it is about accuracy inside the limit."}]},{"t":"p","runs":[{"text":"Do not trust a big window as a filing system.","b":true},{"text":" A million-token context is a genuine engineering achievement and a poor substitute for choosing what to include. If you have ever pasted an entire codebase and got a confidently wrong answer about one function, you have met this directly."}]},{"t":"p","runs":[{"text":"Watch for the quiet quality drop.","b":true},{"text":" The failure here is not an error message. It is a slightly worse answer that looks exactly like a good one: a summary that misses the third of four conditions, a comparison that silently drops one candidate. Nothing announces that the middle of your document was skimmed. This is why the fix has to be structural rather than reactive: you cannot wait to notice, because the symptom is an absence."}]},{"t":"h2","id":"the-counter-case","runs":[{"text":"The counter-case"}]},{"t":"p","runs":[{"text":"There are jobs where you must give it everything: finding a contradiction between two sections you have not located, checking whether "},{"text":"any","i":true},{"text":" clause covers termination, summarising a whole report. Selecting in advance would beg the question."}]},{"t":"p","runs":[{"text":"For those, two things help. Ask for an intermediate pass (“first list every section that mentions termination, with clause numbers; then answer”) which turns one hard retrieval into a cheap enumeration followed by a small task. And ask for quotes, so a claim about the middle of the document is checkable."}]},{"t":"h2","id":"the-habit","runs":[{"text":"The habit"}]},{"t":"p","runs":[{"text":"Once your prompt exceeds a page, treat it as a document with a structure rather than a message. Top: what I want. Middle: labelled material, most important last. Bottom: the precise instruction again, plus the output shape and the escape hatch."}]},{"t":"p","runs":[{"text":"That layout takes no longer to write and it fails much less often, especially on the day you paste something three times bigger than usual and cannot work out why the quality dropped."}]}],"check":{"question":[{"text":"A researcher pastes six papers, asks a question at the top, and gets an answer that draws almost entirely on the first and last papers. What is the most accurate diagnosis?"}],"options":[{"text":[{"text":"The model summarised what it read first and last because those are the parts a summariser is trained to weight."}],"correct":false,"tempting":[{"text":"Invents a training objective; the effect is about retrieval within a long context, not a summarisation habit."}]},{"text":[{"text":"The middle papers were probably truncated to fit the context window."}],"correct":false,"tempting":[{"text":"Truncation removes text from the end of the block, and would not produce even coverage of the first and last items."}]},{"text":[{"text":"The question was too broad, so the model sampled a few sources rather than reading all six."}],"correct":false,"tempting":[{"text":"The model does not choose to sample sources; every token was present and processed."}]},{"text":[{"text":"Material in the middle of a long context is used less reliably, so the papers that mattered needed to be positioned or pointed at explicitly."}],"correct":true,"tempting":null}],"order":[1,0,3,2],"why":null},"prev":{"slug":"marking-where-your-material-starts","title":"Marking where your material starts and stops","minutes":7},"next":{"slug":"the-standing-brief","title":"The background you should stop retyping","minutes":8}}}