Profiles & placement evidence — Context Window Architecture
CWA
GitHub
Profiles & placement evidence

Why placement is a profile, not a rule.

CWA fixes what the slots mean and refuses to fix where they go. This page is the justification: what the research measures, how provider guidance differs, what a profile has to carry, and how to evaluate one. Normative text is in Spec §5.

The position

Where an item sits in the window changes whether the model uses it. That effect is real, measured, and different for every model family, task shape and context length. A specification that hard-coded an order would be right for one deployment and wrong for the next, and nobody would be able to tell which.

So CWA takes no position on where items go. It requires only that placement be a profile: versioned, per route, evaluated against that route's tasks, and recorded in every trace. Every placement hint on this site, including the policy-first-chat default, is a tested default for one route, not a claim about models in general.

What the research measures

Serial-position effects are measured, not folklore. Liu et al. tested models on multi-document question answering and key-value retrieval and found a U-shaped curve: accuracy is highest when the relevant passage sits at the beginning of the context (primacy) or at the end (recency), and drops when it sits in the middle. [1]

Later long-context work finds the effect persists and varies. RULER evaluated 17 models and found almost all lose accuracy as context length grows, despite near-perfect scores on simple needle retrieval. [2] NoLiMa finds models do well at the edges of the window when the task is a literal match, but when the answer needs an associative hop, longer contexts pull performance down even at the edges. [3]

Position, length, model family and task interact. No single number describes it, and no single order is safe to bake into a spec.

Varies with
Model family and version
Varies with
Total context length
Varies with
Task: literal match vs associative hop
Varies with
Number and similarity of distractors

Provider guidance, by generation

Provider guidance differs and is written per model generation. Both recommendations below are right for their workloads; neither is right for the other's.

Anthropic · long-context tips [4]
Documents near the top, the question after them.

Long inputs go early and clearly delimited; instructions and the query follow. The document-analysis profile is this shape.

OpenAI · GPT-4.1 prompting guide [5]
Instructions at both ends of long context.

Repeat instructions before and after the long material; if stated once, above it. Notes that the family needed prompt migration. The long-context-reinforced profile is this shape.

Profile format

A profile is a small YAML file. It carries an id and version, the route it serves, the model family it was evaluated on, an ordered placement with a wrapper rule per slot, and the evaluation that justified promoting it (R-19). A slot may appear twice; the second occurrence is a reinforcement, rendered again. Omitted slots are not rendered.

profile.yaml{{ a.id }}
{{ a.yaml }}
Tool

Profile explorer

Pick two profiles. Each is drawn as the window it produces, in order, coloured by plane. The diff lists what moved. Export either as YAML.

Profile A
{{ a.name }}{{ a.id }}
route: {{ a.route }} · {{ a.uses }}
{{ r.n }} {{ r.slot }} {{ r.tag }}

{{ a.principle }}

Profile B
{{ b.name }}{{ b.id }}
route: {{ b.route }} · {{ b.uses }}
{{ r.n }} {{ r.slot }} {{ r.tag }}

{{ b.principle }}

A → B diff · {{ diffSummary }}
{{ d.kind }}{{ d.text }}

Highlighted rows are slots whose position differs between A and B. marks a reinforcement: the slot has already appeared and is rendered again.

Evaluating a profile

A profile is promoted by evidence from its own route, not by argument. The protocol is short and the trace makes it cheap: because assembly is deterministic (R-23), two profiles applied to the same items differ only in placement, so any change in outcome is attributable to placement alone.

{{ p.n }} {{ p.name }} {{ p.text }}
A profile whose evaluation block is empty is a hypothesis. Ship it if you must, but version it, and treat the first golden-task run as the evaluation that fills the block.
References
  1. Liu, Lin, Hewitt, Paranjape, Bevilacqua, Petroni, Liang. “Lost in the Middle: How Language Models Use Long Contexts.” arXiv 2307.03172 (2023); TACL 2024. arxiv.org/abs/2307.03172
  2. Hsieh et al. “RULER: What’s the Real Context Size of Your Long-Context Language Models?” arXiv 2404.06654 (2024). arxiv.org/abs/2404.06654
  3. Modarressi et al. “NoLiMa: Long-Context Evaluation Beyond Literal Matching.” arXiv 2502.05167 (2025). arxiv.org/abs/2502.05167
  4. Anthropic. “Long context prompting tips.” docs.anthropic.com
  5. OpenAI. “GPT-4.1 Prompting Guide.” developers.openai.com