+120 XP

What is AI, machine learning, and a large language model?

Three tools sit on your phone right now: a spam filter that quietly trashes junk email, a photo app that finds every picture of your dog, and ChatGPT writing a polite reply to your landlord. Most people call all three "AI." They're right, technically. But these three things work in very different ways, and understanding the differences is the single most useful thing you can learn about AI.

Let's untangle them.

AI is the big umbrella

Artificial Intelligence (AI) is a broad label for any computer system that does something we'd normally call "smart": recognizing a face, recommending a movie, beating you at chess, writing an email.

That's it. AI is the whole category. It doesn't tell you *how* the smart thing happens.

A 1980s chess program was AI. So is the autocomplete on your phone. So is ChatGPT. They share almost nothing under the hood. "AI" is like the word "vehicle": it covers bicycles, trucks, and rockets.

So when someone says "we added AI to our app," they've told you almost nothing. **The useful question is always: *what kind?***

Machine learning: systems that learn from examples

Most modern AI is built with machine learning (ML): instead of a human writing step-by-step rules, you show the computer thousands of examples and let it figure out the pattern itself.

Here's the contrast.

Old way (hand-written rules): A programmer writes, "If the email contains the word FREE in all caps, mark it as spam." Brittle. Spammers just write "F R E E" instead.

Machine learning way: You feed the system 100,000 emails, each labeled "spam" or "not spam." The system learns which combinations of words, senders, and patterns tend to mean spam. Nobody wrote the rules. The system inferred them from the examples.

Example 1: the spam filter

Your spam filter is a classifier: a model that sorts things into buckets. Two buckets here: spam or not spam.

It looks at an email and outputs a probability: "92% spam." Above some threshold, it goes to the junk folder. When you manually mark something as spam, you're giving it a new labeled example, and it gets a little better.

Example 2: the photo-tagger

Your photo app finding every picture of your dog uses the same core idea, applied to images. It was trained on millions of labeled photos ("this is a dog," "this is a beach," "this is a face"). It learned the visual patterns.

This is still a classifier, just with pixels as input instead of words. Same family. Different senses.

Both examples share a key trait: they do one narrow task. The spam filter can't tag your photos. The photo-tagger can't sort your email. They're specialists.

If you want a quick, friendly grounding in how machine learning works, Google's Machine Learning Crash Course has a free, readable intro.

Large language models: a different kind of specialist

Now ChatGPT writing your email. This is a large language model (LLM), and it's a specific, recent type of machine learning built for one task: predicting the next chunk of text.

Here's the part that surprises people.

An LLM is, at its core, a very, very good next-word predictor.

The next-word game

Try to finish this sentence:

"I poured myself a cup of ___"

You said "coffee" (or maybe "tea"). You didn't look it up. You've read and heard enough English that the pattern is obvious.

An LLM does exactly this, at enormous scale. During training, it read a huge slice of the internet: books, articles, websites, code, forums. Its only job, billions of times over, was: given some text, predict what comes next. Guess, check against the real text, adjust, repeat.

Do that long enough, with enough text and enough computing power, and something remarkable happens. To predict the next word well, the model has to absorb grammar, facts, reasoning patterns, tone, and the structure of arguments. **Predicting text *well* turns out to require a working model of how language and ideas fit together**.

"Words" are actually tokens

One small clarification. LLMs don't work in whole words but in tokens: chunks of text, often a word or part of a word. "Coffee" might be one token; "unbelievable" might be three. When you hear "the model predicts the next token," it just means the next small chunk of text.

How writing your email actually works

When you type "Write a polite email asking my landlord to fix the heater," the model isn't looking up a template. It's predicting, one token at a time, what a helpful, polite email would look like given your request. "Dear" then "Mr." then "Smith," then "I" then "am" then "writing"... each token chosen because it's a likely, sensible continuation.

That's why two LLMs (or the same one twice) can give you slightly different emails. There's a bit of controlled randomness in *which* likely word it picks. That randomness is also why LLMs can hallucinate: confidently produce text that sounds right but is factually wrong. It's predicting plausible words, not checking a database of truth.

Large Language Models explained briefly

Watch on YouTube

Seeing it in code

