Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction  ›  Lesson

What Is a Prompt?

What is a Prompt? 12 minA prompt is all the text the model receives before it answers, and it usually has an instruction, context, input data and an output format.

What Is a Prompt?

The shop owner's first attempt was one line: "What is this email about?" The model replied with a friendly paragraph summarising the email, which no program could file into a folder. Nothing was wrong with the model. The prompt simply did not say what was wanted.

The rule

A prompt is everything the model reads before it answers.

That includes the words you type, but also any hidden system instructions, earlier turns of the chat, pasted documents and examples. The model continues all of it. Most useful prompts contain four parts:

  • Instruction — the job: "Classify this email."
  • Context — background that shapes the job: who you are, what the labels mean.
  • Input data — the thing to work on: the customer's email.
  • Output format — exactly what the answer should look like.

Here is the Spoke & Chain triage prompt with all four:

You sort emails for Spoke & Chain, a bicycle shop.            <- context
Classify the email below into one category:                    <- instruction
repair, order, refund or other.
Reply with the category only, in lowercase.                    <- output format

<email>
Hi, I ordered a red helmet on Monday and it still hasn't come. <- input data
</email>

The expected answer is order. Notice the tags around the email. They mark where the data starts and stops, so the model does not confuse the customer's words with your instructions.

The shortcut

Before sending any prompt, run the four-part check: point at the instruction, the context, the input and the output format. If you cannot point at one of them, decide whether its absence is deliberate.

Repairing "What is this email about?"Step 1 of 4
  1. Instruction

    Vague. "What is it about" invites a summary. Replace with "Classify the email into one category."

The part people forget most often is the output format. Without it, the model picks a format that looks natural for a chat, which is usually a polite paragraph. Not every prompt needs all four parts — a quick question to a chat assistant may be instruction alone — but a prompt that a program depends on almost always needs every one.

Drills

Answer fast — trust the rule.

quick drill

Which of these is part of the prompt the model reads?

quick drill

In the triage prompt, what role does "Reply with the category only, in lowercase" play?

quick drill

Why wrap the customer's email in <email> tags?

quick drill

A prompt returns long friendly paragraphs when you need one word. Which part is most likely missing?

Remember

  • A prompt is everything the model reads before it answers.
  • Four-part check: instruction, context, input, output format.
  • Trap: forgetting the output format, then getting a chatty paragraph back.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainTake a prompt apart

Write a prompt that asks a model to sort one Spoke & Chain email into repair, order, refund or other. Label its instruction, context, input and output format, and say which part a vague prompt usually forgets.