What Is a Prompt and How Do You Write Effective Prompts?
Updated
A prompt is the text you give an AI model to tell it what you want — a question, instruction, or piece of context that steers the model's output. Writing effective prompts means being specific about the task, supplying relevant context, and stating the format you expect. The method below works for chat assistants and text-generation models generally; exact behavior varies by model and version, so treat any single result as a sample, not a guarantee.
Prompt vs. prompt engineering
These two terms get used interchangeably, but they describe different things.
| Term | What it refers to | Example |
|---|---|---|
| Prompt | The input itself — whatever you type or send to the model | "Summarize this article in three bullets." |
| Prompt engineering | The practice of designing and iterating on prompts to get more reliable results | Rewriting that instruction to specify audience, length, and what to exclude |
A prompt can be one word ("Continue") or several paragraphs. Prompt engineering is the deliberate work of choosing those words, testing variations, and refining based on what comes back.
Why the wording matters
A model generates output by predicting what text plausibly follows your input. That means your prompt acts as a constraint: the more precisely it narrows the space of acceptable answers, the closer the output tends to land to what you intended.
Consider the difference:
- Vague: "Write about climate change."
- Specific: "Write a 150-word explainer on how rising sea levels affect coastal cities, aimed at a general audience with no science background. Use plain language and avoid statistics."
The first prompt leaves topic, length, audience, tone, and format open, so the model guesses. The second removes most of that ambiguity. Neither guarantees a perfect answer, but the second gives you something you can actually evaluate and correct.
Core elements of an effective prompt
Most well-performing prompts combine some subset of these:
- Task — the action you want: summarize, translate, classify, draft, compare, extract.
- Context — background the model needs: who the audience is, what the source material says, what problem you're solving.
- Constraints — length, tone, reading level, things to include or avoid.
- Format — bullets, table, JSON, numbered steps, a single paragraph.
- Examples — one or two samples of the input/output pattern you want, when the task is easier to show than describe.
You don't need all five every time. A quick factual question needs almost none. A structured extraction task usually needs task, format, and an example.
A worked example
Suppose you want help turning meeting notes into action items.
First attempt:
"Turn these notes into action items."
Problem: The model doesn't know how many items you expect, who owns each one, or what format your team uses.
Revised prompt:
"From the meeting notes below, extract every action item. For each, give: the task, the owner's name if mentioned, and a due date if mentioned. Output as a markdown table with columns Task | Owner | Due. If an owner or date isn't stated, write 'unassigned' or 'no date'. Notes: [paste notes]"
The revision names the task, the fields, the format, and how to handle missing information. That last part matters — without it, models often invent plausible-looking owners or dates to fill gaps.
Common reasons prompts fail
- The instruction is ambiguous. "Make it better" gives the model no target. Better than what, for whom, in what way?
- The task is too broad. "Write my business plan" asks for something too large to be useful in one pass. Break it into sections.
- No examples for a pattern-matching task. If you want a specific style or structure, showing one example usually beats describing it.
- Missing format instructions. If you need to paste the output into a spreadsheet, say so and specify the columns.
- Assuming the model knows your context. It doesn't know your project, your team, or your prior conversation unless you include it or it's in the same session.
- Treating one output as final. Prompting is iterative. Read the result, identify what's off, and adjust the prompt rather than accepting or discarding it wholesale.
How to improve a prompt you already have
- State the task as a verb. Replace "something about X" with "list," "compare," "rewrite," "classify."
- Add the missing context. Paste the source text, name the audience, describe the situation.
- Set at least one constraint. Length, tone, or format — pick the one that matters most.
- Add an example if the pattern is hard to describe. One input/output pair is often enough.
- Run it and compare. Keep the original output and the new output side by side. Note what changed.
- Adjust one thing at a time. If you change five elements at once, you won't know which one helped.
Where to learn more
Learn Prompting describes itself as a prompt engineering course with over 60 content modules, translated into 9 languages, and a community of more than 3 million learners. Its materials cover introductory prompting through applied topics, and the site lists a free 7-day "Learn Prompt Hacking in 7 Days" email course covering LLM security fundamentals, plus an AI Red-Teaming & AI Security Masterclass. The site also has a pricing page, so some offerings may be paid — check the current terms there rather than assuming everything is free.
For practice, the fastest path is to take a task you already do — summarizing emails, drafting replies, extracting data from text — and rewrite your prompt using the elements above. The improvement is usually visible within two or three iterations.