Module 4 · Putting LLMs to Work — Prompting, RAG & Agents
Prompting Fundamentals: Getting What You Asked For
60 min
Learning objectives
- Write clear, specific prompts that reduce ambiguity for the model
- Apply few-shot examples and supplied context to steer output format and style
- Recognize and avoid the most common prompting mistakes
A prompt is an instruction, not a search query
A prompt is the text you give a language model to specify what you want. Unlike a search box, the model does not just look something up — it generates a response token by token based on your instructions and any context you provide. The clearer and more specific your instructions, the more reliably you get useful output.
Prompt — The text instruction and supplied context given to a language model to specify the desired task.
Analogy
Think of prompting like briefing a brand-new contractor who is fast and capable but knows nothing about your situation. Say 'fix the report' and you'll get something generic. Say 'shorten this report to one page for a finance audience, keep the three key numbers, drop the background' and you get what you actually need.
Be specific: role, task, format, constraints
Strong prompts usually state who the model should act as, what task to perform, what format the answer should take, and any constraints. Vague prompts force the model to guess, and it guesses toward the average of its training data.
Example — Vague vs. specific
The specific version controls audience, length, and format — so the output is predictable and usable.
Vague:
Summarize this.
Specific:
You are a support analyst. Summarize the customer email below
in 3 bullet points: (1) the core problem, (2) what they already tried,
(3) what they are asking us to do. Keep each bullet under 15 words.Show, don't just tell: few-shot examples
When format or style matters, giving the model a couple of worked examples is often more effective than describing the rules. This is called few-shot prompting: the model infers the pattern from your examples and continues it.
Few-shot prompting — Including a few input→output examples in the prompt so the model imitates the demonstrated pattern.
Example — Few-shot for consistent labeling
Two examples set the label vocabulary and format; the model then classifies the third the same way.
Classify each message as BILLING, TECH, or OTHER.
Message: "My card was charged twice." -> BILLING
Message: "The app crashes on login." -> TECH
Message: "Do you ship to Canada?" -> Order of leverage when output is wrong: (1) add specificity, (2) add examples, (3) add context the model is missing. Reach for a bigger or different model last.
Common mistakes
- Asking for too many things in one prompt — split complex tasks into steps.
- Assuming the model knows your private context (today's date, your data, internal terms) — it doesn't unless you supply it.
- Treating fluent output as correct — confident wording is not evidence of accuracy.
- Negative-only instructions ('don't be formal') without saying what you do want.
Watch out
Language models can produce fluent, confident text that is simply wrong — a behavior often called hallucination. A well-crafted prompt reduces this but never eliminates it. Always verify facts that matter.
Knowledge check
Quick practice — not part of your exam score.
Which change is most likely to improve an unreliable, generic response from an LLM?
A team needs the model to label tickets using a fixed set of categories in a consistent format. Which technique most directly achieves this?
Why is it risky to assume an LLM already knows your company's internal terms and today's data?
Sign in to track your progress and mark lessons complete.
Sign in