# Mission 1.2: Which lead will buy, and is this a job for a language model?

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/einsatz-1-2

Belongs to [Chapter 1: What AI is](https://llm.yoga/en/01-was-ist-ki.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Nora**, sales operations:

> “I have a CRM export with all the leads from the last few years: industry, headcount, how often they visited our pricing page, whether there was a meeting. And for each one it says whether an order came in at the end. I want to know which new leads are likely to buy. Should I just copy the table into a chatbot?”

A CRM is the sales team’s customer database; leads are prospects who haven’t bought yet. That gives Nora something valuable: the right answer for every past case. Decide what you advise her.

**Question 1 (decision):** Which route do you recommend to Nora?

- A) Yes, a chatbot will spot in the table who is likely to buy.
- B) A learning method that learns from the past leads and how they turned out.
- C) A method that sorts the leads into similar groups on its own.

## What’s behind it

A child learns to tell dogs from cats by seeing many animals and hearing the right word each time. It couldn’t write down the rules behind it. That’s how **machine learning** works: the method derives its rules from examples instead of a person programming them.

There are three basic forms. They differ in what feedback the method gets. In **supervised learning**, each example comes with the right answer, the label. In **unsupervised learning** there are no labels, and the method looks for patterns on its own, such as groups of similar customers. In **reinforcement learning**, a program acts and then gets a reward or a penalty.

Nora’s case is supervised learning. The CRM export becomes **features**: headcount as a number, industry as a category, pricing page visits, meeting yes or no. The label is whether an order came in. With enough past cases, a model learns which combinations point to a closed deal. The limit: it only finds patterns that are in the fields. That the contact person is about to quit isn’t in any field.

The prediction itself is not a job for a language model. It learned how text continues, and it learns nothing from Nora’s data when asked (mission 1.1). It would still deliver a number, but one guessed word piece by word piece. A language model is useful in two other places. An assistant that is allowed to write and run programs can program the learning method for Nora, and the prediction then comes from that method. And a language model can pull details out of free text in the CRM, such as call notes, which then go into the learning method as a feature.

### In more detail: what deep learning changes about features

A classic method only gets the columns a person has chosen. A deep neural network gets the raw data almost unprocessed, such as the pixels of an image or the tokens of a text, and learns the useful features in its inner layers on its own. That’s why language models can handle any text.

Two typical tasks of supervised learning: classification (which class does something belong to, such as “buys” or “doesn’t buy”) and regression (which number comes out, such as a deal value).

## Try it

**Sort: which kind of learning is behind it?**

**Task:** Match each project to a kind of learning. Pay attention to what feedback the method gets.

Categories: supervised · unsupervised · reinforcement

1. Split the customer list into groups with similar buying behavior, without defining the groups in advance.
2. Learn from past leads marked “bought” or “didn’t buy” which new lead will buy.
3. Refine a chat model: people compare two answers and say which one is better.
4. Estimate how much a new offer will bring in, based on past offers with a known deal value.
5. Find products that are often bought together.
6. A program learns a game by trying moves and getting points after each match.

## Check

**Question 2 (check question):** A colleague only has company data on the leads, with no note on whether they bought. What can a learning method do with that?

- A) Predict who will buy, just a bit less accurately.
- B) Find groups of similar leads, whose meaning a person then judges.
- C) Learn by trial and error which lead will buy.

**Question 3 (check question):** The CRM also has a field with free-form call notes. What is a language model good for there?

- A) Nothing; free text can’t be analyzed in any meaningful way.
- B) It predicts the close rate from the notes, without any past cases.
- C) It pulls out details, such as whether a budget was mentioned, as a new column.

**Question 4 (check question):** The model says lead X is very likely to buy. The salesperson in charge knows that his contact is about to quit. Whom do you believe?

- A) The salesperson, rather; the resignation isn’t in any field.
- B) The model; it analyzed thousands of past cases.

## Done

**What you can do now**

