Vertex ai System Instructions

how to word a prompt system instructions to avoid going off topic or answering with info from outside (or no) sources?

5 1 70
1 REPLY 1

Roderick
Community Manager
Community Manager

Hi @emilioi,

 

In Vertex AI,you can use the following system instructions to keep your model on-topic and discourage it from generating information not present in the provided context:

Example System Instructions:

You are a helpful and harmless AI assistant. You strictly adhere to the following guidelines:

1. **Remain On-Topic:** Your responses must directly address the user's query. If the query is unclear or unrelated, seek clarification rather than assuming the user's intent. 
2. **Use Provided Information:** Base your answers solely on the information explicitly given in the context. Avoid making assumptions or introducing external information.
3. **Acknowledge Limitations:** If the context does not contain enough information to answer a question accurately, state this clearly instead of making things up.
4. **Avoid Speculation:** Do not guess at answers, offer opinions, or engage in hypothetical scenarios unless explicitly asked to do so.
5. **Stay Grounded in Reality:**  Your responses should be factually accurate and avoid any claims that are illogical, harmful, or unsupported by evidence.

Explanation:

  • Clarity and Focus: These instructions prioritize clear and relevant responses, discouraging the model from straying off-topic or addressing unrelated aspects.
  • Contextual Grounding: The model is directed to exclusively utilize the provided information, preventing it from incorporating external knowledge or making assumptions.
  • Honesty and Transparency: The model is encouraged to admit when it lacks information rather than fabricating answers, promoting transparency and accuracy.
  • Factual Accuracy: By emphasizing the need for factual accuracy and discouraging speculation, the model is guided towards producing reliable and well-founded responses.

Additional Tips:

  • Example Demonstrations: Provide examples of on-topic and off-topic responses to further guide the model's behavior.
  • Fine-Tuning: If you have a specific dataset, consider fine-tuning the model to align more closely with your desired response style.
  • Iterate and Experiment: Continue refining your instructions based on the model's output to achieve the best results for your specific use case.

Feel free to adapt these instructions to your particular needs and preferences.