Module One: Introduction to Prompt Engineering β Talking to AI
Module Introduction
Hello, future prompt engineer! π€ Have you ever talked to a computer and gotten a strange answer? Or asked a question and got something completely different? That's because computers, especially AI, need to be asked in a special way. This is called prompt engineering β it's the skill of asking AI the right questions to get the best answers. In this module, we will learn what prompt engineering is, why it matters, and how to start talking to AI like a pro. Let's begin!
Learning Objectives
By the end of this module, you will be able to:
- Explain what prompt engineering is.
- Understand why AI needs good prompts.
- Identify the parts of a prompt.
- Write a simple prompt.
- Understand how AI works in simple terms.
Warm-up Story: The Magic Genie
Imagine you found a magic genie in a lamp. The genie can grant any wish, but you have to be very careful with your words. If you say, "I want a million," the genie might give you a million grains of sand! If you say, "I want a million naira in my bank account by tomorrow," you get exactly what you want. AI is like that genie. You need to ask clearly and specifically to get what you want. Prompt engineering is learning how to talk to the genie β to get the best results.
Main Lessons
Lesson 1: What is Prompt Engineering?
Definition: Prompt engineering is the art and science of designing inputs (prompts) to get the best possible outputs from AI language models.
Why it is important: It helps you communicate effectively with AI and get useful, accurate answers.
Simple explanation: It's like learning the right way to ask a question so you get the answer you want.
Real-life example: A teacher gives clear instructions so students understand the assignment.
School example: You ask, "What is the capital of Nigeria?" instead of "Tell me about Nigeria."
Home example: You ask, "Can you help me set the table?" instead of "Do something."
Nigerian example: A Nigerian student asks ChatGPT for a list of Jollof rice ingredients.
Illustration:
Prompt = Question or instruction you give to AI
Engineering = Crafting it carefully for the best answer
Mini summary: Prompt engineering is asking AI the right way to get the best answer.
Lesson 2: Why Does AI Need Good Prompts?
Definition: AI models are powerful but they don't know what you want unless you tell them clearly. Good prompts give them the direction they need.
Why it is important: A bad prompt gives a bad answer. A good prompt gives a great answer.
Simple explanation: It's like giving directions β you need to be clear or the person will get lost.
Real-life example: If you ask, "Where is the bank?" the person might not know which bank you mean.
School example: "Tell me about plants" vs. "Tell me about how plants use sunlight to grow."
Home example: "Clean your room" vs. "Please put your books on the shelf and your clothes in the drawer."
Nigerian example: "Tell me about Lagos" vs. "What are the best places to visit in Lagos?"
Illustration:
Vague Prompt: "Tell me about food."
Clear Prompt: "List 5 Nigerian breakfast dishes with their ingredients."
Mini summary: AI needs clear prompts to give you the best answers.
Lesson 3: How AI Works β A Simple Explanation
Definition: AI language models are trained on huge amounts of text. They learn patterns and can predict what words should come next.
Why it is important: Understanding this helps you know why prompts matter.
Simple explanation: It's like a student who has read thousands of books β they can answer questions based on what they have learned.
Real-life example: A chatbot uses patterns from its training to generate responses.
School example: You answer a teacher's question based on what you studied.
Home example: A child answers a parent's question based on what they know.
Nigerian example: A Nigerian student uses knowledge from textbooks to answer exam questions.
Illustration:
AI = Learns from books and text β Uses that knowledge to answer questions
Mini summary: AI learns from text and uses that knowledge to answer your prompts.
Lesson 4: The Parts of a Prompt
Definition: A prompt has three main parts: instruction, context, and input.
Why it is important: Each part helps the AI understand what you want.
Simple explanation: It's like a recipe β you need ingredients (input), steps (instruction), and sometimes a story (context).
Real-life example: "Write a poem (instruction) about Lagos (input) in the style of Niyi Osundare (context)."
School example: "Summarise (instruction) this chapter (input) in 3 sentences (context)."
Home example: "Cook (instruction) rice (input) using the recipe on the packet (context)."
Nigerian example: "Write (instruction) a story (input) about a Nigerian family (context)."
Illustration:
Prompt = Instruction + Context + Input
Mini summary: A prompt has instruction, context, and input.
Lesson 5: Instruction β What Do You Want?
Definition: The instruction tells the AI what to do β like "write," "summarise," "explain," or "list."
Why it is important: Without an instruction, the AI doesn't know what to do.
Simple explanation: It's like telling someone, "Please help me" β they need to know what help you need.
Real-life example: "Write a recipe for Jollof rice."
School example: "Explain the water cycle."
Home example: "List the chores you did today."
Nigerian example: "Describe the best places to eat in Lagos."
Illustration:
Instruction = What you want the AI to do
Mini summary: The instruction tells AI what action to take.
Lesson 6: Context β The Background Information
Definition: Context is extra information that helps the AI understand the situation or tone.
Why it is important: It guides the AI to give the right kind of answer.
Simple explanation: It's like telling a story β you give background so the listener understands.
Real-life example: "Write a poem about Lagos. Make it sound like a love letter to the city."
School example: "Summarise this chapter for a younger student."
Home example: "Write a shopping list for a family of four."
Nigerian example: "Write a tweet about Nigeria's Independence Day, using a cheerful tone."
Illustration:
Context = Extra info to guide the AI
Mini summary: Context helps the AI understand the tone and situation.
Lesson 7: Input β The Information You Give
Definition: Input is the specific data or question you provide to the AI.
Why it is important: The AI needs something to work with.
Simple explanation: It's like giving someone the ingredients to cook a meal.
Real-life example: "Write a story about a boy who finds a magic coin."
School example: "Explain the water cycle using these keywords: evaporation, condensation."
Home example: "Plan a dinner menu using chicken, rice, and vegetables."
Nigerian example: "Write a poem about Abuja using the words: hills, city, peace."
Illustration:
Input = The information you give to the AI
Mini summary: Input is the data or question you give to the AI.
Lesson 8: Examples β Showing AI What You Want
Definition: Giving examples in your prompt helps the AI understand the format and style you want.
Why it is important: It's like showing a picture to a painter β they know exactly what to create.
Simple explanation: It's like saying, "I want something like this."
Real-life example: "Write a haiku about rain. Example: 'Rain falls on the roof, washing the dusty streets clean, nature's gentle gift.'"
School example: "Write a summary of this chapter. Example: 'The chapter explains how plants make food using sunlight.'"
Home example: "Make a to-do list. Example: '1. Buy milk. 2. Clean the kitchen.'"
Nigerian example: "Write a tweet about Lagos. Example: 'Lagos is the city that never sleeps β always buzzing with energy and life!'"
Illustration:
Examples = Show AI the style or format you want
Mini summary: Examples help AI understand the style and format you expect.
Lesson 9: Nigerian Prompt Examples
Definition: Nigerian users can craft prompts that reflect local culture, language, and context.
Why it is important: It makes AI responses more relevant and useful for Nigerians.
Simple explanation: It's like telling AI about your culture so it gives better answers.
Real-life example: "Write a story set in Lagos about a girl who starts a small business."
School example: "Explain the importance of the Niger River using simple examples."
Home example: "Write a prayer in Nigerian Pidgin."
Nigerian example: "Create a menu for a Nigerian wedding reception."
Illustration:
Nigerian Prompts = Local culture + Language + Context
Mini summary: Using Nigerian context makes prompts more relevant.
Lesson 10: Fun Prompt Examples for Kids
Definition: Kids can learn prompt engineering through fun, creative prompts.
Why it is important: It makes learning enjoyable and shows how prompts can be playful.
Simple explanation: It's like playing a game of "ask the robot."
Real-life example: "Write a story about a talking cat."
School example: "Create a superhero with the power to control weather."
Home example: "Invent a new dessert using chocolate and bananas."
Nigerian example: "Create a cartoon character called 'Ade the Brave' who lives in Abuja."
Illustration:
Fun Prompts = Creative + Playful + Imaginative
Mini summary: Prompts can be fun and creative too!
Lesson 11: Common Mistakes
Definition: Mistakes include being too vague, using confusing words, and forgetting context.
Why it is important: Avoiding them helps you get better answers.
Simple explanation: It's like giving bad directions β you end up lost.
Real-life example: "Tell me about food" β too vague.
School example: "Explain math" β too broad.
Home example: "Cook something" β not specific.
Nigerian example: "Tell me about Nigeria" β could be anything.
Illustration:
Mistakes:
- Vague prompts
- No context
- Confusing words
Mini summary: Avoid vague prompts to get better answers.
Lesson 12: Best Practices
Definition: Best practices include being clear, specific, and giving context.
Why it is important: They help you get the best results from AI.
Simple explanation: It's like following a recipe β you get better results.
Real-life example: "Write a 100-word summary of this article."
School example: "List 5 causes of climate change."
Home example: "Create a weekly meal plan for a family of 4."
Nigerian example: "Write a short biography of Wole Soyinka."
Illustration:
Best Practices:
- Clear
- Specific
- Context
Mini summary: Clear, specific prompts with context give the best results.
Lesson 13: Interesting Facts
Definition: Interesting facts about prompt engineering and AI that might surprise you.
Why it is important: They show how powerful and fun prompt engineering can be.
Simple explanation: It's like learning cool trivia about your new hobby.
Real-life example: Some people use AI to write entire books!
School example: Students use AI to help with homework.
Home example: Parents use AI to plan meals and activities.
Nigerian example: Nigerian developers use AI to build apps.
Illustration:
Facts:
- AI can write poetry
- AI can help with coding
- AI can translate languages
Mini summary: Prompt engineering is powerful and fun!
Lesson 14: Did You Know?
Definition: Fun facts about AI and prompt engineering.
Why it is important: They inspire curiosity and excitement.
Simple explanation: It's like discovering hidden treasures.
Real-life example: AI can create art from text prompts.
School example: AI can help students learn new languages.
Home example: AI can help with household tasks.
Nigerian example: Nigerian startups are using AI for agriculture.
Illustration:
Did You Know?
- AI can write jokes
- AI can generate music
- AI can answer almost any question
Mini summary: AI and prompt engineering are full of surprises!
Lesson 15: Summary β You Are a Prompt Engineer!
Definition: You now know the basics of prompt engineering. You can start crafting better prompts.
Why it is important: This skill will help you in school, work, and life.
Simple explanation: You have taken the first step to becoming an expert.
Real-life example: You can now ask AI for help with tasks.
School example: You can use AI for research.
Home example: You can use AI for planning.
Nigerian example: You can use AI to solve local problems.
Illustration:
You Are a Prompt Engineer! π
Mini summary: You now have the basics to start prompt engineering.
Key Vocabulary (simple definitions)
- Prompt: A question or instruction given to AI.
- AI: Artificial Intelligence β a computer that can learn and think.
- Instruction: What you want the AI to do.
- Context: Background information to guide the AI.
- Input: The information you give to the AI.
- Example: A sample that shows the AI what you want.
- Model: The AI program that processes your prompt.
- Chatbot: An AI that can have a conversation.
- Training: The process of teaching AI using data.
- Output: The answer AI gives you.
Important Concepts
- Prompt engineering is about asking the right way.
- AI needs clear instructions.
- Context and examples improve answers.
- Good prompts lead to great results.
Step-by-Step Explanations
How to Write a Prompt
- Decide what you want (instruction).
- Add any background (context).
- Provide the specific information (input).
- Give an example if needed.
- Ask the AI and see the result.
Teacher Notes
- Use the genie story to explain prompt engineering.
- Encourage students to practice writing prompts.
- Discuss the difference between clear and vague prompts.
- Use Nigerian examples to make it locally relevant.
Parent Tips
- Help your child practice writing prompts.
- Show them how AI can help with homework.
- Encourage them to be creative with prompts.
Interesting Facts & Did You Know?
- Did you know? The first AI chatbot was created in 1966.
- Interesting: Some AI models have read billions of books.
- Did you know? Nigerian developers are building local AI tools.
- Nigeria: AI is being used to improve agriculture and healthcare.
Remember This
- Prompt engineering is about asking the right way.
- AI needs clear instructions.
- Context and examples improve answers.
- Good prompts lead to great results.
Common Mistakes
- Being vague: "Tell me about stuff."
- No context: "Write a story."
- Confusing words: Using words the AI might misunderstand.
Best Practices
- Be clear and specific.
- Add context.
- Give examples.
- Keep it simple.
Illustrations & Diagrams
Prompt Structure
βββββββββββββββββββββββββββββββββββββββββ
β Prompt β
βββββββββββββββββββββββββββββββββββββββββ€
β Instruction (What to do) β
β Context (Background) β
β Input (Information) β
β Examples (Optional) β
βββββββββββββββββββββββββββββββββββββββββ
How AI Works
Input β AI Model β Output
Comparison Tables
Vague vs Clear Prompts
| Vague Prompt | Clear Prompt |
|---|---|
| "Tell me about food." | "List 5 Nigerian breakfast recipes." |
| "Write a story." | "Write a story about a girl in Lagos." |
| "Help me." | "Help me plan a weekly meal budget." |
Prompt Parts
| Part | Example |
|---|---|
| Instruction | "Write" |
| Context | "In the style of a children's book" |
| Input | "A boy who finds a magic seed" |
End-of-Module Summary
Great work! You have learned the basics of prompt engineering β what it is, why it matters, and how to start writing prompts. You now know the parts of a prompt, how to avoid common mistakes, and best practices. In Module 2, we will learn about the anatomy of a prompt in more detail. Keep practicing!
Frequently Asked Questions (10)
- What is prompt engineering? Asking AI the right way.
- Why does AI need prompts? To understand what you want.
- What is an instruction? What you want the AI to do.
- What is context? Background information.
- What is input? The information you give.
- What are examples? Samples to guide the AI.
- What is a common mistake? Being vague.
- What is a best practice? Being clear and specific.
- Can AI understand Nigerian English? Yes, with the right prompts.
- What is the most important thing? Be clear and specific.
Review Questions (15)
- What is prompt engineering?
- Why is prompt engineering important?
- What are the parts of a prompt?
- What is an instruction?
- What is context?
- What is input?
- Why give examples?
- What is a common mistake?
- What is a best practice?
- Give a Nigerian example of a prompt.
- What is the difference between vague and clear prompts?
- How does AI learn?
- What is a chatbot?
- What is output?
- What is the most important thing?
Fill-in-the-Blank Exercises
- _______ is asking AI the right way. (Prompt engineering)
- A prompt has _______, context, and input. (instruction)
- _______ is background information. (Context)
- _______ is the information you give. (Input)
- _______ are samples to guide the AI. (Examples)
- _______ is a common mistake. (Being vague)
True or False Exercises
- Prompt engineering is not important. (False)
- AI needs clear prompts. (True)
- Context is not needed. (False)
- Examples help the AI. (True)
- Vague prompts give the best answers. (False)
Multiple Choice Questions (15)
- What is prompt engineering?
A) Asking AI the right way
B) A game
C) A type of food
Answer: A - What are the parts of a prompt?
A) Instruction, context, input
B) A game
C) A type of food
Answer: A - What is instruction?
A) What you want the AI to do
B) A game
C) A type of food
Answer: A - What is context?
A) Background information
B) A game
C) A type of food
Answer: A - What is input?
A) The information you give
B) A game
C) A type of food
Answer: A - Why give examples?
A) To guide the AI
B) A game
C) A type of food
Answer: A - What is a common mistake?
A) Being vague
B) Being clear
C) A game
Answer: A - What is a best practice?
A) Being clear and specific
B) Being vague
C) A game
Answer: A - Give a Nigerian example.
A) Jollof rice recipe
B) A game
C) A type of food
Answer: A - What is the difference between vague and clear prompts?
A) Vague is unclear; clear is specific
B) They are the same
C) A game
Answer: A - How does AI learn?
A) From training data
B) A game
C) A type of food
Answer: A - What is a chatbot?
A) An AI that can talk
B) A game
C) A type of food
Answer: A - What is output?
A) The answer AI gives
B) A game
C) A type of food
Answer: A - What is the most important thing?
A) Be clear and specific
B) Be vague
C) A game
Answer: A - What is the purpose of prompt engineering?
A) To get better answers
B) To confuse AI
C) A game
Answer: A
Matching Exercises
| Term | Meaning |
|---|---|
| 1. Prompt | A. Question or instruction |
| 2. Instruction | B. What you want done |
| 3. Context | C. Background info |
| 4. Input | D. Information given |
| 5. Example | E. Sample to guide |
Answers: 1-A, 2-B, 3-C, 4-D, 5-E
Short Answer Questions
- What is prompt engineering?
- What are the parts of a prompt?
- Why is context important?
- What is a common mistake?
Scenario-based Exercises
- Scenario 1: You want AI to help you with homework. How would you write the prompt?
- Scenario 2: You want AI to generate a story for your little sister. What kind of prompt would you write?
- Scenario 3: A Nigerian student wants to learn about Lagos. What prompt would you write?
Group Activity
In groups, write 5 prompts for different tasks. Share with the class and discuss why each prompt is effective.
Individual Activity
Write a prompt to ask AI for help with a task you need to do this week. Share it with the class.
Classroom Discussion Questions
- Why is it important to be clear with AI?
- What is the most important part of a prompt?
- How can prompt engineering help Nigerians?
Mini Project
Create a poster on "How to Write a Good Prompt." Include parts of a prompt and examples.
Practical Assignment
Write 3 prompts: one for school, one for home, and one for a Nigerian context. Test them with an AI tool if available.
Challenge Exercise
Research how Nigerian students are using AI. Write a short summary.
Quiz Answers
Multiple Choice answers: 1-A, 2-A, 3-A, 4-A, 5-A, 6-A, 7-A, 8-A, 9-A, 10-A, 11-A, 12-A, 13-A, 14-A, 15-A.
True/False answers: 1-F, 2-T, 3-F, 4-T, 5-F.
Key Takeaways
- Prompt engineering is asking AI the right way.
- AI needs clear instructions.
- Context and examples improve answers.
- Good prompts lead to great results.
Preparation for the Next Module
In Module 2, we will learn about the anatomy of a prompt β how to craft the perfect prompt for any situation. Get ready to dive deeper!