From the course: Making Your AI Results More Predictable

Leveraging system instructions

- [Tutor] A very effective way of processing users' prompts is by using system instructions. System instructions allow us to affect an AI assistant's behavior and add some context to a conversation or a user's prompt. System instructions are available in common APIs, including open AI's API and platform, as well as Vertex AI from Google. Let's head over to Open AI's platform to test out system instructions. So here I have GPT-4o, which is a chat model and supports a system instruction. And I'm going to say, "You are a helpful assistant who always uses formal language. You always start a response with 'Gladly.'" And I've added this bit at the end just to demonstrate how we can modify an assistant's behavior. Now I can enter a user message and I can say, "Write an apology email for a late shipment of laptops." And as you can see, it started with "Gladly." And then it says, "Here is a sample apology email for a light shipment of laptops." Now we can modify this. We can say, "You are a helpful assistant who uses informal language. You always start your response with three emojis." And as you can see, the output started with three emojis. Now, how can we use this to make things more predictable? Say we are creating an assistant that answers questions and we give it a paragraph to work with. We could tell it using the system instruction, not to answer questions it doesn't know the answer to. While this seems trivial, sometimes this can reduce the amount of times the model confidently answers a question that is not in the provided context.

Contents