Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon What are the best practices for writing effective system messages


What are the best practices for writing effective system messages


Writing effective system messages is crucial for guiding AI models' behavior, ensuring safety, and improving output quality. Here are some detailed best practices for crafting these messages:

1. Define the Scenario**

- Model Profile and Capabilities: Clearly outline the model's role, capabilities, and limitations. This helps in tailoring the system message to the specific task and user needs.
- Specific Tasks: Define the tasks the model should perform, including the type of inputs it will receive and how it should process them.
- User Profile: Understand who the users are and what they expect from the model. This helps in customizing the tone and content of the system message.

2. Use Clear and Concise Language**

- Avoid Over-Complexity: Use simple, straightforward language to prevent misunderstandings. This ensures that the model interprets the instructions correctly.
- Be Concise: Shorter system messages perform better and do not occupy too much of the context window, allowing more space for user prompts.

3. Emphasize Key Elements**

- Use emphasis techniques like bolding or italicizing to highlight critical instructions or prohibitions. This helps the model focus on essential aspects of its task.

4. Implement Robustness and Consistency**

- Ensure that the system message is robust and consistent across different datasets and tasks. This involves testing the message with various inputs to ensure it performs as expected.

5. Use First-Person Language**

- Refer to the AI system using first-person language (e.g., "You are an AI assistant...") to create a clear persona and improve the model's understanding of its role.

6. Provide Examples**

- Include specific examples to demonstrate the desired behavior of the model. This is particularly useful for complex or ambiguous scenarios, helping the model understand how to approach them.

7. Define Tone and Scope**

- Specify the tone the model should exhibit in its responses. Also, clearly define the scope and limitations of the model's performance to ensure it knows how to respond when faced with tasks outside its capabilities.

8. Iterate and Test**

- Continuously iterate on the system message by testing different wording, ordering, and structures. This helps identify what works best for a given scenario and reduces potential harms.

9. Use Conditional Logic**

- Incorporate conditional logic (e.g., "If-Then" statements) to handle various scenarios and ensure the model responds appropriately based on specific conditions.

10. Consider Safety and Harm Prevention**

- Structure the instructions to prioritize safety and prevent harm. Clearly define what actions are allowed or prohibited to guide the model's outputs and prevent undesirable behavior.

By following these best practices, you can create effective system messages that guide AI models to produce high-quality, safe, and relevant outputs.

Citations:
[1] https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/system-message
[2] https://www.documind.chat/blog/technical-writing-best-practices
[3] https://cogniti.ai/docs/how-do-i-design-a-good-system-message/
[4] https://help.openai.com/en/articles/6654000-best-practices-for-prompt-engineering-with-the-openai-api
[5] https://www.prompthub.us/blog/everything-system-messages-how-to-use-them-real-world-experiments-prompt-injection-protectors
[6] https://stackoverflow.com/questions/403333/what-are-the-best-practices-on-the-level-of-details-in-error-messages
[7] https://atlassian.design/content/writing-guidelines
[8] https://pressbooks.bccampus.ca/technicalwriting/chapter/writinginstructions/