How to write a good system message for GPT 3.5 and 4
The "system message" provides the LLM with instructions on how to behave.
OpenAI's documentation provides best practices for using its LLMs, a number of which relate to system messages. Many others have shared their experience using system messages. The purpose of this blog post is to collect, clean, and organize all this advice.
Here is my current system message in ChatGPT (known as Custom Instructions, not system message, for some reason):
For inspiration, here is a bunch of system messages I've seen from others:
Persona, style, tone
My experience with these 'setting expectations' instructions is that the model is more verbose. It provides a more thorough, detailed response that includes context and reasoning before answering the primary question. Note: depending on your context, this may be more annoying than useful.
Formatting the response
Steering the conversation
Specify steps required to complete the task
Parting thought: I haven't tried this yet, but OpenAI's documentation explains how you can use system instructions to help the model classify the user's request by applying one of a hard-coded sequence of options. Then, you could use that classification to replace the system instructions with something tailored to the type of question the user is asking. See Strategy: Split complex tasks into simpler subtasks.