Basic

Writing clear prompts

A good prompt is a small contract. Give the model a role, a task, some context, and the shape you want the reply in, and the answers get much more reliable.

About 2 min of reading

Data Flow

A prompt combines role, task, context, and format; the model uses all of them to shape its reply.
1 Set a role for the model
↓
2 State the task clearly
↓
3 Add the context it needs
↓
4 Ask for a specific format
Why this works
The four parts of a good prompt

Most good prompts have four pieces:

  1. **Role*: who the model should be.
  2. **Task*: what to do.
  3. **Context*: the details.
  4. **Format*: how to respond.

Role:    "You are a cooking expert."
Task:    "Give me a dinner recipe."
Context: "I have chicken, rice, and 30 minutes."
Format:  "A short ingredient list, then steps."

Stacking these turns a random answer into a reliable one.

Being explicit

Spell out what you don't want too:

"Summarize this. No jargon. 3 sentences."

Negative instructions ("no jargon") work better when paired with what to do instead. Never rely on a single word; explain it in a short clause.

Say what you want, and say what you don't.

Examples

Vague vs specific

Vague:     "Write something about dogs."
Specific:  "Write a 100-word blog intro about training
           a puppy, in a friendly tone."

The specific prompt gives a topic, a length, and a tone.

Why it works: the model can't read your mind; it only has your words.

Giving context

"Explain gravity."                 -> too broad
"Explain gravity to a 10-year-old." -> clear

Adding an audience or purpose focuses the answer.

Context is the steering wheel of a prompt.

Adding the format

Give me a shopping list for a dinner party of six, as bullet points.

Telling the model the format stops a wall of text when you wanted a list.

Why it works: a clear shape is easier to obey than a vague wish.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

Next Lesson
Few-shot examples
Few-shot examples →