Prompt engineering, defined honestly
Prompt engineering is the discipline of writing inputs to large language models that reliably produce the outputs you want. It is less about clever wording and more about specification — telling a model exactly what task to do, in what shape, with which constraints.
If you can write a clear specification, you can prompt.
The six moves that matter
1. Role
Tell the model what role it should adopt. "You are a technical editor" primes a very different distribution of language than "You are a marketing copywriter".
2. Task
State the task precisely. "Summarise" is vague. "Summarise in three bullet points, each under fifteen words, focused on the risks" is a specification.
3. Context
Give the model the raw material it needs. Paste the document, the data, the policy. Do not assume the model knows anything specific about your company.
4. Format
Ask for exactly the output shape you want. JSON with named keys. A table with three columns. A numbered list. Formats prevent ambiguity.
5. Examples
One or two well-chosen examples change the game. This is called few-shot prompting and it is the single highest-leverage technique in practical prompting.
6. Constraints
Say what NOT to do. "Do not invent numbers". "Do not use marketing language". Negative constraints are as important as positive instructions.
Chain-of-thought, without the hype
Asking the model to reason step by step often improves quality on complex tasks. But it is not free — it increases cost and latency. Use it where the task genuinely benefits, not by default.
Retrieval, tools and structured output
Modern prompting rarely stops at "one prompt in, one answer out". You will combine:
- Retrieval: fetch relevant documents at query time and inject them into the prompt.
- Tools: let the model call functions to look things up or take actions.
- Structured output: constrain the response to a schema so downstream code can trust it.
These three moves turn a chatbot into a system.
What actually goes wrong
- Vague instructions → vague answers.
- Long, tangled prompts → the model drops instructions at the bottom.
- No examples → inconsistent formatting.
- No evaluation → you never know if a change made things better.
The last one is the killer. Build a small evaluation set before you tune prompts. Anything else is superstition.
