AI Hints
Home›Generative AI Tutorial›The Art of Prompting
Generative AI · Lesson 22 of 77

Prompting Basics

The skill of talking to AI.

⏱ 2 min read▶ Video at 52:40🎓 Free
Watch this lesson in the Generative AI courseWatch on YouTube ↗Full Generative AI course

A prompt is simply the message you give to an A I. And the quality of that message, decides the quality of the answer. The good news is that prompting is a skill anyone can learn in an afternoon. In this lesson, you will learn a simple recipe that works almost every time.

Prompting Basics
From the video: Prompting Basics
  • A prompt is your message to the AI
  • Better prompts, better answers
  • A simple recipe anyone can learn

A weak prompt versus a strong prompt

Look at the difference. A weak prompt says, write about dogs. The answer is vague, generic, and not very useful, because the model has to guess what you want. A strong prompt says, write a friendly two paragraph blog intro, for new dog owners, about house training puppies, in a warm tone. Now the model knows the topic, the audience, the length, and the style. The answer is far more useful. The model can only be as precise as you are.

Prompt comparison
YouWrite about dogs.
AIDogs are wonderful animals. They are loyal, friendly, and come in many breeds and sizes.
YouWrite a friendly two-paragraph blog intro for new dog owners about house training puppies, in a warm tone.
AIBringing home a new puppy is pure joy, until the first puddle appears on the kitchen floor. Don't worry, every dog owner has been there, and house training is easier than it looks.

The four-part recipe

Here is the recipe. Four parts. First, the role. Tell the model who to be, for example, you are an experienced travel planner. Second, the task. Say clearly what you want done. Third, the context. Give the background it needs, like who the audience is, and what you already know. Fourth, the format. Say how the answer should look, a short list, a table, or three sentences. Role, task, context, format.

  1. Rolewho the AI should act as
  2. Taskexactly what you want done
  3. Contextbackground, audience, constraints
  4. Formathow the answer should look

Prompt in action: a travel plan

Let's apply the recipe. Role, you are an experienced travel planner. Task, plan a three day trip to Lisbon. Context, I love food and history, I dislike crowds, and my budget is moderate. Format, a day by day list, with one morning, one afternoon, and one evening activity. Compare that to, plan a trip to Lisbon. The first prompt gets a plan you can actually use.

Rolean experienced travel planner
Taskplan a three-day trip to Lisbon
Contextfood, history, no crowds, moderate budget
Formatday by day, morning, afternoon, evening

Five habits of great prompters

Five habits will take you far. Be specific, vague questions get vague answers. Give examples of what you want. Break big jobs into smaller steps. Say what to avoid, as well as what to include. And iterate. Your first prompt is a draft. Read the answer, then refine, make it shorter, make it friendlier, add numbers. A conversation with an A I is not a single shot, it is a back and forth.

Be specificdetails beat vague requests
Give examplesshow the style you want
Break big jobs downone step at a time
Say what to avoidlimits improve results
Iteraterefine like a conversation

Summary

Good. A prompt is your message, and its quality shapes the answer. Use the four part recipe, role, task, context, and format. Be specific, give examples, break jobs down, and iterate. Next, we learn the powerful techniques that professionals use, like few shot prompting, and chain of thought.

Key takeaways
  • Role + Task + Context + Format
  • Be specific, give examples
  • Iterate: the first prompt is a draft
Next up: Prompting Techniques — few-shot, chain of thought and more