Role prompting

Role prompting is telling an AI model to act as a particular expert, character or job, such as a tax adviser or a strict editor, to shape how it responds.

Role prompting is one of the simplest prompting techniques. Before the actual request, the prompt tells the model who it is meant to be: "You are an experienced copy editor" or "You are a patient maths tutor for 12-year-olds." The model, which has read enormous amounts of text written by and about such people, then tends to pick up the vocabulary, priorities and tone that go with the role.

Model makers still recommend it, mostly for focus and tone. Anthropic's documentation advises setting a role in the system prompt and says even a single sentence makes a difference, with the example of a coding assistant specialising in Python. A role helps the model judge what to include, which jargon is appropriate and how much to explain.

Whether it improves accuracy is a different question, and the evidence is mixed. A paper at NAACL 2024 found that a role-play prompt raised ChatGPT's accuracy on the AQuA maths benchmark from 53.5 to 63.8 per cent, and on a letter-manipulation task from 23.8 to 84.2 per cent, which the authors argue works as a trigger for step-by-step reasoning. Yet a separate study, accepted at EMNLP 2024, tested 162 roles on 2,410 factual questions across four model families and found that adding a persona to the system prompt did not improve performance over no persona, with the effect of any particular role largely random.

The two results fit together once you separate style from knowledge. A role can change how a model works through a problem and how it presents the answer. It cannot add facts the model never learned. Calling a model a senior lawyer does not make its legal citations more reliable, and it may make wrong answers sound more confident.

In practice, use a role to set audience, scope and voice, then put the real effort into a clear task description, relevant context and examples. If accuracy matters, test the prompt with and without the role on real cases, because the benefit varies by model and task.

Common questions

What is role prompting?

It is a prompting technique in which you tell the model to act as a specific person, expert or character before giving it a task, for example "You are a senior data analyst." It is usually placed in the system prompt so it applies to the whole conversation.

Does role prompting improve accuracy?

Sometimes, but not reliably. One study found large gains on some reasoning tasks with role-play prompts, while another found that personas gave no accuracy benefit on 2,410 factual questions. Roles are dependable for tone and focus, less so for correctness.

Where should I put the role in a prompt?

Model makers such as Anthropic recommend putting it in the system prompt, which sets behaviour for the whole conversation. A single clear sentence is usually enough; the details of the task and context matter more.

What is the difference between role prompting and a persona?

Role prompting is a technique applied in a prompt, often for one task. A persona is the lasting identity of an assistant or product, including name and personality, which may be set by role prompting, by training or by both.

Finding more

Search for "role prompting", "role-play prompting" or "personas in system prompts" to find both practical advice and the research testing it. Official prompting guides from model makers are the best source for how to phrase roles for a given model, while arXiv and conference papers that report controlled experiments are the place to judge whether a role actually changes results.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.