Ordering facts in a prompt so the model reads the ones that matter
Put the figures you want quoted at the top and the bottom of the context and keep the middle for background. Accuracy on retrieving a fact peaks at the beginning and end of a long input and drops in between, so position is a design choice rather than an accident of how your code assembled the prompt.
A pacing figure sat at position 40 in a context bundle of 61 aggregates, somewhere between the hall breakdown and the historic exhibitor list. It was the one number the show director had asked about. The generated summary mentioned every category of thing in the bundle and skipped that one, and it skipped it silently, because a missing fact produces no error.
Ordering facts in a prompt is treated as an implementation detail, decided by whatever order your assembly code happened to append things in. It is a design choice with a measurable effect, and the effect is large enough to change which of your numbers reach the page.
What is the position effect?
Liu and colleagues published "Lost in the Middle: How Language Models Use Long Contexts" as a preprint in 2023 and in Transactions of the Association for Computational Linguistics, volume 12, in 2024. The headline finding is stated plainly in the abstract: "performance is often highest when relevant information occurs at the beginning or end of the input context, and significantly degrades when models must access relevant information in the middle of long contexts".
The shape is a U. Accuracy is high at the front, drops through the body, and recovers toward the back. That is worth holding as a picture rather than as a rule, because it tells you there are two good positions and one bad one, and most prompt assembly code produces exactly one ordering with no thought about either.
Vendor guidance points the same way from the practitioner side. Anthropic's prompt engineering documentation, in its current 2026 form, addresses inputs of 20,000 tokens and above and recommends: "Put longform data at the top: Place your long documents and inputs near the top of your prompt, above your query, instructions, and examples. This improves performance across all models." The same page adds that "Queries at the end can improve response quality by up to 30 percent in tests, especially with complex, multidocument inputs".
Read together, those two sources give a layout. Long material first. Question last. The figures you most want quoted at one of the two edges.
A layout for an event summary prompt
Here is the ordering I would defend for an exhibitor or show summary built from aggregates.
- Headline aggregates first. The four to eight numbers the summary exists to communicate, each with a name, a value, a period and a source table. Registrations, verified attendance, exhibitor count, the prior edition equivalents.
- Supporting aggregates next. Breakdowns by hall, by day, by registration type. Material the model may need and that nobody will be upset to see omitted.
- Background and reference material in the middle. Definitions, the house style example, historic context, anything long. This is the section the position effect penalises, so put things here that can afford to be skimmed.
- Instructions and constraints near the end. How to phrase, what to avoid, the requirement to quote operands alongside any derived percentage.
- The question, and a short restatement of the figures that must appear, last. Not the values again, just the names: "your summary must reference registrations_total, registrations_total_prior and verified_attendance."
That last element is doing specific work. It puts the names of the load-bearing figures at the strongest position in the context, immediately before generation, without duplicating the values themselves. Duplicating values is a real hazard, because if the two copies ever disagree through a bug in prompt assembly you have handed the model two versions of the truth and no way to choose.
A worked example: moving one figure from position 40 to position 2
Take the case from the opening and treat it as an experiment rather than an anecdote, because that is what makes it useful.
Build a bundle of 61 aggregates for one show. Write 30 test questions whose answers depend on specific aggregates in that bundle, spread across positions. Run each question and score whether the answer quotes the correct figure.
Suppose the first run scores 27 of 30, with the three failures at positions 34, 40 and 47. That is a clean U-shaped result: everything in the first ten positions and the last ten answered correctly, and the misses cluster in the middle third.
Now change one thing. Move the pacing aggregate from position 40 to position 2 and rerun only the question that depends on it. It answers correctly.
That single result proves nothing on its own, and this is the part teams skip. One question, one rerun, and generation is not deterministic enough for a single trial to settle anything. Run that question ten times before and ten times after. If it was answered correctly two times in ten at position 40 and ten times in ten at position 2, you have something. If it was seven in ten before and nine in ten after, you have noise and a very small effect.
The reason to do the ten runs is that position effects are probabilistic. A fact in the middle stays visible and gets read less reliably, and a single sample cannot distinguish "fixed" from "got lucky". Building the fixed question set and the repeat protocol is the same discipline as grading candidate models properly in Q27, and the question set you build here is reusable by that work.
Which facts earn a place at an edge?
Space at the edges is limited, so the ordering forces a priority decision that is worth making explicitly.
Put a figure at an edge if a reader would notice its absence. The headline registration number, the comparison against the prior edition, the verified attendance figure. If the summary would be considered incomplete without it, it goes at the front or gets named at the back.
Put a figure at an edge if it is the one the request was about. A summary generated in response to a specific question should carry that question's aggregates at position one, even when they are unusual, and the assembly code should support reordering by request rather than emitting a fixed sequence.
Leave a figure in the middle if it is context the model may use and no reader is waiting for. Hall-level breakdowns for a show where nobody asked about halls. Five years of history when the summary covers one edition.
There is a fourth category that people put at an edge for the wrong reason, which is the figure somebody senior is interested in. Interest is a poor guide here, because the position budget should be spent on what the output must contain rather than on what a stakeholder likes to see. If the chief executive wants the international share in every summary, the right mechanism is a hard requirement in the instructions and a name in the closing list, so the figure is demanded rather than merely well placed. Position raises the odds. It does not guarantee anything, and treating it as a guarantee is how a required number goes missing from a board pack that nobody checked.
The related discipline is deciding what to do when a required figure is genuinely absent from the bundle. Absent and unread produce the same silence in the output, so name the required figures explicitly and have the assembly code refuse to build the prompt when one of them is missing. That converts a silent omission into a build error, which is the one place in this whole pipeline where you get told about the problem instead of discovering it in a meeting.
Cut a figure entirely if it is in the bundle because it was easy to include. This is the most common finding when anyone audits a prompt. Bundles grow, nothing gets removed, and a 61 aggregate bundle where 20 are used is 41 aggregates of middle for the other 20 to hide in. Deleting unused aggregates improves position effects, cuts tokens, and speeds up time to first token, which is the latency budget Q25 works through.
Ordering interacts with everything else in the context
Two practical interactions are worth knowing about before you start rearranging.
Rows inside a table have positions too, so a long table dropped into the middle of a prompt suffers the effect twice over. If a table has to be there, sort it so the rows the question concerns sit at its top, and keep the table itself out of the middle third of the whole context. How the table is serialised in the first place is a related decision covered by Q29.
Retrieved passages arrive in relevance order from most retrievers, which puts the best passage first and the second best immediately after it, in the strongest and second strongest positions. That is fine. What is less fine is the common pattern of reranking to relevance and then appending the instructions and question before the passages, which puts your retrieved material at the end and your instructions in the middle. Check the assembled string rather than the assembly code, because the order in the code is often not the order in the output.
Where this stops
The position effect is real and it is a tendency rather than a rule. Models differ, and each generation of them handles long context better than the last, so a layout tuned on one model may buy you nothing on the next and the honest thing is to re-measure rather than to carry the belief forward.
There is a more uncomfortable limit. Ordering is a mitigation for a prompt that is too long, and the better fix is usually a shorter prompt. If you find yourself carefully arranging 61 aggregates around a U-shaped attention curve, the question to ask is why 61 aggregates are in there. A prompt of 12 well chosen aggregates has no middle to speak of and needs no layout strategy at all.
Ordering also cannot rescue a fact the model was never given. Silent omission and silent absence look identical in the output, which means neither is detectable without a test set that knows what the right answer was.
Start this week by printing one assembled prompt to a file exactly as it goes to the model, then numbering its facts. Count how many of them appear in the output you got back. If the used share is under half, you have a deletion job before you have an ordering job, and the deletion will improve accuracy, cost and speed at once. The pillar covers the wider set of choices in running AI over event data.
Questions people ask about ordering facts in a prompt
- Where should the most important figures sit in a prompt?
- At the beginning and the end. Liu and colleagues found in Transactions of the Association for Computational Linguistics that performance is highest when relevant information sits at the start or end of the input and degrades significantly in the middle. Put the headline aggregates first, the background in the middle, and repeat the figures you want quoted at the close.
- Where does the question itself belong?
- After the data, for long inputs. Anthropic's prompt engineering documentation recommends placing long documents near the top of the prompt above the query and instructions, and notes that queries at the end can improve response quality by up to 30 per cent in tests, especially with complex multidocument inputs.
- Does ordering matter for short prompts?
- Much less. Position effects grow with input length, so a prompt of a few hundred tokens is largely unaffected. The guidance starts mattering somewhere in the low thousands of tokens and matters a great deal past twenty thousand, which is the range an event summary with retrieved context routinely lands in.
Related reading
- Cutting the latency of AI generated answers during show week
- Choosing a model for summarisation of event aggregates without guessing
- Prompting with tabular data from an event warehouse without losing rows