Writing instructions in Pulse

In this article, we'll explain how to optimize your chatbot's results by writing good instructions.

A language model is an AI-based text generator. An 'instruction' is a command or question given to a language model or chatbot to perform certain behavior, also called a 'prompt'. 'Prompt engineering' is a relatively new technique for developing and optimizing instructions. Using this technique, large language models can independently complete or write texts. By just adding knowledge, you're not there yet! The language model (GPT) cannot read your mind. After adding knowledge, your chatbot does not yet know how to deploy or use this knowledge. Therefore, it is important to clearly name your requirements in the instructions. Instructions allow the chatbot to tailor the knowledge it has to your company, products and services. You create the framework and leeway within which the chatbot is allowed to operate.

General tips & tricks

  • Be clear and concise: Formulate your instructions in a clear and concise manner so that the chatbot can easily understand and follow the instructions.
  • Provide context: Ensure that your instructions provide sufficient context to the chatbot. This helps the chatbot provide accurate answers based on the specific situation. 'Don't tell, but show': demonstrate the chatbot how to handle provided information. You can do this by giving the chatbot examples of questions and answers, by adding this to a specific instruction:

Example:
User: [question of the user]
Assistant: [what you want to see the chatbot respond to the questions]

  • Be specific: Give detailed instructions to the chatbot, especially when it comes to specific tasks or interactions with users. Avoid vague or general instructions that can lead to misunderstandings. The chatbot takes instructions very literally!
  • Consider different languages: If your chatbot is multilingual, ensure that your instructions and instructions are consistent with the user's language. Set up language-specific instructions if necessary to ensure the chatbot responds correctly. You can find additional information on making your chatbot respond in different languages in this article.
  • Test and improve: Experiment with different instructions and regularly test how the chatbot responds. Adjust the instructions based on feedback and learn from interactions to improve the chatbot's performance.
    In some cases, a change in an instruction will lead to a better answer to a specific question, but that does not mean that better answers will be given to all other questions. Therefore, it is important to ask multiple test questions to determine results.
  • Stay up-to-date: Regularly update your instructions updated with the latest information and developments in your company or industry. This ensures that the chatbot provides relevant and up-to-date answers.
  • Be friendly and empathetic: If the chatbot is customer-oriented, consider adding instructions that are friendly and empathetic. Let the chatbot show understanding and provide supportive responses to enhance the user experience. Implement this not only in the domain knowledge/personality but also in the instructions.
  • Use positive language: For example, use phrases like "you can" or "you say A when asked B" instead of "you cannot" or "you don't answer question B".
  • Monitor and analyze: Keep a close eye on the chatbot's interactions and analyze the provided answers. Identify patterns, frequently asked questions, and possible areas for improvement. Use these insights to optimize the instructions and the chatbot's performance.

By following these tips, you can create effective instructions that help your chatbot communicate better and support users in an appropriate and useful manner.

Do not perceive the entered instructions as strict rules, but rather as helpful guidelines that assist the chatbot in adjusting its behavior. By modifying instructions, experimenting with changes in those instructions, and testing the implemented modifications, the chatbot can be better aligned with the desired outcomes. Keep in mind that the chatbot may occasionally not provide the exact answer you want to see, but it is possible to achieve this by making the right adjustments in the instructions.

Watch this video:

Domain knowledge

Standard instructions necessary for a successful chatbot are referred to as "domain knowledge". This includes personality, company information, service, and other relevant aspects. By writing these instructions, you provide context to the chatbot and instruct it on how to respond to certain questions or texts.

We recommend filling the personality and company information instructions with the chatbot's personality (tone of voice) and information about the company it represents. The service and other instructions can also be filled with other relevant information.

 

Examples of instructions in personality

Here are some examples of instructions to fill the chatbot's personality. Of course, you can customize these instructions according to your preferences.

  • You are chatbot XXX and work at XXX as XXX. You answer all questions from XXX's customers asked online. You are XXX.
  • You use informal but professional language. 
  • You speak on behalf of XXX in the first-person plural form.
  • As XXX, you only discuss topics related to XXX. If you receive a question, comment, or input that doesn't pertain to XXX, respond with "That's an interesting question, but I can't help you with that. Do you want to know something about XXX?"
  • Your answers consist of a maximum of 30 words.
  • You only discuss and provide advice on products and services from XXX's assortment.
  • You use emojis that are appropriate for the given answer.
  • You enjoy making jokes about XXX.
  • You may end the conversation with a joke about XXX but first ask if the user wants to hear one.

Instructions and frames

In addition, you can give the chatbot other instructions. It is important to realize that merely adding knowledge does not yet outline proper instructions for the chatbot. You can truly see your chatbot as a new colleague. You also teach a new colleague what their scope of action is, what the tone of voice is used within the company, the processes for certain issues, and what information can or cannot be shared.

We will also teach these principles to the chatbot. This ensures that the chatbot only responds to questions about your company, rather than endorsing competitors or providing information on topics unrelated to your business.

Below, we provide various examples of instructions to guide your chatbot with these guidelines and frameworks.

 

Limit to company information instruction

When you don't define boundaries, your chatbot has the knowledge of the entire internet. This means it can respond to various questions (what is football? what is a cow? who is your biggest competitor?). Of course, we don't want your chatbot to endorse the competitor. Also, providing answers on topics unrelated to your company, products, and services can be sensitive. Therefore, we instruct the chatbot not to discuss other subjects. We do this by adding the following instruction:

As chatbot XXX, you don't talk about topics other than XXX. If you receive a question, comment, or input that doesn't pertain to XXX, respond with 'That's an interesting question, but I can't help you with that. Do you want to know something about XX?'"

You can customize this instruction according to your wishes.

 

Decision tree instruction

A commonly used instruction is the "decision tree" instruction, which allows the chatbot to ask follow-up questions. You can set it up as follows: "If the visitor says A, the chatbot responds with B". Here's an example:

If someone asks about the whereabouts of their package, ask for the order number. If the order number starts with 1-, inform them that the tracking code can be found in the order confirmation email. If the order number starts with 2-, advise them to call customer service for the order status. If the order number starts differently, inform them that the order is not recognized in the system.

User: Where is my package? Assistant: I'm here to help! What's your order number? User: ORDNR345 Assistant: The tracking code can be found in the order confirmation email you received!

User: ORDER286 Assistant: I recommend calling customer service to get the most up-to-date status.

User: Another number Assistant: This order number is not familiar to me and is not recognized in our system.

 

Adding links and generating hyperlinks

It's also possible to set which hyperlinks the chatbot can send in the instructions. You can learn how to do this in this article

 

Disclaimer in advice instruction

In some cases, it's important for the chatbot to clearly identify itself as an AI assistant and indicate that the advice given is not binding. We provide this instruction to the chatbot as well. Let's use a medical clinic as an example. An instruction could be:

When someone shares a complaint, provide advice by sharing the most relevant links with solutions. Always mention that you are a digital assistant, and your advice is not binding. Always advise consulting a doctor if the symptoms persist.