The 4-Part Prompt Formula
Like this video? Get new free AI lessons on YouTube.
SubscribeA prompt is the instruction you give to an AI. A good prompt has four parts: Role + Task + Context + Format.
If you miss a part, the output is often generic or unhelpful. If you include all four, you get useful results.
For example, if you ask the AI to "write a blog post", you only gave it a task. You did not give context (who is it for?) or format (how long should it be?). The AI has to guess, so the result is generic. Generic output usually means the prompt was vague, not that the AI model is weak.
The Four Parts
1. Role
A role is the persona or expert identity you give to the AI.
Tell the AI who it should act as. This sets the right tone, knowledge level, and point of view.
- โ Weak (no role): "Explain machine learning."
- โ Better: "You are a data scientist explaining ideas to a marketing team."
(Machine learning is a type of AI that learns patterns from data.)
2. Task
A task is the specific deliverable you want the AI to create.
Name the exact result you need. Vague tasks produce vague answers.
- โ Weak: "Write something about our product."
- โ Better: "Write 3 sentences explaining why a customer should buy our product. Highlight speed, simplicity, and lower costs."
3. Context
Context is the background information the AI needs.
Tell the AI who the audience is, what the situation is, and what rules to follow.
- โ Weak: "Write a cold email."
- โ Better: "Write a cold email to a marketing director at a software company. We sell a tool that turns data into reports. The director has never heard of us. Keep it under 100 words."
(A cold email is a message sent to someone who does not know you yet.)
4. Format
Format is the structure of the output.
Tell the AI how to arrange the response. You can specify the length, the layout (like bullet points or a table), and the tone. Without a format, the AI guesses the structure. It often guesses wrong.
- โ Weak (no format): "Give me interview questions."
- โ Better: "Give me 5 interview questions in a numbered list. After each question, add one sentence explaining what it reveals about the candidate."
Putting It Together
Here is a weak prompt improved with all four parts:
- Weak prompt: "Help me write a performance review."
- Better prompt with the formula:
"You are an HR manager [Role]. Write a performance review for a software engineer [Task]. The engineer delivered a major feature on time and mentored two junior developers. However, the engineer struggled to explain ideas in meetings with other teams [Context]. Write a balanced, 3-paragraph review. Start with achievements, address the communication issue in a kind and helpful way, and end with growth goals for next quarter [Format]."
The improved prompt gives the AI clear instructions. You get a draft you can actually use.
Try It
The prompt below is missing every part of the formula. Rebuild it with Role + Task + Context + Format. Then click Analyze. Watch the checklist turn green as you add each part.
The next lessons show you how to make each part even stronger.
Up next ยท Lesson 2 of 5
Specificity Wins
2 min read
1 of 5 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

