Predicting vs generating
Lesson 3 of 89 in AWS Certified AI Practitioner (AIF-C01) Exam Prep. Free to read, no account needed.
Predicting and generating
Every AI task produces some output. Predicting means the AI reads an input and returns a judgement or a number about it, such as how likely a card payment is to be fraud. Generating means the AI writes something new that did not exist before your prompt, such as a drafted reply to a customer. Knowing which one a task does tells you what kind of answer to expect and how to check it.
The output-shape test
Look at what comes back. If the answer is a fixed judgement or score picked from a set of possible answers, the task is predicting. If it is open-ended new text or media, the task is generating.
Take a ₹2,400 card payment. A predicting task returns a fraud score of 0.93 on a scale from 0 to 1, one number from a known range. A generating task, given the same payment and a prompt asking for an explanation, returns a paragraph of sentences that nobody wrote before. The input is the same kind of thing; the shape of the output is what differs.
ChaiCart's two AI jobs
ChaiCart uses AI for two jobs that look alike from the outside. The card-fraud check reads a payment and returns a score, which is a predicting task. The support chatbot reads a customer’s prompt and writes a reply through a foundation model hosted on Amazon Bedrock, which is a generating task.
| Task | Input | Output | Type |
|---|---|---|---|
| Card-fraud check | ₹2,400 payment from a new device | Fraud score 0.93 (0 to 1) | Predicting |
| Support chatbot | Prompt: “My tea order arrived broken, what now?” | A drafted reply of several sentences | Generating |
Yes or no answers
A generating task can be asked for a short answer. Suppose the prompt is: “Does this message ask for a refund? Answer yes or no.” The response is “Yes.” That looks like a fixed judgement, but the foundation model produced those words from the prompt, one word at a time, so the task is still generating.
The type comes from what the task is built to produce, not from how short the answer looks. A fraud score is predicting even though it is a number, and a one-word “Yes” from a chat model is generating.
Spot the task type
ChaiCart has two tasks for Aarav, who has not ordered in 60 days. Task A asks how likely he is to stop ordering, and the answer is a number from 0 to 1, for example 0.78. Task B asks for a friendly message to win him back, and the answer is a new message written from scratch.
Question: which task is predicting and which is generating? Answer: Task A is predicting, because it returns a judgement about Aarav as a score from a known range. Task B is generating, because it writes new text that did not exist before the prompt.
Reading is not predicting
People often assume that because a model reads a long complaint, its job must be predicting. Reading the input says nothing about the output. A complaint such as “my masala chai arrived cold and I want a refund” can be summarised in a new sentence, and that summary is generating. Sorting the same complaint into a fixed set of labels, such as low, medium or high priority, is predicting.
| Wrong thought | Right check |
|---|---|
| It reads the complaint, so it predicts | Look at the output: a new summary is generating |
| It sorts the complaint, so it generates | Picking one of a fixed set of labels is predicting |
Lessons in AI In One Support Chat
- One customer question answered by a foundation model
- Prompt and response
- Predicting vs generating
- Ai that assists human decisions
- Training data vs new inputs
89 lessons across 10 topics. See the full course