Anatomy of a Prompt
How prompt structure affects AI responses. Learn why word order, formatting, and placement matter.
Structure Isn’t Optional
Most people write prompts like emails—stream of consciousness, whatever order feels natural. And it works… sort of.
But here’s something researchers discovered: the exact same information, rearranged, can dramatically change AI output quality. Word order matters. Formatting matters. Where you put instructions matters.
This lesson breaks down why—and how to structure prompts for consistent results.
The Attention Problem
AI models don’t read like humans. They process text through attention mechanisms that weigh different parts differently. And those weights aren’t uniform.
Studies show a pattern called “lost in the middle.” AI recalls information from the start and end of prompts better than the middle. Put your most important instruction buried in paragraph three? The AI might miss it entirely.
Think of it like a meeting: People remember the opening remarks and the final summary. Everything in between? Fuzzy.
Practical rule: Put critical instructions at the beginning or end. Never bury them.
Anatomy of a Well-Structured Prompt
Here’s a template that works for most complex tasks:
[SYSTEM CONTEXT] - Who the AI is, overall constraints
---
[TASK INSTRUCTION] - What to do, specific and concrete
---
[INPUT DATA] - The content to work with
---
[OUTPUT FORMAT] - Exactly how to format the response
---
[EXAMPLES] - What good output looks like (optional but powerful)
Each section has a job. Mixing them creates confusion.
The Power of Delimiters
Delimiters are characters that separate sections. Common ones:
---(three dashes)###(three hashes)"""(triple quotes)<section>tags
Why bother? Because AI can confuse your instructions with your content.
Bad:
Summarize this customer complaint: The service was terrible and nobody helped me and I want a refund. Keep the summary professional and brief.
Is “Keep the summary professional and brief” part of the complaint or your instruction? The AI might genuinely not know.
Better:
Summarize this customer complaint in 2-3 professional sentences.
COMPLAINT: The service was terrible and nobody helped me and I want a refund.
Now there’s zero ambiguity. The delimiter creates a clear boundary.
Instruction Placement Patterns
Three patterns that work reliably:
Pattern 1: Instruction First
Write a professional email declining a meeting request.
Context: The requester is a vendor trying to sell software. I'm not interested but want to maintain the relationship.
Tone: Polite but firm.
Best for: Simple, single-step tasks where the action is clear.
Pattern 2: Context First, Instruction Last
You're a senior HR manager at a tech company.
An employee has requested to work remotely full-time.
Company policy allows hybrid (3 days office, 2 days remote).
The employee has been a strong performer for 4 years.
**Quick check:** Before moving on, can you recall the key concept we just covered? Try to explain it in your own words before continuing.
Write a response that acknowledges their request while explaining the policy constraints. Leave room for future discussion.
Best for: Tasks requiring significant background understanding before acting.
Pattern 3: Sandwich (Instruction-Context-Instruction)
Analyze the following sales data and identify trends.
[DATA TABLE HERE]
Based on your analysis, provide:
1. Top 3 trends
2. One concerning pattern
3. Recommended action
Best for: Complex tasks where you need to frame the content AND specify the output format.
Formatting That Helps AI
Some formatting choices genuinely improve results:
Numbered lists for sequential tasks:
1. Read the customer message
2. Identify the main complaint
3. Check if it matches our return policy
4. Draft an appropriate response
Bullet points for parallel options:
Consider these factors:
- Budget constraints
- Timeline pressure
- Team capacity
- Technical feasibility
Headers for long prompts:
## Your Role
Senior product manager at a SaaS company
## Task
Prioritize this feature backlog
## Constraints
- Q1 launch deadline
- 3 developers available
- No backend changes
## Backlog Items
[list here]
What Formatting Doesn’t Do
A warning: formatting won’t fix a bad prompt. I’ve seen people add markdown headers and numbered lists to vague requests, thinking it’ll help.
It won’t.
## Task
Help me with my project
## Details
It's for work
## Output
Make it good
That’s just organized vagueness. Garbage in, formatted garbage out.
Structure amplifies clarity. It doesn’t create it.
Practical Exercise
Take this messy prompt:
I need you to help me write something for our customers about the new feature we’re launching next week it’s a dashboard that shows their usage stats and I want it to sound exciting but professional and not too long maybe 100-150 words and make sure to mention the free trial
Rewrite it using proper structure with delimiters and clear sections.
See one solution
## Task
Write a 100-150 word customer announcement for a new feature.
## Feature Details
- Name: Usage Dashboard
- Launch: Next week
- Shows: Customer usage statistics
- Note: Free trial available
## Tone
- Exciting but professional
- Not salesy or over-the-top
- Clear and direct
## Requirements
- Mention free trial prominently
- Keep to word limit strictly
Key Takeaways
- AI attention isn’t uniform—beginning and end get more weight
- Delimiters prevent confusion between instructions and content
- Structure your prompts: System → Task → Input → Output → Examples
- Formatting helps, but only if the underlying content is clear
- Put critical instructions in “prime positions” (start or end)
Next up: how roles and personas shape AI behavior in ways most people never realize.
Up next: In the next lesson, we’ll dive into Roles and Personas.
Knowledge Check
Complete the quiz above first
Lesson completed!