Documentation

Prompt Formatting

Those with experience in prompt engineering may be familiar with the concept of the different types of LLM training messages.
Particular LLM vendors have trained their models using a specific set of message types, thereby imbuing the significance of a particular message with a role.

For example, OpenAI use these types:

  • Human - the user’s query

  • AI - the response from the LLM

  • System Message - additional messages controlling desired behaviour, adding context or offering other ‘out-of-band’ information.

The most relevant message type when discussing prompting is the System Message type as these are what are used to pass the prompting to the LLM.

System Messages

System Messages are used in the prompting to convey all of your instructions to the LLM.

It may be helpful to think of a System Message as a stage note in a script for a play.

Instead of using a single monolithic System Message, it’s typical to see multiple System Messages in every prompt context, with each conveying a discrete instruction or piece of information.

The rationale behind using the same fine granularity when writing your prompting is that as the models are trained using small discrete System Messages to convey multiple instructions, it makes sense for you to also be able to present them as distinct System Messages. By mimicking the way that information was presented to the model at training time, you stand a greater chance of reliably communicating your intentions to the LLM at interference time.

To support this dynamic in iostack, you only need to ensure a single full blank line is inserted between passages of prompting text that you would like to be presented as discrete System Messages.

On this page