Prompt — this is the text you write to the model so that it can understand what you want from it. For example, if you ask the model to write a poem about spring, that will be your prompt.
Prompt Engineering — is the skill of creating queries that will help you get the right response from the model. If you craft a good query, the model will be able to give you a more accurate and useful answer.
AUTOMAT is an acronym that helps structure a proper prompt for an AI model. It consists of the first letters of seven main rules for creating a query.
Briefly specify what role the bot will be acting in. Define the role as precisely as possible, avoiding vague formulations.
| Correct | Incorrect |
|---|---|
| Act as a technical support agent. Your name is John, you are a technical support agent at "Acme Corp" and an expert in meat products. | Act as a helpful and smart assistant. |
Describe the user’s persona: their knowledge level, age, profession, etc.
| Correct | Incorrect |
|---|---|
| - Explain as if speaking to someone with a technical degree. - Explain as if speaking to a 5-year-old. - Explain as if speaking to a small business owner in the food industry. |
- Explain to the user. - Explain to me. |
Use verbs that clearly convey how the response should look.
| Correct | Incorrect |
|---|---|
| - Summarize; - List; - Translate; - Classify; - Explain; - Extract; - Format; - Comment; - Document the code. |
- Answer the question; - Write; - Give me an answer. |
Clearly describe the format and, if necessary, the length of the response.
| Correct | Incorrect |
|---|---|
| - A step-by-step list; - Formula; - Table; - Code in Python; - JSON; - A floating-point number between 0.0 and 1.0; - A recipe with ingredients for 4 people; - A list of two-letter country codes by ISO; - User intent as one word from a list; - Max in 3 sentences. |
- Answer; - Text; - A few sentences. |
Specify the style and tone of the response. Do not describe styles that are assumed by default.
| Correct | Incorrect |
|---|---|
| Compassionate, confident, aggressive, in a pitiful tone, sarcastic, witty, stuttering, in the style of legal text. | Friendly, neutral, intellectual. |
Describe rare examples that deviate from the norm. Specify how to handle such cases.
| Correct | Incorrect |
|---|---|
| If the client’s intent does not fall into any of the categories ('buy', 'sell', 'consult', 'operator'), assign the default intent. |
The intent may not fall into the listed ones. |
Describe the list of allowed and prohibited topics to keep the bot within its role.
| Correct | Incorrect |
|---|---|
| Do not touch on topics of politics or religion, answer only within the scope of questions about the company and nothing else. | Don’t touch on politics or religion. |
CO-STAR is a method for crafting prompts for AI models, helping you get the most precise and useful responses. The method includes six key aspects:
The accuracy and quality of the responses largely depend on how well the prompt is formatted and structured. Symbols like ### in prompt examples are part of the formatting that helps highlight key sections and organize information in a way that’s easy to understand. Without clear structure and formatting, the query might be misunderstood, leading to less precise responses.
Below are rules that will help create effective prompts.
Describe the main instruction for the query. In this section, include the main prompt and refer to other sections of the query as needed. For example:
Instead of:
You can specify:
Add a few example dialogues to illustrate how the ideal response should look. Be sure to note that these are just examples, not all possible dialogue variations, so that this rule doesn’t override the “Context” section.
Describe the context of the query. Define the allowed and prohibited topics and areas within which answers should be provided.
Describe the format of the response, or the entire dialogue in roles, indicating what the bot or client might say in each role.
The query should include either a "Dialogue History" section or a "Task" section, but not both at once.
Dialogue History — the current dialogue history in roles, where the last message is the client’s question to which the bot must respond.
Task — the specific question or task that needs to be answered according to all the rules above.
### Instruction ###
Act as a patient teacher for elementary school students. You are a teacher named John and a biology expert. You grew up in New York and are 25 years old.
In the last response, your student answered a question on the topic of "current data context." You are evaluating and commenting on their answer. Encourage them in your evaluation, even if the answer was partially wrong.
Be positive, funny, personal, and use emojis — make learning fun for the kids. Only talk to students about biology within the scope of the “current data context.”
The dialogue history is located in “Dialogue History.” Continue the dialogue from the history and be ready to keep it going.
### Example dialogues ###
Note: The example dialogues are based on information from other sections of the textbook, not necessarily part of the “current data context.”
Example #1
<John> Hi, Mike, it’s John again. Today we’ll talk about living beings, like plants and animals. Are you ready?
<Mike> Yay!
<John> Let’s go. Can you name two reasons why most plants have roots?
<Mike> To get water from the soil and so they don’t fall, and for minerals from the soil.
<John> That’s great and correct! And it’s actually three reasons! John is very proud of you.
<rating> 🌟🌟🌟🌟🌟
<John> Next question: Can you tell me what the function of leaves in plants is?
<Mike> They do photosynthesis, making food for the plant from water, oxygen, and light.
Example #2
<John> Hi, Nancy, today we’ll talk about plants. Ready?
<Nancy> Ready!
<John> Great! Here’s your question: What happens to plants when frost comes?
<Nancy> They die.
<John> That’s partially correct, Nancy. During frost, plants can’t grow, but some plants can adapt, allowing them to survive at low temperatures.
<John> Next question: Why are plants important for Earth’s organisms?
<Nancy> They produce food and oxygen for other organisms.
### Current data context ###
Life without plants? Impossible! Life on Earth would be impossible for us without plants. Plants provide oxygen. We need them, but what do plants need? Plants need light, carbon dioxide, and water to make their own food.
### Output details ###
# Evaluate the student's response
<John> [Give the student a very friendly evaluation. Tell the student if their answer was correct, partially correct, or incorrect. Tell the student what was missing from their answer. If the answer was incorrect, partially incorrect, or incomplete, explain what the correct answer would be.]
<rating> [Rate the answer on a scale from 1 to 5 stars. 1 — completely wrong, 5 — perfect.]
# Ask the next question
<John> [Ask the student the next question they should answer. Only ask questions on the topic of the "current data context."]
### Dialogue History ###
<John> Hi, Nancy, today we’re talking about plants. Ready?
<Nancy> Ready!
<John> Great! Here’s your question: What happens to plants when frost comes?
<Nancy> They die.
<John> That’s partially correct, Nancy. When it’s cold, plants can’t grow, but some plants can adapt, allowing them to survive at low temperatures.
<rating> 🌟🌟🌟
<John> Next question: Why are plants important for Earth’s organisms?
<Nancy> They produce food and oxygen for other organisms.
Approximately 250 tokens are used in the response.