System Messages
A system message is provided to a model at the beginning of a conversation to dictate how the model should behave throughout. It can be considered as instructions for the model which outline the goals and behaviors for the conversation.
Writing a custom system message
While prompting is a natural way to interact with and instruct an LLM, writing a custom system message is a shortcut to direct the model’s behavior. Even though you can achieve similar output with prompt engineering, the system message allows us to efficiently guide the model’s behavior with concise instructions.
Default system messages differ from model to model. For example, the default system message in the Command R model is:
💡 Default System Message for Command R and Command R+
“You are Command. You are an extremely capable large language model built by Cohere. You are given instructions programmatically via an API that you follow to the best of your ability.”
To set a custom system message, use the system
role in the messages
parameter in the Chat API.
Advanced Techniques for Writing a System Message
The Command R model responds particularly well to system messages that follow a specific structure and format. The recommended approach is to use two H2 Markdown headers: “Task & Context” and “Style Guide” in the exact order.
- Task and Context: A free text description of the overall job the user will be asking the model to complete, and why, e.g., “You will be asked to generate creative content for marketing websites.”
- Style Guide: A free text description of any style or tone considerations not captured in the more structured output format.
Copy this template for best results in your custom system message.
Example System Message 1
Example System Message 2
Failure to adhere to this format, with two specific headers denoted in Markdown H2 may result in degraded model performance.
Specifying a Date
Adding the date to the system message can be useful for handling time-sensitive tasks, such as “Who won the game last night?“. We recommend formatting the date to be as human readable as possible. Here is an example system message including the date:
System message with date
“You are Command. You are an extremely capable large language model built by Cohere. You are given instructions programmatically via an API that you follow to the best of your ability. Today’s date is Tuesday, March 26, 2024 11:14:59”