Message Roles
What are message 'roles' and how should you use them?
There is usually some confusion around the different message roles: system, user, and assistant. This is especially true because each model approaches these roles differently. Some models don't accept a system message, and some only accept a system message if a user message is combined.
If you are new in the world of LLMs, the easiest way to get started is to to put your prompt inside a
user
message. All models will work with just auser
message.
System role
- Purpose of system messages:
The system role is specifically designed to provide instructions and set the context for the AI assistant's behavior. It allows you to define the role, goals, and overall framework for the conversation without making it part of the visible dialogue. - Influence on model behavior:
System messages have a stronger influence on the model's behavior compared to user messages. They are interpreted as high-level instructions that should guide the entire conversation, whereas user messages are seen as part of the ongoing dialogue. - Persistence and priority:
System messages are typically given higher priority and are less likely to be forgotten or overridden during long conversations. They serve as a constant reminder of the AI's role and expected behavior.
User role
- The user role represents the individual or entity interacting with the LLM. This role is used to indicate that the message is coming from the end-user who is asking questions, providing input, or requesting information from the model.
Assistant role
- The assistant role represents the AI language model's responses in a conversation. It's the part of the dialogue where the AI provides information, answers questions, or completes tasks based on the user's input.
Updated 20 days ago