- You recognize supervised, unsupervised and reinforcement learning by the feedback the method gets.
- You can explain to Nora that her question is a classification with features and labels, and that the prediction comes from a learning method, not from a language model.
- When someone wants to copy a table with an outcome column into a chatbot to predict deals, you suggest a classic learning method and use the language model for the free-text fields, or have an assistant program the method.

### Two cards for review

**Card 1:** A support team has thousands of old tickets, each marked with whether it was escalated. It wants to predict which new ticket will escalate. Which kind of learning fits?

- A) supervised learning
- B) unsupervised learning
- C) reinforcement learning

**Card 2:** How do you recognize supervised, unsupervised and reinforcement learning?

- [Next mission: Gemini or Gemma for the tax firm?](https://llm.yoga/en/einsatz-1-3.md)
- [Read chapter 1](https://llm.yoga/en/01-was-ist-ki.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [How machines learn: supervised, unsupervised, reinforcement](https://llm.yoga/en/01-was-ist-ki-1.md)
- [One term inside another: AI, machine learning, deep learning](https://llm.yoga/en/01-was-ist-ki-1.md)
- [Language as data: NLP](https://llm.yoga/en/01-was-ist-ki-2.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is B.
- A: A language model learned in training how text continues, not how Nora’s customers buy. Her past deals are only in the context of that one request, meaning the text the model gets to read for it, and a prediction from that would be a guess. It only becomes reliable with a learning method, even though an assistant with tools can program that method for Nora.
- B, correct: That’s supervised learning, more precisely a classification: every past case carries the right answer, and the method learns which combinations of features point to a closed deal.
- C: Finding groups is unsupervised learning. You need that when there are no right answers. But Nora has them, so a method can learn specifically for the question “buys or not”.

- Card 1: **unsupervised:** Unsupervised, more precisely clustering, that is, forming groups. There are no labels; the method finds the groups itself. A person has to judge in the end whether they make sense.
- Card 2: **supervised:** Supervised, more precisely classification. Every past case carries the right answer. That’s Nora’s case.
- Card 3: **reinforcement:** Reinforcement. The method is called RLHF, reinforcement learning from human feedback. The comparisons become a reward signal that the model is optimized toward.
- Card 4: **supervised:** Supervised, more precisely regression. The right number is known for every past offer, and what you’re looking for is again a number.
- Card 5: **unsupervised:** Unsupervised. Nobody specifies which products belong together. The method looks for the patterns in the orders on its own.
- Card 6: **reinforcement:** Reinforcement. The program acts, then gets a reward or a penalty, and adjusts its behavior so that the reward is as large as possible over time.

**Question 2:** The correct answer is B.
- A: Without labels there’s nothing the method could use to learn “buys”. For this prediction it needs past cases with the right answer.
- B, correct: Without labels, what’s left is unsupervised learning. Whether a group it finds says anything about willingness to buy is something a person with sales experience has to check.
- C: Reinforcement learning needs an environment in which the program acts and then gets a reward. A table of company data is no such environment.

**Question 3:** The correct answer is C.
- A: Analyzing text is exactly the field of natural language processing (NLP). A language model can detect sentiment, pull out names and summarize if you ask it in natural language.
- B: Without past cases with a known outcome, nothing has learned what leads to a deal. The model would guess, and it would still sound convincing.
- C, correct: Extraction is a strength of language models. The free text becomes a new column that the classic method keeps learning from. A manual spot check shows whether the details are right.

**Question 4:** The correct answer is A.
- A, correct: A model can only find patterns that are in the features. It can’t learn what isn’t in any field. A good salesperson knows it anyway.
- B: Many cases only help with what’s in the data. The contact’s resignation doesn’t appear in it, so the model can’t take it into account.

**Card 1:** Correct: A, supervised learning Supervised learning, more precisely a classification: every old ticket carries the right answer (the label). The method only finds patterns that are in the fields; it can’t learn what isn’t in any field.

**Card 2:** By the feedback. Supervised: each example comes with the right answer. Unsupervised: no answer; the method looks for patterns like groups on its own. Reinforcement: a program acts and then gets a reward or a penalty, as with RLHF for chat models.
