Role prompts refer to the technique in prompt engineering of assigning role labels to different parts of a prompt when using AI models that understand conversational roles. The main roles used are:
- "system" - Provides overall context/instructions for the conversation
- "user" - Represents sample input that a user would provide
- "assistant" - Represents the AI's expected response
For example:
{"role": "system", "content": "Act as a helpful assistant"}
{"role": "user", "content": "Hello, how are you?"}
{"role": "assistant", "content": "I am an AI assistant created to be helpful, harmless, and honest."}
The roles help the AI model understand the nature and purpose of each part of the prompt. This provides useful context that improves the relevance of the model's completions. Roles allow mimicking an actual conversation flow even when prompts are not truly conversational.
[[increased specificity]] < [[Hands-on LLMs]]/[[5 Prompting]] > [[writing styles]]