الانتقال إلى المحتوى
أساسيات الـ AIPrompt Engineering· 6 دقائق للقراءة

Prompt Engineering Isn't Magic Words: Write a Clear Spec Instead

Tips, threats and expert personas don't reliably help. Context, a precise task and a test set do.

ReadIn

مقال كل يوم يفرق معاك

21 نوفمبر 2026
  • كاتب موثّق
محتويات المقال

A teammate's prompt summarizes support tickets for the on-call engineer. It opens with "You are a world-class senior support engineer with 20 years of experience. This is VERY IMPORTANT." Some summaries run three lines, others three paragraphs, and some drop the error code the on-call needs. So the prompt grows: "CRITICAL", a promised $200 tip, more capital letters. Each fix seems to help on the ticket it was tested on, and the next bad summary arrives anyway.

The common misconception

"Good prompting is about secret phrases, like 'you are a world-class expert' or promising the model a tip." It's an easy belief to pick up:

  • Wording really matters. Sclar and colleagues found that changing only the formatting of a few-shot prompt, such as separators, spacing or capitalization, moved LLaMA-2-13B's accuracy by up to 76 points. If spacing matters, why not a magic phrase?
  • Screenshots of one conversation where a phrase "worked" spread fast, and a single output proves nothing either way.
  • Anthropic's own guide recommends giving Claude a role, which looks like a magic sentence.
  • A phrase takes seconds to add. A spec takes thinking about what you want.

It's a half-truth. Prompts are powerful, and tiny changes can swing results. But the effect of a trick is inconsistent and hard to predict, while the effect of information is not: a model can only use what's in its context.

What actually happens

The model works from what you wrote

As the Understanding LLMs path showed, a model generates the likeliest continuation of its context. "You are an expert" adds no facts about your task. It doesn't say who reads the summary, which details matter, how long it should be or what to do when the ticket is vague. Those gaps get filled with the most generic choice, which is why the outputs wander.

Tips, threats and personas, measured

  • Tips and threats. Meincke and colleagues at Wharton tested tipping offers and threats in 2025 on GPQA Diamond and MMLU-Pro with Gemini 1.5 Flash, Gemini 2.0 Flash, GPT-4o, GPT-4o-mini and o4-mini. Threatening or tipping generally had no significant effect. Individual questions did change, but it was hard to know in advance whether a variation would help or hurt.
  • Personas. Zheng and colleagues tested 162 roles in the on 2,410 factual questions across open models including Llama-3, Mistral and Qwen2.5. Adding a persona didn't improve accuracy over no persona, the effect of each persona was largely random, and automatically picking the best persona often did no better than random selection.
  • Format. In Sclar and colleagues' study, the formats that worked best for one model only weakly predicted what worked for another. A phrase that helped one model may not transfer.

Why roles still appear in good prompts

Anthropic's best-practices guide says a role in the system prompt "focuses Claude's behavior and tone for your use case". That's the honest job of a role: it tells the model the domain, the audience and the voice. It's part of the spec. What it doesn't do is add knowledge; "expert" doesn't make the model know what it didn't know.

Explain the why, and drop the shouting

The same guide suggests replacing bare rules with reasons. "NEVER use ellipses" works less well than saying the response will be read aloud by a text-to-speech engine that can't pronounce them, because the model can generalize from the explanation. It also advises saying what to do rather than what not to do. And it warns that Claude Opus 4.5 and 4.6 respond more strongly to the system prompt than earlier models, so prompts written as "CRITICAL: You MUST use this tool when..." can make them overtrigger; normal wording like "Use this tool when..." is the fix.

Same task, written as a spec

The first prompt below leaves the reader, the length, the fields and the missing-data rule to chance. The second states them, says why, and separates the ticket from the instructions with tags.

Python summarize_ticket.py
import anthropicclient = anthropic.Anthropic()ticket = "Pro plan. Since Monday every CSV export fails with E413..."SYSTEM = ("You are a world-class senior support engineer with 20 years of "          "experience. This is VERY IMPORTANT to my career. I'll tip you "          "$200 for a perfect summary.")reply = client.messages.create(    model="claude-opus-5-5", max_tokens=16000, system=SYSTEM,    messages=[{"role": "user", "content": f"Summarize this: {ticket}"}],)

Nothing in the second prompt is clever. Every line answers a question a new support engineer would ask on their first day, and each one gives you something to check in the output.

MythReality
"You are a world-class expert" makes answers more accurateAcross 162 personas, adding one didn't beat no persona on factual questions
A promised tip or a threat makes the model try harderGenerally no significant effect across five models on two hard benchmarks
Capitals and "CRITICAL" make it obeyNewer Claude models can overtrigger; Anthropic advises normal wording
A phrase that worked once will keep workingPer-question effects were unpredictable, and format effects barely transfer
Prompting is a bag of tricksIt's a spec: context, task, format, edge cases and examples, then a test

How to apply it in your project

  1. Define success before you writeAnthropic's overview assumes three things before prompt engineering starts: clear success criteria, a way to test against them, and a first draft. Write down what a correct output looks like and how you'll check it.
  2. Give the context a new colleague would needSay who reads the output, what they do with it and why each requirement exists.
  3. Specify the outputName the format, the length and the fields, and say what to do when information is missing.
  4. Separate instructions, data and examplesWrap inputs in tags such as <ticket>, and when you add examples, use 3 to 5 varied ones inside <example> tags.
  5. Test on real inputs, one change at a timeRun every prompt version on the same set of real cases and keep a change only if the results improve.

Key takeaways

  • Tips, threats and expert personas showed no consistent accuracy gains in controlled tests.
  • The model works from the information in its context, so missing context becomes generic guessing.
  • A role is useful for focus and tone, not as a source of knowledge.
  • Explain why a rule exists, say what to do, and drop the shouting.
  • Treat a prompt as a spec: define success, state the task precisely and test changes on real inputs.

📚 المصادر

  1. Prompt engineering overview — Claude API Docs
  2. Prompting best practices — Claude API Docs
  3. Sclar et al., Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design, arXiv:2310.11324
  4. Zheng et al., When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models, arXiv:2311.10054
  5. Meincke et al., Prompting Science Report 3: I'll pay you or I'll kill you — but will you care?, arXiv:2508.00614

التعليقات (0)