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
- LLM (Large Language Model) — A Large Language Model is a neural network trained on huge volumes of text to predict the next token, which produces emergent capabilities like reasoning, code generation, and translation.
- Few-shot learning — Few-shot learning is the technique of including 2-10 worked examples in the prompt to teach an LLM a new task without any retraining.
- System prompt — The system prompt is the high-level instruction at the start of an LLM conversation that defines the model's role, tone, constraints, and tools.
- Chain-of-thought (CoT) — Chain-of-thought prompting asks a model to reason step-by-step before producing its final answer, which substantially improves accuracy on hard problems.
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 →