Prompt Engineering

Why two people give the same model the same task and get completely different results: it's almost never the model, it's almost always the prompt.

What prompt engineering means

Two people ask the same model the same question and get two completely different answers. That's almost never down to how smart the model is, it's down to how the input is built. Prompt engineering is the systematic translation of an intention into an input the model can work with.

It has little to do with classic programming. It's about precise language. A large language model calculates which word is statistically most likely to follow the previous one, and the prompt is the starting push that steers this calculation in a direction. A question leaves the context open, a good prompt supplies it.

The three techniques that carry everyday use

Zero-shot prompting is the simplest form: a task without an example, like "Write a tweet about SEO". For simple tasks that's enough. With more complex ones, the model has to guess style and format, and that's exactly where it gets unreliable.

That's when few-shot prompting comes in. You add a few examples, say three tweets that worked, and ask for another one in the same style. The model spots the pattern and repeats it, instead of feeling its way along a description.

For tasks that need logical reasoning, chain-of-thought helps. With math problems, models like to guess a result straight away, which often goes wrong. If you force them to write out the intermediate steps, the error rate drops noticeably. Usually adding "Think step by step" is enough.

How a stable prompt is built

A good prompt looks a lot like a short briefing. Who should the AI be ("You're an experienced tax advisor")? What's it about? What exactly should happen ("Create an outline with five points")? What should the result look like, for example a Markdown table? And what should be left out, jargon for instance?

Models are surprisingly sensitive to the role you assign them. An "academic historian" draws on a different vocabulary than an ad copywriter, and with the vocabulary the structure of the arguments changes too. Without that assignment, the AI falls back into a generic tone.

Image AIs like Midjourney or Stable Diffusion work differently. Instead of full sentences, what counts there is a combination of subject, style and technical parameters, like "oil painting" or --ar 16:9. Terms from photography and art history like "bokeh" or "golden hour" get translated by the model directly into visual properties.

The most common mistakes

Vague instructions like "Make it shorter" are imprecise, "Cut the text to 100 words max" isn't. If you pack several complex tasks into a single prompt, you'll notice the model skipping instructions along the way, which is why a chain of shorter prompts is usually better. And because language models aren't databases, fact-checking stays mandatory.

On top of that, the best prompt is useless if the information it needs isn't in the context window at all. That's where context engineering starts: it decides which documents and which history get loaded in the first place. More detailed basics are in my tutorial on prompting basics.

Back to the AI and Automation Glossary.

FAQ

Is prompt engineering the same as programming?
No. There's no code and no syntax that gets checked. A prompt is an instruction in natural language, and the only logic behind it is how precisely it's worded. To prompt well you don't need a programming language, you need to think clearly and write clearly.
What's the difference between prompt engineering and context engineering?
Prompt engineering words the individual instruction: role, task, format. Context engineering decides what gets loaded into the context window in the first place, meaning which documents, which conversation history, which data. A perfect prompt doesn't get you far if the context around it is wrong or incomplete.
Do I need examples in the prompt for every task?
No. For simple, familiar tasks a clear instruction without an example is enough; that's called zero-shot prompting. Examples pay off as soon as you need a particular style, a fixed format or an unusual task, and that's what few-shot prompting is for.
Portrait of Eric Hinzpeter

Eric Hinzpeter

Eric Hinzpeter, Senior B2B Content Strategist. He builds AI agents and marketing automation for production use and writes up what comes out of it here.

About meLinkedIn (new tab)