Role Prompting: Definition and Examples
Role prompting consists of assigning a specific role, identity, or expertise to an AI model in the prompt, in order to guide the style, tone, and depth of its responses.
Full definition
Role prompting is a prompt engineering technique that consists of asking a language model to adopt a specific role before responding to a query. By assigning an identity — for example, "You are a cybersecurity expert" or "Act as a physics teacher" — the model is conditioned to draw on the knowledge and language register associated with that character.
This technique is based on a simple principle: language models have been trained on massive corpora containing texts produced by professionals in all fields. By specifying a role, we activate a subset of this knowledge, allowing for more relevant, precise, and well-calibrated responses for the intended context.
Role prompting can be used simply (a single instruction sentence) or sophisticatedly, by combining the role with an experience level, target audience, format constraints, and situational context. For example, asking the model to be "a senior Python developer specialized in data engineering, who explains to a junior" produces very different results from "a theoretical computer science researcher."
This approach is particularly effective for creative, educational, technical, or writing tasks. It often forms the first building block of a well-structured prompt and naturally combines with other techniques like few-shot prompting or chain-of-thought.
Etymology
The term combines "role" (from French, meaning a function or character to embody) and "prompting", the action of formulating an instruction for an AI model. The concept is directly inspired by role-playing and theatrical improvisation techniques, transposed to the field of generative artificial intelligence.
Concrete examples
Get a technical explanation suitable for a beginner audience
You are a patient and pedagogical computer science professor. Explain the concept of recursion to a first-year student who has never programmed.
Write marketing content with a specific tone
Act as a senior copywriter specialized in B2B SaaS. Write a sales page for a project management tool, using a professional but accessible tone.
Analyze a problem from an expert perspective
You are a software architect with 15 years of experience in distributed systems. Analyze this microservices architecture and identify potential points of failure.
Practical usage
To apply role prompting effectively, start your prompt with a clear instruction defining the role, expertise level, and possibly the target audience. Be specific: "a nutritionist specialized in sports nutrition" will yield better results than simply "a health expert." Combine the role with format and tone constraints to maximize the relevance of the responses.
Related concepts
FAQ
Does role prompting work with all AI models?
What is the difference between role prompting and system prompt?
Can you assign multiple roles at the same time?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- Replace the bracketed variables with your details, then refine the result.
About Prompt Guide
Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.
More definitions
Rotary Position Embedding: Definition and Examples
Rotary Position Embedding (RoPE) is a positional encoding technique that incorporates token position information into a Transformer model by applying
ROUGE Score: Definition and Examples
ROUGE (Recall-Oriented Understudy for Gisting Evaluation) is a family of automatic metrics used to evaluate the quality of summaries generated by
Runway ML: Definition and Examples
Runway ML is a generative AI platform specialized in creating and editing visual content (video, image, 3D) from text prompts or multimodal inputs.
Safety Filter: Definition and Examples
A safety filter is a mechanism built into generative AI models that automatically detects and blocks content deemed dangerous, inappropriate, or contrary to usage policies before it is generated or displayed to the user.
SAM (Segment Anything Model): Definition and Examples
SAM (Segment Anything Model) is an image segmentation model developed by Meta AI, capable of automatically identifying and cutting out any ob
Scaling Laws: Definition and Examples
Scaling laws are mathematical relationships that describe how AI model performance improves predictably as model size, training data, or compute increases.
Get new prompts every week
Join our newsletter.