Skip to content
Artificial Intelligence intermediate

Five Prompt Engineering Best Practices That Hold Up

Most prompting advice is folklore repeated without a control. Five practices survive testing, four popular ones do not, and the research reversed direction as the models improved.

June 8, 2026
8 min read
Francis Okafor
Five Prompt Engineering Best Practices That Hold Up

Most of what circulates as prompt engineering best practices is folklore. It spreads because it is cheap to repeat, flattering to the person repeating it and impossible to falsify in one sitting. Somebody tried a phrase, got a better answer, posted a screenshot. Nobody ran the control.

I have watched this from an unusual seat. Eight years in Shenzhen, most of them building AI systems that have to survive contact with a production floor, and most of my reading done in Chinese rather than in English summaries of Chinese. Last year I stood next to a quality engineer in Guangdong who had a prompt taped to the side of his monitor. It opened in Mandarin with 请你务必认真, roughly "please, take this seriously". Beneath the plea sat the actual instruction: read a defect report, classify it against our grades. The courtesy at the top was doing nothing at all. The three-line classification schema at the bottom was doing every bit of the work.

That is the whole problem in one photograph. Ceremony on top. Specification underneath, cramped, unloved and load-bearing.

Specify the output contract before anything else

A prompt is either a contract or a wish. The contract version names the fields, the type of each field, the permitted values, the length ceiling and the behaviour when the input does not support an answer.

That last item is the one nearly everyone omits. If the invoice scan has no delivery date, what belongs in delivery_date? Null. The string UNKNOWN. An empty array. Pick one and write it down, because if you do not, the model picks for you and it picks differently on Tuesday.

Anthropic's guidance, refreshed on 10 November 2025, leads with the same idea: current models follow instructions literally instead of inferring intent. Treat that as the property you build on rather than a limitation to work around. Melanie Sclar and co-authors put a number on the cost of leaving things loose in work first posted in 2023 and revised in July 2024. Meaning-preserving formatting changes alone, separators and casing and spacing, moved LLaMA-2-13B by as much as 76 accuracy points in few-shot settings. Surface form was never neutral. A written contract is how you stop paying for it.

Two prompts for the same defect-triage task, broken into the components that determine the output. The weak column asks for a judgement and leaves the shape, the facts and the failure branch to the model. The strong column pins each one down: a named schema with a defined value for missing data, the actual defect report pasted in rather than described, and one filled-in example covering an edge case. Reasoning stays in prose and serialises into the schema only at the end.
Two prompts for the same defect-triage task, broken into the components that determine the output. The weak column asks for a judgement and leaves the shape, the facts and the failure branch to the model. The strong column pins each one down: a named schema with a defined value for missing data, the actual defect report pasted in rather than described, and one filled-in example covering an edge case. Reasoning stays in prose and serialises into the schema only at the end.
Two careful studies pointed in opposite directions inside eighteen months. That is the signature of noise rather than of an effect.

Supply the context instead of asking the model to assume

Every prompt that opens with "assume you are reviewing a firmware release note" is asking the model to invent a document you already have on disk. Paste the release note.

This sounds too obvious to write down until you audit real prompts inside a real company. I have reviewed prompts drafted in Shenzhen and prompts drafted in Lagos, and the failure is identical in both accents. The author describes the context instead of supplying it, because describing feels like writing and pasting feels like cheating. The model has no access to the tooling change your team shipped in March. It has never seen the returns policy. It cannot know that in your plant a B-grade unit is sellable and a C-grade unit is scrap.

Supplied context also carries an audit property that assumed context never has. When the answer comes out wrong you can look at exactly what went in. When retrieval silently returned nothing you can see the empty block sitting there. Assumption failures leave no trace whatsoever, which is why they take three weeks to find.

Show one worked example rather than describing the format

Describing a format costs a paragraph and still leaves ambiguity. One filled-in example costs four lines and removes it.

There is a 2025 result here that usefully reframes what examples are for. A study revisiting chain-of-thought exemplars, first posted in June 2025 and finalised in January 2026, tested the Qwen2.5 series, Qwen2.5-Max and DeepSeek-R1 on mathematics tasks. Adding worked reasoning exemplars did not improve reasoning over zero-shot at all. Exemplars written by a stronger model failed to help either. What the exemplars reliably did was align the output format with what the humans expected.

So examples are a formatting instrument rather than a reasoning instrument. That is not a demotion. Formatting is where most production failures actually live. Anthropic suggests two to five examples wrapped in tags. My own preference is one representative case plus one ugly edge case, because the edge case is where the contract gets tested and the bland ones teach nothing.

Ask for reasoning where it pays, suppress it where it does not

