Prompting
Prompt Engineering
Also known as: prompt design
The craft of writing and refining the instructions you give an AI model so it produces better, more reliable results.
Prompt engineering is simply the skill of asking an AI in the right way. The same question, worded clearly and with enough context, can turn a vague, useless answer into an excellent one. Imagine briefing a very capable but very literal assistant: if you say what you want, who it is for, and what a good result looks like, you get far better work than if you just say "write something about this".
A prompt is the input you give a language model; prompt engineering is the practice of shaping that input on purpose. Because the model has no goals of its own and only responds to what you provide, small changes in wording, order and context can noticeably change the output.
Techniques that reliably help
- Be specific: state the task, the audience, the tone and the desired length or format.
- Give context: paste the relevant facts or documents instead of assuming the model knows your situation.
- Show examples (few-shot): one or two worked examples of input-and-ideal-output steer the style and structure.
- Ask for reasoning: for harder problems, "think step by step" often improves accuracy.
- Constrain the output: ask for a table, JSON, or a fixed number of bullet points when you need structure.
It is iterative
Good prompting is rarely one-shot. You write, look at what comes back, and refine, much like editing. Clear prompts also reduce hallucinations, because you leave the model less room to invent.
Prompt engineering exploits in-context learning: the ability of a pretrained LLM to adapt to a task from information in the prompt alone, without weight updates (Brown et al. 2020). The main levers are the instruction (zero-shot), demonstrations (few-shot), the system versus user role split, and the ordering and framing of context within the context window.
For reasoning-heavy tasks, chain-of-thought prompting, eliciting intermediate steps, measurably improves performance on arithmetic and multi-step problems (Wei et al. 2022), and has spawned variants such as self-consistency and least-to-most prompting. Practical work also spans structured-output enforcement (schemas, function signatures), decoding control such as temperature, and grounding via retrieval or tools. As models improve at instruction-following, the field is shifting from clever phrasing tricks toward clear specification, context engineering, and evaluation, deciding what to put in the window and how to measure whether the output is right.