fixaiprompt
All techniques
Glossary · Technique

Persona / Role Prompting

Also known as: Role prompting, Act-as prompting

Tell the model who it is. "Act as a senior X" changes accuracy, vocabulary, and tone more than any other single trick.

When to use it

  • Any domain-specific task — coding, legal, medical, writing.
  • When the response register needs to match a specific audience.
  • When you want the model to apply field-specific heuristics.
  • Anywhere generic-LLM voice is the problem.

When not to use it

  • Tasks where neutral / no-persona answers are required (e.g. unbiased fact retrieval).
  • Stacking too many roles — "act as a senior product manager AND lawyer AND designer" gives mush.
  • When the persona is fictional and you need factual accuracy.

How it works

  1. 1Prepend "Act as <ROLE>" or "You are <ROLE>" before the task.
  2. 2Best roles are SPECIFIC: "a senior frontend engineer who has shipped 10 React apps" beats "a developer".
  3. 3Add expertise level ("senior", "principal", "10-year veteran") and a personality cue ("who is allergic to buzzwords").
  4. 4The model effectively retrieves a different cluster of knowledge and conventions.

Example

Lazy prompt
Review my code.
Using the technique
Act as a senior backend engineer who has shipped systems at scale. Review the following code for: correctness, readability, performance hotspots, and one thing you'd push back on in a code review. Be direct, not encouraging.

Common pitfalls

  • Vague roles ("an expert") barely move the needle. Be specific.
  • Personas can amplify biases — a "contrarian VC" persona will be contrarian even when it shouldn't be.
  • Fictional or extreme personas ("act as a hacker") sometimes trip safety filters.

Where this came from

Folk practice from early GPT-3 days; formalized in countless prompt-engineering guides since.