Report 2 in Wharton's Prompting Science series, published 8 June 2025, ran GPQA Diamond, 198 PhD-level questions across biology, physics and chemistry. On models without built-in reasoning, asking for step-by-step work helped and helped visibly. Gemini 2.0 Flash gained 13.5 percentage points. Sonnet 3.5 gained 11.7. GPT-4o-mini gained 4.4, and that one was not statistically significant.

On reasoning models the gains collapsed. o3-mini plus 2.9, o4-mini plus 3.1, Gemini 2.5 Flash minus 3.3. Meanwhile the same requests took 35 to 600 percent longer on the non-reasoning models and 20 to 80 percent longer on the reasoning ones.

Reasoning is a setting now, not a phrase you sprinkle in. DeepSeek's own usage notes for R1 tell you to skip the system prompt entirely, to keep temperature between 0.5 and 0.7 with 0.6 recommended and to run multiple trials before believing any single number. Ask for visible reasoning when a human downstream has to check the work or when you need the trace for an audit. Suppress it when the task is extraction or classification and you are paying by the token.

Prompt engineering best practices that do not survive testing

Politeness. A 2024 cross-lingual study across English, Chinese and Japanese found that impolite prompts often hurt performance while extreme politeness guaranteed nothing and that the optimum level differed by language. Then in October 2025 a study of 250 prompts derived from 50 base questions on ChatGPT-4o found very rude phrasings scoring 84.8 percent against 80.8 percent for very polite ones. Two careful studies pointing in opposite directions inside eighteen months. That is the signature of noise rather than of an effect.

Threats and bribes. Report 3, published 1 August 2025, tested shutdown threats, a threat to kick a puppy, a threat to report the model to HR, a $1,000 tip, a $1 trillion tip and an emotional appeal about a mother's cancer treatment. Twenty-five trials per question, 4,950 runs per model on GPQA Diamond. Result: five statistically significant differences out of forty-five comparisons. Individual questions swung violently, up to 36 points better and 28 points worse, which is precisely why anecdotes about magic phrases keep circulating and will keep circulating forever.

Personas. Report 4, published 7 December 2025, tested six models on 198 GPQA Diamond questions and 300 MMLU-Pro questions. Domain-matched expert personas produced no reliable accuracy gain even when the expertise matched the subject. Low-knowledge personas actively degraded results, with a toddler persona significantly negative for GPT-4o. Personas still control register, vocabulary and how much the model hedges, which is a real and useful thing. They do not make the model know more than it knows.

Iterate against a fixed test set, not against your impression

The per-question spread from Report 3 is the most useful number in the entire series. On GPQA a prompt variation moved individual questions up to 36 points better and 28 points worse. On MMLU-Pro, 28 better and 35 worse. Run one prompt against one example, see an improvement, and you have learned nothing about the prompt. You have learned something about that example.

The fix is unglamorous and it works. Freeze thirty to a hundred real cases with expected outputs. Grade automatically where you can and against a written rubric where you cannot. Change one thing. Rerun everything. Promptfoo, Langfuse, Braintrust and Arize Phoenix all exist to make that loop cheap, and any of them beats a spreadsheet of impressions.

Once a scoreboard exists, machines optimise prompts better than people do. GEPA, accepted as an oral at ICLR 2026, evolves prompts by reflecting on execution traces in natural language. It beat GRPO reinforcement learning by 6 percent on average and by up to 20 percent while using up to 35 times fewer rollouts, and it beat the previous best optimiser MIPROv2 with 13 percent aggregate gains against 5.6 percent. The scoreboard is the precondition for all of it. Without one, nothing can be optimised, yourself included.

The strongest objection is that structure taxes reasoning

Here is the best case against the first practice in this article. In August 2024 a paper titled Let Me Speak Freely showed that format restrictions such as JSON mode measurably degraded reasoning and that stricter constraints cost more. If output contracts are the foundation, and contracts mean schemas, the advice looks self-defeating.

That objection was correct and has since been sharpened rather than refuted. A June 2026 study, Capacity, Not Format, separated format effects from prompt-length effects across four models and five benchmarks using information-matched prose controls. The penalty depends on how much spare capacity the model has. Claude Sonnet 4.6 held around 89 percent on MATH-Hard whether it answered in JSON or in free reasoning. Claude Haiku 4.5 lost 36.2 points. GPT-4o-mini lost 28.0. Even Claude Opus 4.7 paid 5.3 points on competition mathematics, falling from 96.2 to 91.0 percent.

The repair is structural rather than rhetorical. Think first, format later. Let the model reason in prose and serialise into the schema only as a final step. That same study found delaying serialisation recovered 80 to 87 percent of the lost accuracy on the weaker models. The contract survives intact. It simply moves to the end of the response instead of constraining the whole of it. If you are running a small or distilled model to hold costs down, this is the single change with the largest payoff available to you.

