Long Background Hides the Actual Task

Your prompt has three paragraphs of context and one buried sentence asking for the deliverable, so the model summarizes the background instead. Here is how to put the task where the model will actually read it.

You pasted three paragraphs of context (company background, the team setup, the current project status, why you are even doing this thing) and ended with “so, can you draft the launch email?” The model returned a 400-word summary of your company. Not an email. Not a draft. A summary. The task was technically in there, but it was the 47th sentence of a 50-sentence prompt, and the model treated the dominant theme as the request.

Fastest fix: move the task to the first line as an imperative, and repeat it as the very last line. If the surrounding context is genuinely long (roughly 20,000 tokens or more, say a pasted policy or transcript), do the opposite of what feels natural: put that long material at the top and put your task/question at the bottom. Anthropic’s own long-context guidance reports this ordering can improve answer quality by up to 30% on complex multi-document inputs (as of June 2026). The rest of this page explains why, and how to structure prompts so the task is unmistakable even when the context is necessary.

Why this happens: attention is U-shaped

Language models do not read your prompt evenly. The well-documented “lost in the middle” effect (Liu et al., Stanford / UC Berkeley) shows retrieval accuracy follows a U-shaped curve: tokens at the very start and the very end of the input get the most attention, and anything buried in the middle can lose 20-30%+ of its pull on the output. A task sentence sitting at position 47 of 50, surrounded by background, lands in exactly the low-attention valley. The model anchors on the first thing it read (an essay-style company intro) and on the last thing it read (more context), and the buried instruction never wins.

That is also why the two reliable fixes are “task first” and “task repeated last”: you are placing the deliverable at both ends of the curve, where attention is highest.

Which bucket are you in

Symptom in your promptMost likely causeGo to
First 3 sentences are descriptive prose (“We were founded in 2019…”)Background reads like an essay opener; the model anchors on “profile of company X”Step 1
The deliverable verb appears once, after paragraph 2Task stated once, in prose, late, in the attention valleySteps 1 + 4
Prompt is one flat block, no labelsNo structure, so the model infers structure and picks the dominant theme (background)Step 2
You pasted 5 paragraphs because they “felt relevant”Context is necessary but unfocused; load-bearing facts hide in fillerStep 3
You wrote constraints, then context, then taskStructural inversion: early constraints frame the model before it sees the taskSteps 1 + 2
Background is genuinely huge (a whole policy, transcript, or doc dump)Long reference content, not a short promptStep 5

How to spot the buried verb fast: search your prompt for the deliverable verb (draft, write, summarize, compare). If it appears once and after the second paragraph, it is buried.

Before you change anything

  • State the actual deliverable in one sentence. If you cannot, the model cannot either.
  • Read the prompt as if you had never seen it. Where does the deliverable first appear, by sentence number?
  • For each background paragraph, ask: “would the answer change if I deleted this?” If no, it is a cut candidate.
  • Decide which ~50 words of context are genuinely load-bearing.

Shortest path to fix

Step 1: Lead with the imperative

The first imperative sentence sets the frame. Write it before any context:

TASK: Draft a 200-word launch email to the engineering team.
Tone: direct, no marketing speak.
Output: just the email body, no subject line.

CONTEXT: <pruned context here>

The model reads “Draft a 200-word launch email” first and frames everything after it as input to that task, not as a topic to describe.

Step 2: Use section labels

Labels turn an ambiguous wall of prose into clearly-typed reference material:

## Task
Draft a launch email.

## Audience
Internal engineering team, 12 people.

## Background (use only what is relevant)
- We are launching Feature X next Tuesday.
- It replaces the legacy retry logic.
- Engineering already knows about the deprecation.

## Output format
- Plain text email body.
- 150-200 words.
- No subject line.

If you are on Claude, the strongest version of this is XML tags rather than markdown headers, because Claude is specifically tuned to parse them: wrap each block in <task>, <context>, <output_format>. Anthropic recommends this exact pattern for separating instructions from input.

Step 3: Prune mercilessly

For each background paragraph, ask “would the answer change if I removed this?” If no, remove it. A 600-word prompt with 200 useful words beats a 1000-word prompt with the same 200 useful words plus 800 words of noise, because the noise dilutes attention and pads the middle of the U-curve. Retrieval research consistently finds that keeping only the 3-5 most relevant pieces of context outperforms dumping everything in.

Step 4: Repeat the task at the end

A single restatement at the bottom puts the deliverable on the high-attention recency end of the curve too:

[Top: task and context]

[Bottom]
Reminder: Draft only the launch email body. No subject line.
No commentary. 150-200 words.

