Key Aspects of the Research:
The study shows that where you put examples (demos) in a prompt has a dramatic effect on the accuracy and stability of LLM answers. Models display a strong "primacy effect": examples placed at the very start of the prompt (especially in the system part) produce the best results. Examples placed at the end of the prompt, after the main question, can seriously hurt answer quality and make the output unstable.
Key Result: Putting examples at the beginning of the prompt significantly improves the accuracy and stability of LLM answers.
The Method in a Nutshell:
The method that follows from this research is about deliberately structuring your prompt to exploit the "primacy bias" of large language models. Unlike a human, an LLM does not weigh every part of the prompt equally. Information that comes first has far more influence on the final result than information in the middle or at the end.
How to apply it in practice:
- Identify the critical information. When you use few-shot prompting (learning from examples), the examples themselves are the most important part: they set the format and logic of the answer.
- Put that information at the very top. Your examples (demos) should come before the main instruction or question.
- Use the system prompt. If your chatbot or API lets you separate a "system prompt" (general instructions) from a "user prompt" (the specific question), put the examples in the system part. The paper labels these positions
ssp(start of system prompt) andesp(end of system prompt), and both perform well. - Avoid putting examples at the end. The worst strategy is to ask the question first and then tack on "Here are some examples of how to answer" at the bottom. That confuses the model and leads to unstable, less accurate answers (the
eumposition, end of user message).
Put simply: first show the model WHAT you want and HOW you want it, and only then hand it the material to work on.
Practical Applicability:
Direct applicability: Exceptionally high. Anyone can apply this principle right away just by reordering the paragraphs of their prompt. No special knowledge, API or tools required. Just cut the examples block and paste it at the top of the prompt.
Conceptual value: Very high. The study gives users a key insight: "Order matters". It breaks the naive view of the LLM as a "black box" and builds a more accurate "mental model". Users start to see that they can steer the model not only through content but also through the structure of the request, and that the first tokens of a prompt are the most "expensive" in terms of influence.
Adaptation potential: Huge. Although the study focuses on few-shot examples, its main takeaway about the "primacy effect" can and should be applied to any prompt.
- How to adapt it: Any crucial instruction, constraint, keyword or piece of context should go as close to the start of the prompt as possible. For example, if you want the answer in JSON, the instruction "Respond strictly in JSON format" belongs at the very beginning, not at the end of a long request.
Practical Example:
Say a marketer wants to quickly sort customer reviews into three categories: "Positive", "Negative", "Neutral".
`
### Role and Task
You are a marketing assistant. Your job is to analyze customer reviews and classify their sentiment.
### Examples to Follow (Demos)
Here is how to do the classification:
* **Review:** "Really happy with how fast it shipped and the quality of the product! Will order again."
**Category:** Positive
* **Review:** "The order arrived three days late and the box was crushed."
**Category:** Negative
* **Review:** "The phone was delivered on the promised date."
**Category:** Neutral
### Instruction
Analyze the customer review I provide below and determine its sentiment category. Answer with a single word only: "Positive", "Negative" or "Neutral".
### Review to Analyze:
"Overall it's not bad, but I expected more from this phone's camera. The in-store service was top-notch."
Why It Works:
This prompt works because it applies the study's findings directly:
- Examples come first: The
### Examples to Follow (Demos)block sits at the very top, right after the role definition. According to the study (thesspandesppositions), this makes the model "tune in" to the task first and grasp the required format and logic. - Exploiting the "primacy effect": The model processes the examples first and forms a clear picture: "positive" means delight, "negative" means problems, and "neutral" means a plain statement of fact.
- Clear separation: By the time the model reaches the
### Review to Analyzeblock, it is already "primed" with the right context and is more likely to apply the learned pattern instead of "improvising" or writing a long answer. Putting the examples at the end would produce far less predictable results.
Another Practical Example
Task: an HR specialist wants to quickly pull key skills out of a candidate's short cover letter and rate them based on stated experience.
`
### Context and Role
You are an HR assistant. Your job is to extract a candidate's key skills from cover letters, along with their likely proficiency level based on the description.
### Data Extraction Examples (Demos)
Here is how to structure the information:
* **Text:** "I've led software development teams for 5 years using Agile and Scrum. I'm comfortable using Python to automate scripts."
**Extracted skills:**
- Skill: Team management
Level: Expert (5 years of experience)
- Skill: Agile/Scrum
Level: Expert (5 years of experience)
- Skill: Python
Level: Confident user
* **Text:** "I took Figma courses and built a few mockups for personal projects. I want to grow in this direction."
**Extracted skills:**
- Skill: Figma
Level: Beginner (courses, personal projects)
### Task
Analyze the cover letter below. Extract the key skills and rate the proficiency level. Present the result as a list, just like in the examples.
### Cover Letter to Analyze:
"Hello! Your opening caught my attention. I've been working with SQL for over three years, writing complex queries for analytics. I also recently started learning Tableau for data visualization and have already built several dashboards for our department."
Why This Example Works.
This prompt works on the same principle as the previous one, but for a structured information extraction task:
- Format comes first: The
### Data Extraction Examples (Demos)block is at the very top. It does more than show examples: it sets a strict output format, a list with "Skill" and "Level" fields. Thanks to the "primacy effect", the model treats this format as the main requirement. - Teaching the logic: The examples teach the model not just the format but also how to judge level ("5 years" -> "Expert", "took courses" -> "Beginner"). The model absorbs this logic before it ever sees the text to analyze.
- Lower cognitive load: When the model gets the final task, it doesn't have to juggle the text, the instruction and an invented format all at once. The format and logic already dominate the context. That makes the result more stable, more accurate and closer to what the user expects.
Usefulness Score: 95
Main Evaluation Criteria
- A. Relevance to prompting techniques: Very high. The study is directly about prompt structure, specifically the placement of few-shot examples (demonstrations).
- B. Better conversational answers: Very high. It shows a direct effect on accuracy (up to +6%) and answer stability (fewer prediction "flips").
- C. Direct practical applicability: Maximum. Users need nothing beyond the ability to edit their prompt text. The method is simply moving the examples block to the top of the request.
- D. Conceptual value: High. The study clearly demonstrates the "primacy bias" of LLMs and helps users see that models pay more attention to information at the start of the context. That is essential knowledge for any user.
- E. New useful practice (clustering): The work falls into several key clusters at once:
- Cluster 1 (Prompt wording techniques): A direct extension of few-shot prompting.
- Cluster 2 (LLM behavioral patterns): Reveals and measures positional bias.
- Cluster 3 (Prompt structure optimization): Gives clear guidance on where to place instruction blocks.
- Practicality checklist (+15 points): Yes. The work gives clear guidance on where to place important information (few-shot examples) and how to structure complex requests (examples first), reveals non-obvious LLM behavior (positional sensitivity), and offers ways to improve answer accuracy and stability.
Numerical Usefulness Score
Arguments for a high score (95/100): * Maximum practicality: The takeaway, "put examples at the start of the prompt", is a simple, free, immediately usable action that can noticeably improve results. * Universality: The principle was tested on many models (Llama, Mistral, Qwen) and tasks (classification, QA, summarization), so it applies broadly. * Fundamental value: Understanding the "primacy effect" is a fundamental shift in how users think. Instead of treating a prompt as a flat list of instructions, they start seeing it as a sequence where position matters.
Counterarguments (why not 100/100): * Not a "silver bullet": The study shows that for the largest, most advanced models (for example, Llama-3 70B) the optimal position can shift (for instance, to the start of the user message rather than the system prompt). That adds some uncertainty and means advanced users need to do extra testing. * Few-shot focus: Although the principle can be extrapolated, the study is specifically about prompts with examples (few-shot). Its value for zero-shot prompts (no examples) is only indirect (conceptual understanding).