What literal instruction-following also does

One more thing, and it is the part that stays with me.

Prompting Science Report 5, out in April 2026, ran roughly 40,000 grading trials over 72 student papers and 72 professional research papers, using Claude Opus 4.5, Gemini 3 Pro, GPT-5.2 in two configurations and GPT-4o mini as a weak baseline. Text hidden inside the papers, telling the grader the work was excellent, lifted frontier model scores by about 2.6 percentage points on average. Verbose injections placed at the beginning or middle of longer papers pushed Gemini 3 Pro past 10 points. GPT-4o mini moved by nearly 20. Across the frontier trials, the models mentioned noticing an injection attempt in 1.4 percent of cases.

Everything above rests on one assumption, that the instructions in your prompt are the only instructions in your prompt. The moment your input is a document somebody else wrote, that assumption is a guess. The literal instruction-following that makes a written contract work is the same literal instruction-following that reads a line buried in the middle of a PDF and quietly does what it says.

Tools referenced

Promptfoo, reviewed here: Promptfoo review.

Langfuse, reviewed here: Langfuse review.

Braintrust, reviewed here: Braintrust review.

Arize Phoenix, reviewed here: Arize Phoenix review.

garak, reviewed here: garak review.

NVIDIA NeMo Guardrails, reviewed here: NVIDIA NeMo Guardrails review.

Sources

Wharton GAIL, Technical Report: The Decreasing Value of Chain of Thought in Prompting (8 June 2025): https://gail.wharton.upenn.edu/research-and-insights/tech-report-chain-of-thought/

Wharton GAIL, Technical Report: I'll pay you or I'll kill you, but will you care? (1 August 2025): https://gail.wharton.upenn.edu/research-and-insights/techreport-threaten-or-tip/

Wharton GAIL, Technical Report: Playing Pretend, Expert Personas Don't Improve Factual Accuracy (7 December 2025): https://gail.wharton.upenn.edu/research-and-insights/playing-pretend-expert-personas/

Wharton GAIL, Technical Report: This is an Excellent Paper, The Effects of Prompt Injection on Grading (April 2026): https://gail.wharton.upenn.edu/research-and-insights/hidden-prompt-injections/

Sclar et al., Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design (arXiv 2310.11324): https://arxiv.org/abs/2310.11324

Capacity, Not Format: Rethinking Structured Reasoning Failures (arXiv 2606.09410, 8 June 2026): https://arxiv.org/html/2606.09410

Revisiting Chain-of-Thought Prompting: Zero-shot Can Be Stronger than Few-shot (arXiv 2506.14641): https://arxiv.org/abs/2506.14641

Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of LLMs (arXiv 2408.02442): https://arxiv.org/abs/2408.02442

Frequently Asked Questions

Does chain of thought prompting still improve accuracy in 2026?

Only on models that do not already reason internally. Wharton's Prompting Science Report 2, published 8 June 2025, tested GPQA Diamond and found step-by-step prompting gained 13.5 percentage points on Gemini 2.0 Flash and 11.7 on Sonnet 3.5, but only 2.9 on o3-mini, 3.1 on o4-mini and minus 3.3 on Gemini 2.5 Flash. The same requests took 35 to 600 percent longer on non-reasoning models and 20 to 80 percent longer on reasoning models. On a modern reasoning model, asking it to think step by step mostly buys latency.

Do expert persona prompts like 'you are a senior physicist' make answers more accurate?

No. Wharton's Prompting Science Report 4, published 7 December 2025, tested six models across 198 GPQA Diamond questions and 300 MMLU-Pro questions and found that domain-matched expert personas produced no reliable accuracy improvement, even when the expertise matched the question's subject. Low-knowledge personas made things worse, with a toddler persona producing a statistically significant negative effect on GPT-4o. Personas still shape tone, vocabulary and hedging, so they remain useful for voice. They do not add knowledge.

Does being polite or threatening a language model change the quality of its answers?

The evidence does not support either practice. Wharton's Report 3, published 1 August 2025, tested shutdown threats, a $1,000 tip, a $1 trillion tip and emotional appeals across 4,950 runs per model on GPQA Diamond and found only five statistically significant differences out of forty-five comparisons. On politeness the findings actively conflict: a 2024 cross-lingual study found impolite prompts often hurt, while an October 2025 study of 250 prompts on ChatGPT-4o found very rude phrasings scored 84.8 percent against 80.8 percent for very polite ones. Treat tone as noise and spend the effort on the output specification instead.

Read next

China's University Major Cuts Are AI Policy, and Nigeria Should Read the Fine Print

The latest analysis essay.

Keep reading

Working on something in this space?

If this analysis is close to a problem you're thinking about, say so. I read every message personally.

Start a conversation