Skip to content
Go back

How to Write Effective AI Prompts (a Beginner's Guide)

Updated:
Illustration of a command line powering an AI spark

In two years “prompt engineering” has become a content genre full of magic formulas: lists of 500 prompts, incantations to copy, the promise that one secret sentence changes everything. Almost none of it has been verified.

Some techniques, though, have been measured in published studies. Others, including the most popular one, have been measured and failed. This guide separates the two and rebuilds the method on what holds up.

The right mental model

A language model doesn’t “understand” your request: it predicts the most likely continuation of the text you gave it. That isn’t an academic quibble, it has an immediate operational consequence:

A prompt isn’t a command, it’s a specification. Everything you don’t specify gets filled in with the statistically most common choice, which is almost never yours.

If you don’t state the length, you get the average length for that kind of text. If you don’t state the reader, you get a generic reader. If you don’t state what to exclude, you get everything. Most disappointing answers aren’t a model error: they’re a gap in the spec.

What works, according to the studies

Three techniques have serious experimental backing. Worth knowing them for what they are, without overstating them.

Examples (few-shot). The work that made this mainstream is Language Models are Few-Shot Learners (Brown et al., 2020): showing a few examples of desired input and output inside the prompt noticeably improves adherence to the requested format. In practice it’s the technique with the best effort-to-result ratio: two examples of your typical output are worth more than ten lines of instructions describing it.

Chain-of-thought. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models (Wei et al., NeurIPS 2022) shows that asking for intermediate steps improves accuracy on tasks requiring several steps, such as arithmetic, logical reasoning and multi-part problems. A follow-up, Large Language Models are Zero-Shot Reasoners (Kojima et al., 2022), showed that even a simple instruction to work through it step by step produces part of the effect.

An honest and usually omitted caveat: the benefit concerns multi-step tasks. On a request to rewrite an email, asking it to reason step by step achieves nothing except giving you more to read.

Explicit structure. Separating instructions, context and input material with clear delimiters reduces ambiguity. It’s the constant recommendation in provider documentation, from both OpenAI and Anthropic, and it costs ten seconds.

Here’s the point almost no guide reports, because it contradicts everyone else’s number-one tip.

“Act as an expert in…” is by far the most widespread formula. But when it was tested systematically, the effect on accuracy didn’t show up. The reference work is When “A Helpful Assistant” Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models (Zheng et al., 2024): dozens of different personas in system prompts, tested across a broad set of questions, with no systematic improvement over using none at all.

How to read that, without throwing out the baby with the bathwater:

So: use it as a stylistic instruction, not as a shortcut to expertise. The difference is the whole point.

The six-part structure

Not an incantation: a list of things that, if you omit them, get decided for you. You don’t need all six every time.

PartQuestion it answersExample
TaskWhat to do, with a precise verb”Rewrite”, “Summarise”, “Compare”
ContextFor whom and in what situation”For a client who’s already had two reminders”
MaterialWhat text to work onThe document, clearly delimited
FormatHow the output should look”Three-column table”, “150 words max”
ConstraintsWhat to avoid”No bullet points, no superlatives”
ExampleWhat a good output looks likeA previous output you liked

A concrete comparison on the same goal.

❌ “Write an email to a client who hasn’t paid.”

✅ “Rewrite this payment reminder. Recipient: long-standing client, second invoice 20 days overdue, relationship I want to keep. Maximum 120 words, firm but not threatening, closing with a concrete proposed date. No boilerplate like ‘as previously agreed’. Current text: […]”

The second request takes longer to write and saves you three rounds of corrections. That’s the only calculation that matters.

The technical limit that explains half the failures

If you paste long documents in, this concerns you.

The study Lost in the Middle: How Language Models Use Long Contexts (Liu et al., Transactions of the ACL, 2024) documents a systematic effect: performance is better when the relevant information sits at the beginning or the end of the context, and degrades when it sits in the middle. The curve is U-shaped.

Three practical consequences, worth more than any formula:

  1. Put the instruction at the start and repeat it at the end when the material is long. That isn’t pointless redundancy: it’s placing the request where it actually gets used.
  2. Cut the material instead of padding it. “I’ll give it everything so it has context” is the wrong instinct: more irrelevant material dilutes the relevant part.
  3. Break long tasks up. Two prompts on half a document each almost always beat one prompt on the whole thing.

The loop that beats any single prompt

In real use the first prompt is almost never the good one, and that’s fine: the value is in the second pass.

1. Ask what’s missing before asking for output. “Before writing, list the three pieces of information you need that I haven’t given you.” It flips the burden: you fill the gaps instead of letting them be filled at random.

2. Correct by naming the difference, not the adjective. “Too formal” is useless. “Replace bureaucratic phrasing with the spoken equivalent, keep the formal address” is actionable.

3. Have the result criticised before you send it. “List the three weakest points in this text for a sceptical reader.” Often the highest-return step of the whole session.

4. Save what works. A file with ten of your own prompts, tested on your own work, is worth more than any 500-prompt collection found online, because it contains your context: the one part nobody can write for you.

The mistakes that cost most

Asking for two things at once. “Analyse and rewrite” produces a shallow analysis and a mediocre rewrite. Separate them.

Accepting the first answer. It’s the most likely version, not the best one. Asking for a second version under a different constraint costs ten seconds.

Saying what you don’t want without saying what you do. “Don’t be generic” contains no usable information. “Cite two numbers taken from the text I gave you” does.

Trusting the facts. Worth repeating because it’s the mistake that really costs: on rules, figures, dates and citations, the output has to be checked against the source. The structural reason is explained in how to use ChatGPT at work.

My take: one example beats a pile of instructions

The technique I’d recommend first isn’t any of the ones with a paper behind them. It’s giving an example of the result you want, a text you wrote and like, and asking it to work in that register.

It makes sense theoretically too: it’s the few-shot idea applied to you, and it solves the problem no stylistic instruction really solves, namely describing in words how you write. It hasn’t been measured in a controlled way, so it remains practical advice, not data.

Frequently asked questions

Do prompts work the same across models? No, and it’s unwise to build rigid habits on it. The general principles (specification, examples, format) hold everywhere; formatting details change between providers and versions. The official documentation from OpenAI and Anthropic is the only source that stays current.

Better in English or in my own language? On current models the difference for ordinary use is small. If the final text has to be in a given language, write the prompt in that language: you avoid imported syntax you’d then have to fix by hand.

Is there one prompt that solves everything? No, and collections promising it are the most reliable signal that the author doesn’t use the tool. A prompt is only as useful as the context it carries, and the context is yours.

Do I need to know how to code? No. You need to know how to write a clear specification, which is a communication skill: the same one that makes a brief to a colleague useful. Not coincidentally it appears among the most in-demand skills.

Do I have to declare AI use? It depends on the context: in academia and in many newsrooms it’s the rule. EU Regulation 2024/1689 also introduces AI-literacy obligations for organisations deploying these systems at work. We declare our own use on the how we write page.

Sources

Founder of UpSkillLab, with a Master's in Digital Marketing from the University of Florence. Every article starts from public sources cited in the text and is drafted with the help of AI tools, under my review and editorial responsibility: no purchased content, nothing published without human checking. Read the editorial method or report an error.


Share this post:

See all articles in AI at Work

Previous Post
LinkedIn: How to Optimize Your Profile to Get Found
Next Post
Impostor syndrome: why it hits competent people and how to get past it