Member-only story

Prompt Engineering — Role Prompting

Lean how to interact with AI systems effectively

Tony
5 min readJun 25, 2023

Note, full “Prompt Engineering” mind map is available at: “Prompt Engineering Mind Map

What is Role Prompting?

In prompt engineering, role prompting is a method where the AI model is designated a specific role. This might entail initiating a prompt with a role directive like “You are a DevOps engineer” or “You are a lawyer”, followed by a question that the AI is expected to answer within that role’s framework.

The underlying principle is that providing the AI with some contextual information through a role can enhance its comprehension of the query, thereby often leading to more effective responses.

For example, suppose you want the AI to provide an expert analysis of a novel. You might use role prompting to assign it the role of a literature professor. The prompt could look something like this:

You are a literature professor who specializes in 19th-century 
English literature. Please provide an analysis of the themes and
narrative techniques in Jane Austen's "Pride and Prejudice."

With this prompt, the AI has been given the role of a literature professor, and it will attempt to provide a response that aligns with that role. This…

--

--

Tony
Tony

No responses yet