INQUIRING LINE

Showing an AI the same examples in a different order can flip nearly half its answers — sequence matters as much as content.

Why is in-context learning brittle to the order of examples presented?

This explores why the *sequence* in which few-shot examples appear — not their content — can swing a model's answers, and what the corpus reveals about where that fragility comes from.


This explores why the order of examples, independent of what those examples actually say, can make or break in-context learning. The sharpest evidence in the corpus is almost startling: simply moving an identical block of demonstrations from the start of a prompt to the end can swing accuracy by up to 20% and flip nearly half of all predictions, with the effect holding across different task types How much does demo position alone affect in-context learning accuracy?. So brittleness isn't only about picking bad examples — position itself is a lever the model is silently pulling.

Why would position matter at all? One clue comes from how models actually generate reasoning token by token. When a model predicts each next token, it leans heavily on the tokens immediately preceding it — this 'local memorization' accounts for up to two-thirds of reasoning errors, and it worsens as inputs get longer or drift from the training distribution Where do memorization errors arise in chain-of-thought reasoning?. If the model is disproportionately anchored to whatever sits closest in the sequence, then reordering examples changes what's 'nearby' at each decision point, and the output shifts accordingly. Order isn't cosmetic; it changes the local context the model is copying from.

There's a deeper structural reason too. For sequential tasks, in-context learning only works when the context contains whole trajectories from the same setting — 'burstiness' — rather than scattered isolated examples Why do trajectories matter more than individual examples for in-context learning?. This reframes the fragility: the model isn't averaging over a bag of demonstrations, it's reading the prompt as a structured sequence and inferring the task from its shape. Break the coherent ordering and you break the signal the model was using to figure out what you want. The same lesson appears in conversation, where models lock onto premature assumptions from early turns and can't recover — order determines which guess gets cemented first Why do language models fail in gradually revealed conversations?.

If order is a liability, it's also a tool — and this is the turn most readers won't expect. Researchers have started ordering demonstrations *deliberately* to exploit the effect rather than suffer it. One approach ranks examples by how sparse their internal activations are, feeding harder (sparse) examples before easier (dense) ones like a curriculum, with no difficulty labels required Can representation sparsity order few-shot demonstrations effectively?. Another treats example selection as a formal experimental-design problem, choosing the sequence that most reduces uncertainty about the test set Can optimal experimental design improve few-shot example selection?. The brittleness and the opportunity are the same phenomenon viewed from opposite sides.

Underneath all of it sits a tension the corpus keeps circling: the model is constantly negotiating between what it learned in training and what you're showing it now. When prior associations are strong enough, in-context information gets overridden entirely, and prompting alone can't fix it Why do language models ignore information in their context?. Order is one of the few knobs that shifts that balance without retraining — which is exactly why a fragile, position-sensitive model is also a surprisingly steerable one.


Sources 7 notes

How much does demo position alone affect in-context learning accuracy?

Repositioning an identical demo block from prompt start to end swaps up to 20% accuracy and flips nearly half of predictions. This spatial effect operates independently of demo content and spans multiple task types.

Where do memorization errors arise in chain-of-thought reasoning?

STIM framework identifies local, mid-range, and long-range memorization sources in CoT reasoning. Local memorization—based on preceding tokens—accounts for up to 67% of reasoning errors, especially as complexity increases and distributional shift occurs.

Why do trajectories matter more than individual examples for in-context learning?

In-context learning for sequential decision-making requires full or partial trajectories from the same environment level, not just isolated examples. This structural property—trajectory burstiness—allows models to generalize across vastly different tasks without weight updates.

Why do language models fail in gradually revealed conversations?

Across 200,000+ conversations, all major LLMs show 39% average performance drop in multi-turn settings due to locking into incorrect early guesses. Agent mitigations recover only 15-20% of this loss.

Can representation sparsity order few-shot demonstrations effectively?

Sparsity-Guided Curriculum In-Context Learning uses last-layer activation sparsity to order demonstrations from sparse (harder) to dense (easier), yielding considerable performance improvements. This approach requires no external difficulty labels and works across diverse in-context learning tasks.

Show all 7 sources
Can optimal experimental design improve few-shot example selection?

AIPD frames demonstration selection as budgeted active learning, choosing examples that maximally reduce test-set uncertainty. Two algorithms (GO and SAL) outperformed similarity-based methods across small, medium, and large language models.

Why do language models ignore information in their context?

Research demonstrates that LMs generate outputs inconsistent with their context because parametric knowledge from training dominates over in-context information. Textual prompting alone cannot override strong priors; causal intervention in representations is required.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.

Research prompt for your LLMexpand ↓

Copy into ChatGPT or Claude to take this line of inquiry further — it asks the model to find newer work and re-test which earlier constraints still hold.

You are a research analyst. Question, still open: why is in-context learning brittle to the ORDER of examples presented, independent of what those examples say?

What a curated library found — and when (dated claims, not current truth). These findings span 2023–2025:
- Moving an identical demo block from the start of a prompt to the end can swing accuracy by up to 20% and flip nearly half of all predictions, holding across task types (~2025).
- Token-level "local memorization" — leaning on the immediately preceding tokens — drives up to two-thirds of reasoning errors, worsening as inputs get longer or drift out-of-distribution (~2025).
- Sequential-task ICL only works with "burstiness": whole trajectories from the same setting, not scattered isolated examples (~2023).
- In multi-turn dialogue, models cement premature assumptions from early turns and can't recover — order fixes which guess wins (~2025).
- Deliberate ordering flips the bug into a tool: sparsity curricula and optimal-experimental-design selection exploit position (~2024).

Anchor papers (verify; mind their dates): Where to show Demos in Your Prompt (arXiv:2507.22887, 2025); Diagnosing Memorization in CoT (arXiv:2508.02037, 2025); Generalization to New Sequential Decision Making Tasks with ICL (arXiv:2312.03801, 2023); Experimental Design for Active Transductive Inference (arXiv:2404.08846, 2024).

Your task:
(1) RE-TEST EACH CONSTRAINT. For every finding, judge whether newer models, training methods, tooling (SDKs, harnesses), orchestration (memory, caching, multi-agent), or evaluation have RELAXED or OVERTURNED it. Separate the durable question (why order matters at all) from the perishable limit (the specific 20% swing); cite what resolved each, and say plainly where a constraint still holds.
(2) Surface the strongest CONTRADICTING or SUPERSEDING work from the last ~6 months — especially papers that DISPUTE whether positional bias persists in current long-context and instruction-tuned models, and where the corpus's threads (position bias vs. local memorization vs. burstiness) actually disagree.
(3) Propose 2 research questions that ASSUME the regime may have moved.

Cite arXiv IDs; flag anything you cannot ground in a real paper.