Role Prompting · Prompt Engineering
ACT AS an expert — role prompting primes the model's style, tone, depth, and vocabulary
More specific role = more calibrated response distribution
Y
"You are a (specific expert)" — shifting the probability distribution
Assigning a specific expert role shifts the model's underlying probability distribution toward text that expert would plausibly write, calibrating vocabulary, depth, and style accordingly.
Example: "You are a board-certified cardiologist" producing noticeably more precise, clinically appropriate language than the more generic "You are a medical expert."
T
The four-part template — role, context, task, format
An effective role-prompting template combines: You are a (specific expert). (Relevant context). (Clear task). (Desired format) — each part sharpening the model's response in a distinct way.
Example: "You are a board-certified cardiologist. A 55-year-old patient presents with mild chest discomfort. Explain the most likely causes. Respond in a bulleted list." combining all four template elements.
S
Specificity matters — dramatic differences from small changes
Even seemingly small differences in role specificity can produce dramatically different response quality and style — "board-certified cardiologist" versus the vaguer "medical expert" is a frequently cited illustrative example.
Example: the noticeably more precise, technically appropriate response produced by "board-certified cardiologist" compared to the vaguer, more generic "medical expert" framing.
P
System prompt vs. user prompt — where the role lives
A role can be set persistently as a system prompt (applying throughout an entire conversation) or included just within a single user prompt (applying to that specific task only).
Example: setting "You are a patient, expert Python tutor" as a system prompt to persist that role across an entire tutoring conversation, rather than repeating it in every single user message.
1
A user wants detailed, clinically accurate information about chest pain causes and tries two different role-based prompts.
2
The first prompt uses "You are a medical expert," producing a reasonably good but somewhat generic response.
3
The second prompt uses "You are a board-certified cardiologist," producing a noticeably more precise, clinically calibrated response with more specific, technically appropriate language.
4
This illustrates the core principle directly: a more specific role assignment shifts the model's response distribution toward more precisely calibrated, expert-appropriate language, even when the underlying question is identical.

Exams test whether you understand the mechanism behind role prompting (shifting the probability distribution toward text a specific expert would write) and whether you can apply the four-part template (role, context, task, format) to construct an effective role-based prompt.

The most common trap is assuming any role assignment works equally well, regardless of specificity. The "board-certified cardiologist" vs. "medical expert" example specifically illustrates that MORE specific roles produce MORE calibrated, precise responses — vague role assignments produce correspondingly vaguer calibration.

1. What does assigning a specific expert role do to the model's response distribution?
Shifts it toward text that expert would plausibly write, calibrating vocabulary, depth, and style.
Tap to reveal / hide
2. What are the four parts of the effective role-prompting template?
Role (You are a specific expert), Context, Task, and Format.
Tap to reveal / hide
3. Why does "board-certified cardiologist" produce a different response than "medical expert"?
Because the more specific role produces a more precisely calibrated response distribution, with more technically appropriate language.
Tap to reveal / hide
4. What is the difference between setting a role in a system prompt versus a user prompt?
A system prompt sets the role persistently for the entire conversation; a user prompt applies the role just to that specific task.
Tap to reveal / hide
5. Does role specificity meaningfully affect response quality, or is it a minor detail?
It meaningfully affects response quality — more specific roles produce more calibrated, precise responses.
Tap to reveal / hide