Prompt engineering

Prompt engineering is the craft of writing instructions to a language model so it produces reliable, accurate, useful outputs.

Prompt engineering is what we used to call "writing a good question." It's the skill of phrasing inputs to a language model so its output is consistent, accurate, and shaped the way you need.

It's less mystical than it sounds. The reliable techniques are:

  • Be specific about role, audience, and output format. "Write me a tweet" beats "tweet about AI." "Write a 280-char tweet aimed at senior engineers explaining why CRDTs are interesting" beats both.
  • Show, don't tell. Few-shot examples (2-5 input/output demonstrations) reliably outperform abstract instructions for any task with a learnable pattern.
  • Decompose hard tasks. "Plan, then critique, then write" produces better results than a single "write" pass. Modern reasoning models (Claude with extended thinking, o1) do this internally.
  • Give the model an out. "If you don't know, say 'I don't know'" reduces hallucinations more than any other single instruction.
  • Pin the format. If you need JSON, give the schema. If you need a length, give a word count.

Prompt engineering matters more than people think. The same model, with two different prompts, can score 30% vs 90% on the same benchmark. Most production systems get more leverage from prompt iteration than from switching models.

It also matters less than it used to. Frontier models in 2024-2026 are increasingly forgiving — you can write "do the thing" and they'll often figure it out. The high-value skill is now prompt evaluation: knowing how to measure whether a prompt is actually better, not just feeling like it is.

FAQ

Is prompt engineering a real job?

The dedicated 'prompt engineer' role is fading because every product engineer now needs this skill. The deeper specialty is 'AI engineer' — someone who builds and evaluates LLM-based systems end-to-end, of which prompt design is one piece.

What's the single highest-leverage prompt technique?

Few-shot examples. Two well-chosen demonstrations of the input/output you want will outperform any amount of abstract instruction for almost any task with a pattern.

Related terms

Want to actually build with this?

Our Stack Builder picks the best AI tools for your specific project in under 60 seconds.

Build my stack →