B5 · Generative AI and Conversational Assistants

What Is a Prompt?

A prompt is the input you give an AI model to get a response. Prompt engineering is the skill of writing and testing prompts so the model gives reliable, useful results.

6 min Beginner Jump to the activity

What you need: Nothing. This page starts from the beginning, with no programming and no formulas.

Definition

A prompt is the input you give an AI model to get a response. Prompt engineering is the skill of writing and testing prompts so the model gives reliable, useful results.

In simple words

Think of asking a new intern to do a task. "Write something about sales" gets you a mess. "Write a 5-line summary of this month's sales for the CEO, with the top risk first" gets you what you wanted. Models work the same way, because they can't read your mind.

Why it matters

It's the cheapest way to get more out of AI, and needs no coding. The same model can give a useless answer or an excellent one depending on the prompt. For developers, the prompt is part of the product, and needs testing like any other part of the software.

How it works

PartWhat it doesExample
TaskSays what to doSummarise this report
ContextGives backgroundIt's for our CEO, who has 2 minutes
InputThe material to work onThe report text
FormatThe shape of the answer5 bullets, top risk first
ExamplesShows what good looks likeOne sample input and output

Main techniques

  • Zero-shot: just ask, with no examples.
  • Few-shot: give two or three examples of what you want.
  • Ask for reasoning steps on maths or logic problems.
  • Give a role: "You are a careful reviewer".
  • Tell it what to do if unsure: "If the document doesn't say, reply NOT FOUND".
Weak promptBetter prompt
Tell me about diabetes.Explain type 2 diabetes to a 60-year-old with no medical background, in 5 short points in simple Hindi. Add a line saying a doctor should be consulted.

Try it yourself

Build a better prompt

Start with a plain request. Add parts one by one, and watch the reply change.

Vague or clear?

Would each prompt get you what you actually want? Remember, the model can't read your mind.

  • Write a 5-line summary of this month's sales for the CEO, with the top risk first.

  • Tell me about diabetes.

  • Explain type 2 diabetes to a 60-year-old in 5 short points, in simple Hindi.

  • Write something about sales.

  • Using only this report, list three dates. If a date isn't there, reply NOT FOUND.

  • Make this better.

The parts of a good prompt

Match each piece of a prompt to the part it plays.

  • "Summarise this report."
  • "It's for our CEO, who has 2 minutes."
  • "5 bullets, top risk first."
  • "Here is one sample input and output."

Common mistakes

  • Being vague and blaming the model.
  • Never testing the prompt on tricky inputs before relying on it.
  • Putting secrets into prompts for public tools.

Check yourself

Question 1

1. You give the model two examples of the output you want. This is:

Question 2

2. Which helps most to reduce made-up answers on a document?

Summary

  • A prompt is the input, and prompt engineering is writing it well and testing it.
  • Say the task, context, input and format, and give examples.
  • Tell the model what to do if it's unsure.

Finished reading?