Prompt engineering is the skill of phrasing your request so the model reliably does what you want. The same model can give a vague, useless answer or a precise, production-ready one depending entirely on the prompt. These techniques are model-agnostic — they work across every major LLM.
Why prompting matters
The model has no idea what "good" means for your task unless you tell it. Ambiguity in, ambiguity out. The fix is almost always the same: add specificity, context, constraints and — when you can — an example.
Be specific
Replace vague asks with concrete instructions: the audience, the length, the tone, the constraints.
✗ "Write about our data course."✓ "Write a 3-sentence course blurb for a data-analyticsprogramme, aimed at career-changers with no codingbackground. Confident but not hype-y. No exclamation marks."
Roles & examples
A system prompt sets the model's role and rules for the whole conversation. And a handful of examples ("few-shot") teaches the model the exact pattern you want far better than description alone:
Classify each review as POSITIVE or NEGATIVE.Review: "Loved the mentors, landed a job." → POSITIVEReview: "Content was outdated and slow." → NEGATIVEReview: "The projects were genuinely useful." →
Control the format
Ask for the exact output shape — especially when a program will consume it. Requesting JSON gives you machine-readable results:
Extract the details as JSON with keys "name", "skill", "years".Return only the JSON, no prose.Text: "Aanya has 4 years of SQL experience."
Chain-of-thought
For reasoning tasks (maths, logic, multi-step decisions), asking the model to "think step by step" before answering measurably improves accuracy — it works through the problem instead of guessing the final answer:
A batch has 24 students; 3 out of 8 dropped out.Work through it step by step, then give the final number who remain.
Practice
Take a weak prompt and improve it three ways: add a role/system instruction, add two examples, and specify the output format as JSON. Run the before and after and compare how much more usable the output becomes.
Key takeaways
- 01Prompt engineering is phrasing requests so the model reliably delivers — model-agnostic.
- 02Be specific: state audience, length, tone and constraints; ambiguity in, ambiguity out.
- 03Use a system prompt for role/rules and few-shot examples to lock in a pattern.
- 04Ask for the exact output format (e.g. "return only JSON") when code will consume it.
- 05For reasoning tasks, "think step by step" (chain-of-thought) improves accuracy.
