โ† All Techniques
๐ŸŽญ

Role Prompting โ€” Prompting Guide & Examples

Role prompting assigns the AI a specific persona, expertise, or character before giving it a task. By framing 'You are a senior software architect...' or 'Act as a Harvard MBA professor...', the model adjusts its vocabulary, depth, perspective, and reasoning style.

How It Works

Place the role assignment at the beginning of your prompt (ideally in the system message). The model then filters its responses through that persona's knowledge, communication style, and expertise level. More specific roles produce more targeted outputs.

When to Use

Use role prompting for expert-level responses, creative writing, simulations, tutoring, and when you need a specific communication style. Combine with other techniques (role + CoT) for even better results.

Model-Specific Tips

ChatGPT / GPT-4

Place roles in the system message for best results. GPT-4 responds well to detailed role descriptions with specific expertise, years of experience, and communication style.

Claude

Claude handles roles excellently, especially in the system prompt. Claude maintains role consistency well across long conversations. Be specific about the role's constraints.

Gemini

Gemini supports role prompting. Place role instructions at the start of the prompt. Gemini maintains personas well in multi-turn conversations.

Pros & Cons

Pros

  • โœ“ Instantly shifts expertise level and style
  • โœ“ Easy to implement โ€” just add a role
  • โœ“ Works well combined with other techniques
  • โœ“ Great for getting domain-specific language

Cons

  • โœ— Model doesn't actually have real expertise
  • โœ— Overly specific roles can be restrictive
  • โœ— Can produce overconfident responses
  • โœ— Role-specific knowledge may be outdated

Example Prompts

You are a senior staff engineer at Google with 15 years of distributed systems experience. Review this system design for a real-time notification service handling 100M daily notifications. Focus on: scalability bottlenecks, failure modes, and cost optimization.

You are a Michelin-star chef and food science expert. Explain why my sourdough bread has a dense crumb. Provide both the science and practical fixes, as you would teach an apprentice.

Act as a Y Combinator partner reviewing a pitch deck. Be direct and constructive. Here's our startup: [description]. What are the three biggest concerns you'd raise, and what would make you say yes?

FAQ

What is Role Prompting?
Role prompting assigns the AI a specific persona, expertise, or character before giving it a task. By framing 'You are a senior software architect...' or 'Act as a Harvard MBA professor...', the model adjusts its vocabulary, depth, perspective, and reasoning style.
When should I use Role Prompting?
Use role prompting for expert-level responses, creative writing, simulations, tutoring, and when you need a specific communication style. Combine with other techniques (role + CoT) for even better results.
How does Role Prompting work?
Place the role assignment at the beginning of your prompt (ideally in the system message). The model then filters its responses through that persona's knowledge, communication style, and expertise level. More specific roles produce more targeted outputs.
Does Role Prompting work with ChatGPT?
Place roles in the system message for best results. GPT-4 responds well to detailed role descriptions with specific expertise, years of experience, and communication style.
Does Role Prompting work with Claude?
Claude handles roles excellently, especially in the system prompt. Claude maintains role consistency well across long conversations. Be specific about the role's constraints.