Skip to content

Assigning a Persona | AI Adopt a Role | Lecture 06

how to assign a persona to an AI in your prompts

Learn how to assign a persona to an AI in your prompts. This powerful technique helps control the AI’s tone, style, and expertise for more tailored responses. Lecture 06

Giving the AI a Job

Welcome back! Today we’re going to learn one of the most fun and powerful techniques in prompt engineering: giving the AI a persona.

A persona is a character or a role that you ask the AI to play. By telling the AI who to be, you can strongly influence its tone, style, vocabulary, and even its way of thinking. It’s a form of providing very strong context.

Why Use a Persona?

Assigning a persona is like choosing the right expert for a job. You wouldn’t ask a poet to fix your car, and you wouldn’t ask a mechanic to write a sonnet. By setting a persona, you tell the AI which “hat” to wear.

This helps to:

  • Control Tone: Make the response formal, funny, serious, or friendly.
  • Define Expertise: Get answers from the viewpoint of a specific profession (e.g., a doctor, a lawyer, a scientist).
  • Set the Style: Get a response in a particular writing style (e.g., a journalist, a novelist, a technical writer).
  • Improve Creativity: Brainstorm ideas from different perspectives.

Example: The Same Question, Different Personas

Let’s ask the same question but give the AI a different persona each time.

Base Question:Explain the importance of the sun.

Prompt 1 (Scientist Persona):You are an astrophysicist. Explain the importance of the sun to our solar system.

The AI will likely give a technical answer about gravity, nuclear fusion, and the habitable zone.

Prompt 2 (Poet Persona):You are a romantic poet. In a short poem, explain the importance of the sun to a lover.

The AI will respond with creative, metaphorical language about light, warmth, and life.

Prompt 3 (Fitness Coach Persona):You are a fitness coach. Explain the importance of the sun for human health.

The AI will focus on Vitamin D, circadian rhythms, and the benefits of getting sunlight for well-being.

how to assign a persona to an AI in your prompts
how to assign a persona to an AI in your prompts

How to Create a Persona Prompt

It’s very simple. You just start your prompt with a clear instruction telling the AI what role to adopt. The most common phrases are:

  • "You are a..."
  • "Act as a..."
  • "I want you to be my..."
  • "Assume the role of a..."

The more details you give the persona, the better. For example, instead of just “Act as a doctor,” you could say, “Act as a friendly pediatrician explaining something to a nervous parent.”

Pro Tip: The Expert Persona

One of the most effective personas is the “expert.” When you tell an AI to act as a world-leading expert in a certain field, it often provides more detailed, accurate, and confident answers. For example:

Act as a world-renowned expert in prompt engineering. Review my following prompt and suggest three ways to improve it for clarity and effectiveness.

Key Takeaways from Lecture 06

  • persona is a role or character you ask the AI to play.
  • It’s a powerful way to control the AI’s tone, style, and expertise.
  • Start your prompt with phrases like
  • "Act as a...
  • "or
  • "You are a...".
  • Be specific in your persona description for the best results.
  • Using an “expert” persona can often lead to higher-quality answers.

End of Lecture 06. You can now direct the AI like a movie director! In our next lecture, we’ll learn about using delimiters to keep our prompts clean and organized.

Zero-Shot vs Few-Shot Prompting | Lecture 05

Najeeb Alam

Najeeb Alam

Technical writer specializes in developer, Blogging and Online Journalism. I have been working in this field for the last 20 years.