RACE Prompt Framework
RACE = Role, Action, Context, Explanation. A prompt framework designed for educational and explanatory content. Specify the AI's teaching role, the topic or action, the audience context, and how the explanation should be structured.
When to Use RACE
Use the RACE framework when:
- You need to explain a complex topic to a specific audience โ beginners, students, executives, or domain specialists.
- You are creating learning materials, course content, explainer articles, or training documentation.
- The audience's knowledge level should directly shape the depth, vocabulary, and examples used.
- You want the AI to adopt a teaching style โ use analogies, examples, or Socratic questions โ rather than just presenting facts.
When Not to Use RACE
- Action-oriented tasks โ use APE for data analysis, code generation, or process automation.
- Professional tasks with detailed constraints โ use ROLE when output format, limitations, and expert persona all matter.
- Simple direct requests โ use TAG for quick, unambiguous tasks.
RACE Framework Template
Example: Teaching a Complex Topic
Before (weak prompt):
After (structured prompt):
Example prompt:
You are a patient data science educator specializing in non-technical audiences. Explain how machine learning models learn from data โ cover supervised learning, training, and overfitting. My audience is marketing professionals who understand A/B testing and basic stats but have no coding background. Use marketing analogies like ad targeting and email segmentation. Avoid math notation. Structure each section as: concept overview, analogy, practical example, and one key takeaway.
Example: Academic Writing Support
Before (weak prompt):
After (structured prompt):
Example prompt:
Act as an economics professor teaching an intro undergraduate course. Explain the law of supply and demand to first-year students in their second lecture โ no prior economics background. Cover what causes shifts in each curve and how equilibrium price is determined. Use a concrete everyday example like coffee prices. Define every term before using it. End with a summary table comparing factors that shift supply versus demand.
How to Write a RACE Prompt โ Step by Step
- Define the Role. Describe the AI teaching persona โ e.g., a patient high school teacher, a senior data scientist, a Socratic tutor.
- State the Action. Specify what to explain, teach, or create โ the topic, concept, or learning objective.
- Describe the Context. Define the audience โ their knowledge level, background, age group, or the learning setting.
- Specify the Explanation. Define how the explanation should be structured โ analogies, depth, format, length, and any teaching techniques to use or avoid.
Frequently Asked Questions
What does RACE stand for in prompt engineering?
RACE stands for Role, Action, Context, Explanation. It is a four-part prompt framework designed for educational and explanatory content. It assigns the AI a teaching role, specifies the topic, defines the audience context, and controls how the explanation should be structured.
When should I use RACE instead of ROLE?
Use RACE when the primary goal is to explain, teach, or create educational content for a specific audience. Use ROLE when the task requires a professional expert persona with output constraints and limitations that go beyond explanation.
Is RACE good for creating learning materials?
Yes, RACE is purpose-built for learning material creation. The Context component ensures the AI calibrates complexity for the audience, and the Explanation component lets you specify teaching techniques โ analogies, examples, Socratic questions, or step-by-step breakdowns.
Try the Prompt Generator โAlso see: All AI Prompt Frameworks ยท AI Prompt Optimizer