What this lesson is about
In this lesson we will look at how to give the model a task. The aim is to get a first result that is as close as possible to what we need. This is the last lesson of the course, so it brings together everything we have covered so far. That includes how the model writes an answer, what it sees in the request and what it knows on its own. We will also come back to tools, reasoning and checking.
The earlier lessons all come down to one idea. The model knows only what the request tells it about the task. Everything else it has to fill in with a likely continuation, meaning the one most typical of such texts. So the skill of giving a task is really the skill of telling the model in advance what it would otherwise have to guess.
First, we will run an experiment to see what happens when a request is missing information. Then we will look at the parts of a good task description: the goal, the materials, the limits, an example and the format of the answer. After that, we will talk about how to fix a poor answer. We will also discuss how to give a task to an AI agent that will work on its own. At the end of the lesson, as usual, we will draw conclusions and sum up the whole course.
What happens when the request lacks information
Let’s start with an experiment. We asked two models to write an email to a client about a delayed delivery. The whole task fit in one sentence: “Write an email to a client about a delayed delivery.” Both models wrote tidy emails, but they were not much use.
The first model’s emails had six placeholders in square brackets, such as [Client Name], [original date] and [Your Name]. The second model’s emails had eight and nine. The models did not know the order number, the dates or the client’s name. They honestly left blanks for them.
Knowing nothing about the situation, both models also added promises of their own. These promises sound natural, but they may not be true. The first model promised to “keep you informed of any changes” and wrote that the company is “working to minimize the delay.” The second wrote that its team was “closely monitoring the shipment” and would “notify you immediately” of any updates. Phrases like these are common in business emails, so for the model they are a likely continuation. But if nobody at the company is actually watching the shipment, an email with such a promise creates a problem for the company.
Then we gave the same task in detail. Here is the full request:
This time both models wrote emails of 93 to 99 words with all the facts in place. The only placeholder left in each was the sender’s name at the end, [Your name]. The request did not give that either. Such emails were almost ready to send. One of them, though, had a phrase we did not ask for. We will come back to it in the section on correcting an answer.
Hi [Client Name],
I’m writing to let you know that your delivery, originally scheduled for [original date], has been delayed due to [brief reason]. …
We’re working to minimize the delay and will keep you informed of any changes.
6 placeholders and a promise nobody made
Dear Laura,
I’m writing to let you know that Order No. 4512 for 40 coffee grinders for Copper Bean will be delayed. Our supplier’s shipment was held up at customs, so we cannot meet the promised November 18 delivery date. …
98 words; the only placeholder is the sender’s name
Excerpts from real GPT-6 Astra emails from the lesson’s test.
This experiment shows clearly how the request shapes the result. Without search or documents, the model cannot find out the missing facts about a specific situation on its own. We saw this in Lessons 3 and 4. Whatever the request leaves out, the model has to work around somehow.
With obvious gaps, such as the order number or the date, modern models often leave a placeholder. That is what happened in our experiment. Where a gap is less obvious, the model fills it with a likely continuation. And the likely continuation is usually the ordinary one: a template email, general wording and the promises such emails tend to make. A detailed request narrows the likely continuations down to those that fit this particular situation.
What a task description is made of
Let’s now look at the parts of the detailed request and why each one is needed. It helps to keep five parts in mind:
| Part | What it contains | Why it is needed |
|---|---|---|
| Goal | what the result is for and what should come of it | an email that must keep the client’s trust is written differently from a simple notice |
| Materials | the facts, documents and data the answer should rely on | the model knows nothing about the specific situation, and without materials the answer will have placeholders or made-up details |
| Limits | length, scope and what must not be done | they cut off continuations that are typical but unwanted, such as extra promises |
| Example | a sample of what the result should look like | the model picks up the style and structure of the text directly from the request |
| Format and tone | the form the answer should take (a table, a list, the subject line and text of an email) and the tone to write it in | the result is easy to use right away |
Our request had every part except the example, which we will come to a little later. Not every task needs all five parts. For a simple request, one sentence is often enough if everything needed is clear from it or from the earlier conversation. But the more the result matters, and the more details the model cannot guess, the more each part helps.
It is worth looking more closely at the materials and the example. Materials are the most important part of any task that needs exact information. As we saw in Lesson 4, the model reproduces information from the request much more accurately than it recalls facts from memory.
An example often explains a task better than any description. Suppose you show the model several emails the company has already sent to clients. It will pick up their tone, length and phrasing more accurately than from the words “write politely and in a businesslike way.” This is the same mechanism we discussed in question 6 of Lesson 1: the model picks up the phrasing of an email you paste in. But the model may copy an example too literally, down to individual phrases. This is why it helps to give several different samples and to say plainly what matters in them.
Order matters too. If the task comes with long materials, it is better to put them first and the task and requirements after them. If the materials are very long, it also helps to name the task briefly before them. Then the model reads the task with everything it needs already in front of it. And the requirements do not get lost in the middle of a long text, as happens in the long conversations from Lesson 3. Anthropic’s guide describes the company’s tests on large documents. A question placed after the documents produced answers up to 30 percent better than one placed before them.
Finally, if the model may not have some of the information, it helps to let it say so or ask a question. The sentence “If any information is missing, ask” gives the model this permission. It can then point out a gap instead of filling it with a plausible invention, like the promises in our first experiment.
Did you know? should you give the model a role
Many people begin a request with a role: “You are an experienced lawyer.” A role can indeed help, because it sets the focus and tone of the answer. But it adds no information about the task. From a role, the model learns neither the facts of the situation nor the requirements for the result. This is why a role tied to the task is more useful: “Review the contract as the buyer’s lawyer and find the terms that are unfavorable to the buyer.” You still need the goal, the materials and the limits.
How to correct an answer
Even a well-described task does not always get the right result on the first try. Let’s return to the email. In one of its two runs with the detailed request, the second model ended the email like this: “Please confirm that November 25 works for you. If it does not, let me know so we can agree on another date.” This sounds polite, but the company has no other date to offer, so the offer will raise false expectations.
The facts in the request contained no such promise, so the model broke one of the limits we set. Most likely, the goal “agree on a new date” pushed it there. This goal can also be read as permission to offer a choice. This case shows how vague wording in one part of a request can clash with another part.
There are two ways to fix this. We can write something like “Not quite right, redo it.” Or we can say exactly what is wrong: “Do not ask the client to choose another date. We have no date other than November 25. Only ask them to confirm November 25. Leave the rest of the text unchanged.”
We tested both ways, twice on each of the two models. Then we compared how many words from the first version of the email were left in the second.
In our tests, after the precise correction, the models changed only the closing request and kept 87 to 96 percent of the words. After “Not quite right, redo it,” they rewrote the email almost from scratch and kept only 38 to 50 percent of the words. That makes sense. The model does not know what exactly we disliked, so it guesses. The good parts may disappear along with the unwanted phrase, and a new mistake may appear in its place.
| How we asked | Kept |
|---|---|
| A precise correction | 87–96% |
| “Not quite right, redo it” | 38–50% |
Two models, two runs for each kind of correction. The bar shows the average.
Sometimes the unwanted phrase stays. In one of our tests, the first version ended with “If not, please let me know so we can discuss the next steps.” The rewritten one ended with “If it does not, let me know and we can discuss the options.” The extra offer survived the rewrite in another form.
This gives us a rule: when you correct an answer, say exactly what is wrong with it. Name the specific place, explain why if it is not obvious, and say what should stay the same. If the corrections pile up or the model gets confused, start a new chat with a corrected task description. That works better than carrying on a long conversation. As we know from Lesson 3, failed attempts in the conversation history keep affecting the answers.
There is one more way: correct your own message instead of the answer. In many chat apps, you can edit a message you have already sent, including an earlier one. The model will then answer it again. Nothing that came after that message goes into the new request, so the failed answer no longer affects the next ones. In Claude, for example, this creates a new branch of the conversation. The old branch is kept, and you can go back to it.
This approach is especially useful when the mistake grew out of the task description itself. That was the case with our email, where a vague goal led the model to an extra promise. Just clarify the goal in the original message, and the model will write the email again from the corrected task. If the task is fine but the answer is not to your liking, ask for another version with the retry button. As we know from Lesson 1, the model gives a different answer each time.
How to give a task to an agent
Everything we have said so far also applies to agents, but the task description for an agent has some features of its own. An agent works through many steps in a row with no person involved. It cannot always stop to ask for clarification along the way. This is why two things matter especially for an agent: the completion criterion and the boundaries. In an ordinary chat, people often take both for granted.
The completion criterion answers the question of how to tell that the task is done. As we saw in Lesson 5, the agent decides on its own when to stop. Its message “done” is only text written by the model. So it helps to say in advance what the result should be and how to check it.
For example, instead of “fix the error in the report”, it is better to write: “Fix the error in the report’s total. The task is done when the sum of the column matches the total row. At the end, show both numbers.” Such a criterion can be checked, and the agent can check its own work against it before it finishes.
Boundaries define what the agent may and may not do. They cover which files and services it may touch and whether it may delete or send anything. They also cover what to do if the task turns out to be harder than expected. Some boundaries are set by the permission settings we discussed in Lesson 5. But they are also worth stating in the task itself, for example:
- “Work only with the files in this folder.”
- “Do not send anything, only prepare a draft.”
- “If the task turns out to be broader than described, stop and ask.”
Finally, it is worth asking the agent to end with a report that is easy to check. The report should say what was done, what was checked and how, and what failed or is still uncertain. Such a report does not replace checking the result. It does show you where to look first.
If an agent always works on the same project, there is no need to repeat the general rules in every task. The model does not remember past sessions. So people put these rules in a file of standing instructions in the project folder. This file is most often called AGENTS.md. Most coding tools read it before they start work and add its text to the request, just as the chat app adds the system prompt.
This file contains what is true for any task in the project: how to run and check the work, which conventions the project follows, and what must not be touched. Like the personal instructions from Lesson 3, it should be short and specific.
What follows from this
Let’s sum up the lesson. The model knows about the task only what is in the request. It may mark obvious gaps with placeholders or ask about them. Everything else it fills in with a likely continuation, which means an ordinary one. The skill of giving the model a task comes down to three rules.
First, a good task description tells the model what it would otherwise have to guess. Such a request has five parts: the goal, the materials, the limits, an example and the format. The more the result matters, the more each part helps.
Second, when you correct an answer, say exactly what is wrong with it. A precise correction usually changes what needs changing and leaves the rest alone. The corrected version is still worth checking, though. A plain “redo it” makes the model guess all over again.
Third, an AI agent needs more than the task itself. It also needs a completion criterion, boundaries and a report that is easy to check. The agent works on its own, so its message “done” proves nothing by itself.
Course summary
This is the end of the course. Let’s gather the main ideas of all eight lessons in one table:
| Lesson | Main idea | What it means in practice |
|---|---|---|
| 1. How a language model writes an answer | the model continues the text, choosing tokens by probability | a confident tone tells you nothing about whether the answer is correct |
| 2. Tokens | the model sees text as a sequence of tokens from its vocabulary | check exact counts and text length; API prices and many usage limits are counted in tokens |
| 3. Chat and memory | the model stores nothing, and the chat app sends it the conversation each time, in full or shortened | a long conversation can get worse over time, and a new chat starts with a clean slate, apart from the memory feature |
| 4. What the model knows | knowledge from training is uneven and stops at a certain date | exact facts are more reliable when you give them in the request |
| 5. Tools and agents | the model asks for actions, and the program carries them out | limit the agent’s permissions and check its report |
| 6. Reasoning | reasoning is a draft made of the same tokens | it helps with multi-step tasks but does not prove the answer is correct |
| 7. Checking the result | model mistakes are predictable | check in proportion to the cost of a mistake, and ask the model to show what its answer is based on |
| 8. How to give the model a task | the model knows only what the request tells it about the task | give the goal, materials, limits, an example and the format |
All these ideas follow from the principle we started with in Lesson 1: the model predicts how the text continues, over and over. Keep this in mind, and most of its behavior stops seeming strange. Working with it also becomes noticeably more predictable.