Why does one prompt work better than another?
Weak: “Tell me about this.”
Clearer: “Summarize the following article in five bullet points for a first-year college student. Keep each bullet under 20 words.”
The second request is easier to follow because the task, audience, constraints, and desired shape of the answer are visible. Prompt engineering is the practice of making those instructions clear, testable, and appropriate for the job.
A practical four-part prompt
Prompt anatomy
TASK
Summarize the article below.
CONTEXT
<article>
...article text...
</article>
CONSTRAINTS
- Audience: first-year college student
- Exactly 5 bullets
- Each bullet under 20 words
OUTPUT CONTRACT
Return JSON: { "bullets": ["..."] }Read this prompt as an application contract: the task says what to do, the context supplies relevant information, the constraints limit acceptable behavior, and the output contract makes the result easier to check. None of those instructions substitutes for checking the result.
Zero-shot, one-shot, and few-shot examples
Zero-shot means giving the instruction without examples. One-shot gives one example of the desired input/output pattern. Few-shot gives a small set of examples.
Structured output gives shape — not truth
If software needs a list of objects such as {name, due_date}, define a schema and validate the output. A parser can prove that required fields and types are present. It cannot prove that a date is factually correct, authorized, or acceptable under business rules.
Generate
Ask for the defined structure.
Parse
Reject malformed syntax or invalid types.
Validate semantics
Check allowed values, business rules, permissions, and evidence.
Handle failure
Repair, ask for clarification, retry safely, or escalate according to policy.
Tool or function calling is a proposal, not permission
An LLM can propose a tool name and arguments, but application code should validate them before execution. If the model proposes get_weather(city="Pune", unit="Kelvin") and the schema allows only C or F, the application should reject or repair the arguments according to its policy.
The model proposes; trusted application code validates and executes
Debug prompts like software requirements
If two instructions conflict—such as “return only JSON” and “explain your reasoning in a paragraph”—first remove or reconcile the conflict and retest the same cases. Adding unrelated examples or immediately fine-tuning the model hides the real problem.
A good prompt can improve how clearly the model understands the task. It cannot magically give the model a current private policy, a missing database record, or guaranteed facts.
Why the next lesson matters
Prompting changes the request but not the model's learned parameters. How were those parameters learned in the first place?
Pretraining & Fine-Tuning →Summary / Key Takeaways
- A useful prompt makes the task, context, constraints, and output contract explicit.
- Examples can clarify a desired pattern, but they must not conflict with the written instructions.
- Structured output makes the shape predictable; separate semantic and business validation is still required.
- Tool calls are model proposals that application code must validate and authorize.
- Prompt debugging should remove ambiguity and conflicting constraints before changing unrelated components.
- Prompting changes the input to a trained model; it does not retrain the model or automatically provide missing knowledge.