Content ITV
This is Itvedant Content department
Learning Outcome
4
Improve prompts using the right role.
3
Learn when to use Role Playing.
2
Differentiate Role and System Prompts.
1
Understand Role and System Prompts.
Before learning about Role Playing and System Prompts, let's quickly recall:
Prompting :–
A good prompt includes Task, Context, Audience, Format, and Constraints,
a clear prompt leads to a better output.
We know how to structure a strong prompt, but what happens when you also assign the AI a specific identity before asking your question?
Let's understand two techniques that shape how AI responds, Role Playing and System Prompts.
The Theatre Analogy
Imagine a theatre performance with three important people.
The Director sets the rules before the performance begins, defining how the actors behave, the style they follow, and the boundaries they must respect. This represents the System Prompt.
The Actor plays a specific role, such as a teacher, doctor, lawyer, or scientist. This represents Role Playing, where the AI responds according to the assigned character.
The Audience asks questions, representing the User. Even when unexpected questions are asked, the actor stays in the assigned role while following the director's instructions.
Transition to Technical Concept
Transition from Analogy to Technical Concept(Slide 5)
Think About It
Previously, we imagined an actor playing a specific character while following the director's rules, no matter what the audience asks.
another is assigned the role of someone explaining to a five year old. Will both explanations be the same?
Two students ask the same question, "Explain Artificial Intelligence." One AI is assigned the role of a university professor,
Expected Answer: No, the tone, vocabulary, and examples will differ based on the assigned role.
Exactly! That's Role Playing at work. So how exactly does assigning a role change the response, and how is that different from a System Prompt?
What is Role Playing?
Transition from Analogy to Technical Concept(Slide 5)
Role Playing means assigning a specific identity to the AI before asking your question. Instead of asking "Explain Cloud Computing," you ask "You are a cloud computing professor.
Explain Cloud Computing to beginners using real world examples."
model.invoke(
"You are a cloud computing professor. Explain Cloud Computing to beginners using real world examples."
)Code :
The AI responds like an experienced teacher instead of a generic information source. Role playing helps it adjust its tone, vocabulary, audience, examples, and perspective to produce more relevant responses.
Examples of Role Playing
Teacher:
"You are a mathematics teacher.
Explain Probability using simple classroom examples."
Doctor:
"You are a family doctor.
Explain high blood pressure in simple language."
Examples of Role Playing
Career Counsellor:
"You are a career counsellor.
Suggest career options for a Computer Science graduate."
Software Engineer:
"You are a senior Python developer.
Review the following code and suggest improvements."
What is a System Prompt?
Example: "You are a friendly AI tutor. Always explain concepts in simple language, provide examples, encourage learning, and avoid using difficult technical terms." Every response the AI gives will now follow these instructions, regardless of what the user asks.
A System Prompt is a special instruction given to the AI before the conversation even begins, it tells the AI who it is, how it should behave, what tone to use, what rules to follow, and what to avoid.
Unlike normal user prompts, system prompts are usually written by developers and remain active throughout the entire conversation.
What is a System Prompt?
model.invoke([
{
"role": "system",
"content": "You are a friendly AI tutor. Always explain concepts in simple language,
provide examples, encourage learning, and avoid using difficult technical terms."
},
{
"role": "user",
"content": "Explain Cloud Computing."
}
])Code :
Role Prompt vs System Prompt (Comparison)
How They Work Together
Step 1:
The System Prompt is set once, before the conversation begins, defining tone, rules, and boundaries.
Step 2:
The Role Prompt is applied within the conversation, assigning the AI a specific identity for the current question.
Step 3:
The AI responds from within that assigned role, while still following the System Prompt's overall rules.
Key Point: System prompts have higher priority than user prompts. If a user's request conflicts with the system instructions, the AI follows the system prompt.
Spotting the Prompt Type
Real Life Examples
System Prompt, "Be polite, professional, and concise."
Role, Customer Support Executive.
Result, the chatbot answers queries politely and consistently every time.
System Prompt, "Explain concepts using simple language and encourage students."
Role, University Professor.
Result, students receive educational and beginner friendly explanations.
Real Life Examples
System Prompt, "Generate efficient, well commented code and explain important programming concepts."
Role, Senior Software Engineer.
Result, the chatbot answers queries politely and consistently every time.
System Prompt, "Recommend budget friendly travel options and organise information in tables."
Role, Travel Consultant.
Improving Prompts Using Role Playing
An Easy Way to Remember
Think of a school.
Daily Life Applications
Asking an AI to act as a fitness coach before requesting a workout plan, rather than asking generically.
A customer service chatbot quietly following a hidden system prompt to always stay polite and on topic.
Asking an AI to act as a senior developer before requesting a code review, getting more targeted, expert level feedback.
Summary
4
Together, they produce better AI responses.
3
System Prompts override conflicting user prompts.
2
System Prompt defines its behavior and rules.
1
Role Playing gives the AI a specific identity.
Quiz
A user asks an AI to ignore its politeness rules and respond rudely. What will the AI do?
A. Respond rudely as requested
B. Remain polite by following the system prompt
C. Stop responding
D. Ask the developer for permission
Quiz-Answer
A user asks an AI to ignore its politeness rules and respond rudely. What will the AI do?
A. Respond rudely as requested
B. Remain polite by following the system prompt
C. Stop responding
D. Ask the developer for permission
By Content ITV