Top plus bottom hits both ends of the U. This is the single highest-leverage change for a prompt that keeps drifting back to summarizing.

Step 5: For genuinely long reference content, flip the order

This is the counterintuitive one, and it is where “always put the task first” stops being the right rule. When the background is a large pasted document (roughly 20,000+ tokens: a full policy, a long transcript, a spec), Anthropic’s long-context guidance says to put that long material at the top, above your query, and put the actual question/instruction at the bottom. Tokens at the end of the input carry higher attention weight, so a question placed there acts as the sharpest “query vector” against everything the model just read. Anthropic reports up to a 30% quality improvement from this ordering on complex multi-document inputs (as of June 2026).

Wrap each document in tags with source metadata so the model treats it as reference, not as a request to summarize:

<documents>
  <document index="1">
    <source>launch_policy.md</source>
    <document_content>
    ... 2000 words of policy ...
    </document_content>
  </document>
</documents>

Using only the policy above, draft a 200-word launch email to the
engineering team. Output the email body only, no subject line.

For very long documents, add one more line that forces the model to ground itself before writing: “First, quote the 3-5 sentences from the document that are relevant to this email, then write the email.” Asking for relevant quotes first cuts through the noise of the rest of the document and measurably improves grounding.

Step 6: Test with a stranger

Send the prompt to a colleague who has no context, and ask them to do what it says. Anthropic frames this as the golden rule of prompting: if a person with minimal context would be confused about what to produce, the model will be too. If they cannot identify the deliverable in about 10 seconds, rewrite the opening line.

How to confirm it is fixed

  • A reader with no context reads the first 3 lines (or, for the long-reference layout, the last 3 lines) and correctly names the deliverable.
  • The output is the deliverable, not a summary of the context.
  • Deleting a redundant context paragraph does not change the output (proof it was noise).
  • Running the same prompt 3 times produces 3 outputs that are all the right type of thing, not “a summary one time, an email another.”

If it still fails

  1. The context may still be large enough to drown the task. Cut more, or move it into the long-reference layout from Step 5.
  2. Switch to a model with stronger long-context attention. As of June 2026, Claude Opus 4.7, Claude Sonnet 4.6, and Gemini 3.1 Pro all ship with 1M-token context; on ChatGPT, the full 1M in-app window is limited to the $200 Pro tier (Plus sees roughly 320 pages).
  3. Two-pass it: prompt one summarizes the context into the load-bearing facts, prompt two uses that summary plus the task. This sidesteps the buried-task problem entirely.
  4. If the task itself is multi-part, split it into separate prompts. One deliverable per prompt is far more reliable than three.

FAQ

Why does the model summarize my background instead of doing the task? Because the background is the dominant, highest-attention content (it sits at the start of the prompt, and there is a lot of it), while the task sits in the low-attention middle. The model frames the request around what it paid most attention to. Move the task to the first and last line to fix it.

Should I always put the task first, then? For ordinary prompts, yes: task first, then context, then a restated task at the end. The exception is when the “context” is a genuinely large pasted document (about 20K tokens or more). Then put the document first and the task last, which Anthropic’s testing shows can improve quality by up to 30%.

Does making the prompt longer with more detail help? Detail in the task (format, length, tone, constraints) helps. Detail in the background usually hurts once it stops changing the answer, because extra words dilute attention and pad the middle of the context where the model attends least. Prune background to only what is load-bearing.

My prompt is short and the task is still ignored. What now? Check for structural inversion: if you wrote constraints or context before the task, the model anchored on those first. Lead with a single imperative line (“Draft X.”), then everything else. Also confirm the deliverable verb is actually imperative, not phrased as a question buried in prose.

Does section labeling actually matter, or is it cosmetic? It matters. Labels (“Task”, “Context”, “Output format”, or XML tags like <task>) tell the model which block is the instruction and which is reference material, so it stops having to guess. On Claude specifically, XML tags are the most reliable separator.

Prevention

  • Default template: TASK first, CONTEXT second, OUTPUT FORMAT last, then restate the task on the final line.
  • Cap context to only what changes the answer; aim for the 3-5 most relevant facts.
  • For repeated workflows, save a template so you do not improvise structure each time.
  • Re-read the first and last lines of every prompt before sending; the deliverable should be obvious from either end.
  • Use section labels (or XML tags) once context exceeds ~200 words.
  • Watch for “I should mention” or “for context” openers; they often introduce a cuttable paragraph.

External references: Anthropic’s long context prompting tips and the original Lost in the Middle paper.

Tags: #Troubleshooting #Prompt #Prompt quality #Long prompt