CONCEPT Cited by 1 source
Role prompting¶
Definition¶
Role prompting is the LLM prompt-engineering technique of assigning the model a specific persona, domain role, or expertise frame — typically via the system prompt — to condition its response style, vocabulary, reasoning depth, and implicit world model.
The canonical external reference is Anthropic's guide on system prompts and role assignment, cited directly by the Expedia STAR post as one of three named prompting techniques (alongside prompt chaining and generated knowledge prompting).
Examples¶
- "You are a senior reliability engineer investigating a Kubernetes container-restart incident ..." — STAR-style.
- "You are a SQL expert; prefer set-based solutions over loops ..." — data-engineering prompts.
- "You are a legal analyst reviewing a contract for ..." — domain-expert framing.
The role need not be plausibly human; it is a conditioning signal, not a biographical claim.
Why it works (in practice)¶
- Activation conditioning. The role frames the model's inferred distribution over relevant vocabulary, tone, and reasoning patterns — the model samples from the part of its learned distribution that matches the role's typical output.
- Precision in ambiguous domains. When a single word has multiple technical meanings (e.g. "latency" in networking vs databases vs CPU microarchitecture), the role disambiguates.
- Output-format priors. Roles carry implicit output-format conventions — a "senior SRE" tends to emit bullet lists with severity labels; a "technical writer" emits prose with explicit summary.
Composes with¶
- Prompt chaining — each chain step can have its own role. STAR uses per-metric analyst roles at step 2 and a higher-order "RCA engineer" role at step 3.
- Output-format constraints — see patterns/system-prompt-role-plus-output-format-constraint. The Pre-existing wiki pattern canonicalises the role + output-format-spec combination as the prompt-engineering bedrock.
Caveats¶
- Role prompting ≠ fine-tuning. The role is a prompt-time conditioning; the model hasn't been trained on in-domain data. Expect gaps on specialised terminology that the pretraining data didn't cover.
- Role prompting ≠ authority. The model can still hallucinate confidently within the assumed role — the role doesn't make the output true.
- Role drift. In long chains the role can decay; re-state it per step or per system prompt rather than relying on the initial system prompt to persist.
Seen in¶
- Expedia STAR (2026-04-28) — STAR's prompt engineering explicitly names role prompting (per the Anthropic guide) as one of three core techniques, used per step in its multi-step telemetry-analysis chain.
Related¶
- concepts/prompt-chaining — the sibling technique STAR cites; roles compose per-step inside a chain.
- concepts/generated-knowledge-prompting — third in the STAR trio.
- concepts/context-engineering — role prompting is a lever within the broader discipline.
- patterns/system-prompt-role-plus-output-format-constraint — the wiki-canonical pattern that pairs role prompting with output-format constraints.
- systems/expedia-star — canonical wiki consumer.