Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Role and Context Prompting | Techniques and Strategies
Prompt Engineering Basics

bookRole and Context Prompting

Assigning a role in your prompt means telling the AI to respond as a specific expert, character, or profession. Adding context provides background information or a scenario for the AI to consider. Together, these techniques help the AI generate more relevant and accurate responses. Compare these two prompts:

  • Without role/context: Explain photosynthesis;
  • With role/context: You are a high school biology teacher. Explain photosynthesis to a group of 15-year-old students using simple language.

The second prompt guides the AI to use an appropriate tone and level of detail, resulting in an explanation that is better tailored to the intended audience.

Note
Note

Avoid vague roles like "expert" or "professional". Be specific, such as "as a pediatrician" or "as a travel guide".

Assigning a clear role and context helps the AI avoid generic or overly technical answers.

question mark

Which of the following best describes context prompting?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Awesome!

Completion rate improved to 11.11

bookRole and Context Prompting

Swipe to show menu

Assigning a role in your prompt means telling the AI to respond as a specific expert, character, or profession. Adding context provides background information or a scenario for the AI to consider. Together, these techniques help the AI generate more relevant and accurate responses. Compare these two prompts:

  • Without role/context: Explain photosynthesis;
  • With role/context: You are a high school biology teacher. Explain photosynthesis to a group of 15-year-old students using simple language.

The second prompt guides the AI to use an appropriate tone and level of detail, resulting in an explanation that is better tailored to the intended audience.

Note
Note

Avoid vague roles like "expert" or "professional". Be specific, such as "as a pediatrician" or "as a travel guide".

Assigning a clear role and context helps the AI avoid generic or overly technical answers.

question mark

Which of the following best describes context prompting?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 2. ChapterΒ 1
some-alt