Prompt Engineering Fundamentals
The basics carry across every model: be clear, give context, show examples, set constraints, and evaluate the output. Master these before any trick.
Every model has its own quirks, but the fundamentals of a good prompt do not change. Clarity, context, examples, constraints and evaluation will make your prompts better whether you are using Claude, GPT, Gemini or anything else. Learn these first; the model-specific tricks are easier once the foundation is solid.
Clarity beats cleverness
Say exactly what you want in plain language. Ambiguous prompts get ambiguous answers. If a human reader would have to ask a clarifying question, the model will guess, and it may guess wrong.
| Vague | Clear |
|---|---|
| Tell me about this code. | Explain what this function returns and list its side effects. |
| Write something for our launch. | Write a 50-word announcement for a developer audience. |
| Summarize this. | Summarize this in three bullet points, each under 15 words. |
Context is what the model cannot guess
The model does not know your situation, your audience or your constraints unless you tell it. Supply the background that a competent stranger would need. Who is this for, what already exists, what matters here.
Examples teach the shape
An example is worth a paragraph of instruction. Show one or two cases of the input and the output you want, and the model will infer the pattern, including the formatting details you did not spell out.
Classify the sentiment.
Input: "shipping was slow but the product is great"
Output: mixed
Input: "absolutely love it, works perfectly"
Output: positive
Input: "broke after one day"
Output:Constraints keep it on the rails
Tell the model what it may not do as clearly as what it should. Length limits, format requirements, banned phrases and scope boundaries all reduce the chance of an answer that is technically responsive but useless to you.
- Length: answer in under 100 words.
- Format: return a markdown table, nothing else.
- Scope: only use the information in the document above.
- Tone: plain and direct, no marketing language.
Evaluate, then refine
Prompting is iterative. Decide up front what a good answer looks like, run the prompt, and compare the output to that bar. When it falls short, change one thing and run it again. Over a few cycles you converge on a prompt that works reliably, not just once.
The five fundamentals
- Clarity: say precisely what you want.
- Context: supply what the model cannot infer.
- Examples: show the input and output shape.
- Constraints: bound length, format, scope and tone.
- Evaluation: define good, measure against it, refine.
A great prompt is mostly clear thinking written down. The model is only as good as the brief you hand it.
0 Comments
Loading discussion...