From the book

Why should you give ChatGPT a role before you ask?

· By Robert Scales · 4 min read

Short answer

Opening a prompt with a role, such as "You are an experienced bookkeeper for small businesses", tells ChatGPT which kind of expertise, vocabulary and point of view to draw on. It narrows thousands of possible answers to the ones that fit your situation, so the reply is more focused and more useful, though it does not make the model any more accurate.

Ask ChatGPT "How should I price my services?" and you will get a sensible, general answer that could apply to a plumber, a lawyer or a graphic designer. Start the same question with "You are a pricing consultant who works with freelance illustrators" and the answer changes: different examples, different numbers to think about, different warnings. Nothing about the model changed. You simply told it where to stand.

Setting a role first is one of the core habits in A Beginner's Guide to ChatGPT, Robert Scales's new book. In the book's method, the role comes before everything else: you name the expert you want, then give context about yourself and your task, then say what output you expect. This article looks at why that first line matters so much and how to write a good one.

Why a role changes the answer

A language model has absorbed writing from countless kinds of people: teachers, engineers, marketers, nurses, novelists. A plain question gives it no hint which of those voices to use, so it tends toward a blend aimed at an average reader. A role is a shortcut to the right part of that knowledge. It sets three things at once:

  • Vocabulary and depth. A "senior tax accountant" talks about deductions differently than a "friend who's good with money".
  • Priorities. A "safety inspector" looks for risks; a "creative director" looks for ideas.
  • Tone. A "kindergarten teacher" and a "university examiner" explain the same idea in very different ways.

OpenAI is building the same idea into its products. With GPT-4, announced in March, developers can set the model's style and task in a "system" message, a standing instruction that sits above the conversation. One of OpenAI's own examples casts the model as a tutor who never hands over the answer and instead asks guiding questions. OpenAI calls this steerability and says ChatGPT users will get similar control soon. Until then, a role in the first lines of your prompt does much of the same job.

How to write a good role

The book's advice is to describe the role with its expertise, then follow it straight away with context about you. A role on its own is a costume; the context gives it something to work on. A good role line names:

  1. The profession or position.
  2. The specialty or kind of client.
  3. Any quality you want in the answers, such as practical, cautious or encouraging.

Compare:

Prompt
You are an expert. Help me with my garden.
Prompt
You are a master gardener who specializes in small urban vegetable gardens in cold climates. I have a 2-by-3-meter balcony facing south in Ottawa and I have never grown food before. Suggest five vegetables or herbs I can start this spring, with when to plant each, the pot size, and one common beginner mistake to avoid. Keep it practical and encouraging.

"Expert" tells the model almost nothing. The second version picks a specialty that matches the problem, then supplies the facts only you know: the space, the climate, your experience and the shape of the answer you need. OpenAI's prompting guide makes a matching point for developers: be specific and detailed about context, outcome, length, format and style.

What a role can't do

A role shapes how ChatGPT answers. It does not give the model knowledge it lacks or make it more truthful. Telling it "You are a doctor" does not turn its reply into medical advice you can rely on, and a confident expert voice can make a wrong answer more convincing. GPT-4's own announcement says the model still invents facts and makes reasoning errors, and that its knowledge mostly stops in September 2021. Use roles to get a better draft, then check anything that matters.

Try it: Take one question you would really ask, and run it three times in separate chats with three different roles, for example a lawyer, a small-business owner and a customer. Notice which details each role brings up that the others miss.

Which roles work best?

The roles that work best are specific and match the task. "Marketing manager for an eco-friendly outdoor brand" beats "marketing expert", because the extra words carry context about audience and values. When in doubt, name the person you would actually hire for the job, then add the kind of client they usually serve.

A few role patterns are useful across almost any field:

Role patternUse it whenExample opening
Specialist practitionerYou need practical, field-specific steps"You are a bookkeeper who works with home-based businesses."
Teacher or tutorYou want to learn, not just get an answer"You are a patient tutor. Ask me questions instead of giving the answer."
Editor or criticYou have a draft and want it improved"You are a demanding editor. List the five weakest sentences and why."
Audience stand-inYou want to test how something lands"You are a busy parent reading this flyer for ten seconds."
Planner or coachYou need a schedule or a sequence of steps"You are a project coordinator. Turn this goal into a four-week plan."

The book applies this across many professions, from marketers and accountants to teachers, programmers and healthcare administrators, and the pattern is the same each time: a role that fits the work, followed by the details only you can supply.

Two last tips. Keep the role consistent during a conversation; if you need a different perspective, say so ("Now answer as the customer would") or start a new chat. And if an answer feels off, adjust the role before rewriting everything else. Sometimes changing "expert" to "practical beginner-friendly coach" is the only fix you need.

Sources

  1. A Beginner's Guide to ChatGPT — Holistic Hybrid, April 18, 2023
  2. GPT-4 — OpenAI, March 14, 2023
  3. Best practices for prompt engineering with OpenAI API — OpenAI Help Center

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement