Leaders Insights
Leaders Insights

Rester au meilleur niveau, un peu chaque jour.

DomainesMarketingDataFinanceIA
RessourcesApprendreTestOutilsBlogGlossaire
© 2026 Leaders Insights — Tous droits réservés.
Formations/AI Essentials/AI & LLM foundations/How AI and LLMs actually work/What is AI, machine learning, and a large language model?
1/3+120 XP

How AI and LLMs actually work

1What is AI, machine learning, and a large language model?+1202Tokens, training, and inference: what happens when you hit enter+140
3
The context window: the model's working memory
+140

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

# What is AI, machine learning, and a large language modellarge language modelA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →?

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 modellarge language modelA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → (LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →), 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → 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 tokenstokensA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →

One small clarification. LLMs don't work in whole words but in tokenstokensA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →: chunks of text, often a word or part of a word. "Coffee" might be one tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →; "unbelievable" might be three. When you hear "the model predicts the next tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →," 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 tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → 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 tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → (Claude, in this case) to write that email, using its APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète →:

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, tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → by tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →. 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 tokenstokensA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →, so you literally budget its output in those chunks.

Vérification des acquis

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?

CHOIX MULTIPLES

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

Sélectionnez toutes les réponses correctes.

CHOIX MULTIPLES

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

Sélectionnez toutes les réponses correctes.

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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → 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.

À faire, tiré de cette leçon

Ces actions sont compilées dans le plan d'action du rôle.

  • Classify each task as language work or precision work before prompting
  • Write specific prompts with examples, roles, and format constraints
Voir le plan d'action complet →

Suivant

Tokens, training, and inference: what happens when you hit enter

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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →. Need to write a personalized reply to each angry one? That's LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → territory. Increasingly, smart systems combine both.

A quick mental mapmapUsing software to automate repetitive marketing tasks and campaigns, enabling personalisation at scale across channels like email, web, and social.Voir la définition complète →

  • 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 modelLarge language modelA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →: 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → is machine learning. All machine learning is AI. But not all AI is an LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète →, 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → (ChatGPT, Claude, Gemini).
  • An LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → is a next-tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète → 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 LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → for repetitive sorting at scale. An LLMLLMA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.Voir la définition complète → 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.