Role-playing instructs an LLM to assume a specific persona or role to generate more context-specific, relevant responses. By telling the model "You are a [role]," you activate knowledge and communication patterns associated with that role.
This technique leverages the model's training on diverse content to produce specialized, domain-appropriate outputs.