You don't need to be a programmer, but seeing the actual call demystifies things. Here's how you'd ask an LLM (Claude, in this case) to write that email, using its API:

python
import anthropic

client = anthropic.Anthropic()  # uses your API key

response = client.messages.create(
    model="claude-sonnet-4-5",
    max_tokens=300,
    messages=[
        {
            "role": "user",
            "content": "Write a short, polite email asking my landlord to fix the broken heater in apartment 4B."
        }
    ],
)

print(response.content[0].text)

That's the whole idea. You send text in (the content), the model predicts good text back out, token by token. The reply comes back as a list of content blocks, which is why you read the first block with response.content[0].text. ChatGPT and Gemini work the same way; only the model name and a few details change.

You'll notice max_tokens=300. That caps how much text comes back. Remember: the model thinks in tokens, so you literally budget its output in those chunks.

Knowledge check

1. Why does the lesson argue that saying 'we added AI to our app' tells you almost nothing useful?

2. What is the key distinction between the 'old way' (hand-written rules) and the machine learning approach?

3. The lesson describes both the spam filter and the photo-tagger as 'classifiers.' What does this reveal conceptually?

MULTIPLE CHOICE

4. Select ALL statements that correctly describe how a spam filter classifier works according to the lesson.

Select all the correct answers.

MULTIPLE CHOICE

5. Select ALL examples that the lesson counts as forms of 'AI' under the broad umbrella.

Select all the correct answers.

Why these distinctions actually matter

This isn't trivia. Knowing which kind of AI you're dealing with changes how you use it.

LLMs are generalists; classic ML models are specialists. The spam filter does one thing perfectly. An LLM can draft an email, summarize a report, translate, brainstorm names, and explain a tax form. That flexibility is the breakthrough of the last few years. But it comes with a catch.

LLMs predict plausible text, not verified truth. A spam filter is rarely "creatively wrong." An LLM can invent a fake legal case or a wrong statistic with total confidence. So: use LLMs for drafting, thinking, and transforming text. Verify anything factual.

The right tool depends on the job. Need to sort 50,000 customer reviews into "happy" or "angry"? A simple classifier is cheaper and more reliable than an LLM. Need to write a personalized reply to each angry one? That's LLM territory. Increasingly, smart systems combine both.

A quick mental map

  • AI: the umbrella. Anything "smart" a computer does.
  • Machine learning: AI that learns patterns from examples instead of hand-written rules. (Spam filter, photo-tagger.)
  • Large language model: a specific kind of machine learning, trained to predict the next chunk of text, which makes it shockingly good at language tasks. (ChatGPT, Claude, Gemini.)

Every LLM is machine learning. All machine learning is AI. But not all AI is an LLM, and that's the confusion this lesson exists to clear up.

The mindset to carry forward

When you use ChatGPT, Claude, or Gemini for the rest of this course, hold this picture in your head: you are steering a powerful next-word predictor.

That single idea explains nearly everything about working with these tools. It's why clear prompts produce better results (you're giving it a better starting pattern to continue). It's why it can write beautifully but get a date wrong. It's why giving it your actual document to work from beats asking it from memory.

You're not talking to a search engine or a database. You're collaborating with a prediction engine that has read an enormous amount and is very good at continuing whatever you start.

Key Takeaways

  • Always ask "what kind of AI?" "AI" is just the umbrella. The useful question is whether you're dealing with a narrow classifier (spam filter, photo-tagger) or a flexible LLM (ChatGPT, Claude, Gemini).
  • An LLM is a next-token predictor at heart. It was trained to guess the next chunk of text across a huge slice of the internet, and that's why it's both impressively fluent and occasionally, confidently wrong.
  • Use LLMs for drafting, summarizing, and transforming text; always verify facts. They produce *plausible* text, not *checked* text.
  • Match the tool to the task. A simple classifier beats an LLM for repetitive sorting at scale. An LLM wins for open-ended language work.
  • Steer it like a prediction engine. Clear, specific prompts and supplying your own source material will consistently beat vague requests.

What to do, from this lesson

These actions are compiled in the role's Playbook.

  • Classify each task as language work or precision work before prompting
  • Write specific prompts with examples, roles, and format constraints
See the full action playbook →