Today I learnt from Google's Generative AI for Educators course how to prompt in a structured way to get desired response with high quality. Here is the structure I follows.
Role + Task + Context + Requirements + Output Format
Example Formula
- Role: Tell the AI who it is.
"You are a science teacher."
- Task: Explain what you want.
"Explain how volcanoes erupt."
- Context: Add background information.
"I'm a Primary 6 student."
- Requirements: Mention any special instructions.
"Use simple words, include one fun fact, and keep it under 200 words."
- Output Format: Say how you want the answer.
"Use bullet points."
Full Prompt Example
You are a science teacher. Explain how volcanoes erupt to a Primary 6 student. Use simple language, include one fun fact, keep it under 200 words, and use bullet points. πβ¨
Tips for Better Prompts π―
β Be specific instead of vague.
β "Tell me about space."
β "Explain why astronauts float in space using simple examples."
β Mention your audience. "Explain it to a 12-year-old."
β Set a length. "Write 100 words."
β Choose a style. "Make it funny π." "Make it professional π." "Tell it as a story π."
β Ask for examples. "Give three examples."
Advanced Prompt Example π
You are an expert travel planner. Help me plan a 5-day trip to Japan with a budget of $1,500. Include transportation, food recommendations, sightseeing, estimated costs, and a daily schedule. Present everything in a table.
A Handy Prompt Template π
Copy and fill in the blanks:
You are a __________________.
Your task is to __________________.
Context:
Requirements:
Output format:
Bonus Trick β
At the end of your prompt, you can add:
"If you need more information before answering, ask me up to three questions first."