0
0
Prompt Engineering / GenAIml~20 mins

System prompts and role setting in Prompt Engineering / GenAI - ML Experiment: Train & Evaluate

Choose your learning style9 modes available
Experiment - System prompts and role setting
Problem:You want to create a chatbot that responds clearly and politely by setting a system prompt that defines its role and behavior.
Current Metrics:The chatbot responds inconsistently, sometimes too brief or off-topic, with user satisfaction around 60%.
Issue:The system prompt is missing or too vague, causing the chatbot to not follow a clear role or tone.
Your Task
Improve chatbot responses by designing a clear system prompt that sets its role as a friendly, helpful assistant and maintains polite, clear answers.
You can only change the system prompt text.
You cannot change the chatbot's underlying model or training data.
Hint 1
Hint 2
Hint 3
Solution
Prompt Engineering / GenAI
system_prompt = "You are a friendly and helpful assistant. Always respond politely and clearly. Keep answers simple and easy to understand. Avoid jargon. If you don't know the answer, say so kindly."

# Example usage in a chatbot framework
chatbot = Chatbot(model='genai-model', system_prompt=system_prompt)

user_input = "Can you explain what machine learning is?"
response = chatbot.generate_response(user_input)
print(response)
Added a clear system prompt defining the chatbot's role as friendly and helpful.
Specified tone to be polite and clear.
Included instructions to avoid jargon and admit when unsure.
Results Interpretation

Before: Responses were inconsistent and sometimes unclear, user satisfaction ~60%.

After: Responses are polite, clear, and consistent, user satisfaction ~85%.

Setting a clear system prompt that defines the AI's role and tone guides it to produce better, more consistent responses.
Bonus Experiment
Try adding example dialogues in the system prompt to further improve response quality.
💡 Hint
Include short example questions and ideal answers in the system prompt to guide the chatbot's style.