Skip to main content

Command Palette

Search for a command to run...

AI, ML, Generative AI, LLMs: What Do These Actually Mean?

Updated
13 min read

Everyone uses these terms. Nobody actually explains them properly.

If you're just getting into AI, you've probably noticed people say "AI" when they mean ChatGPT, "ML" when they mean AI, and "LLM" when they mean... honestly all of the above. It's confusing because even people in the field use them interchangeably. And they're not the same thing.

So let's fix that. Four terms. What they actually are. How they're different from each other. And why that difference matters.

AI

AI stands for Artificial Intelligence.

And I'll say this upfront - AI is the most misused term in tech right now.

AI is not a technology. It's not a model. It's not a product you can download. It's a goal.

The goal is: make a machine do something that would normally require human intelligence. That's it.

Playing chess is AI. Recognizing your face on your iPhone is AI. Predicting whether an email is spam is AI. A robot arm picking items in an Amazon warehouse is AI.

When people say "AI" today, they almost always mean ChatGPT or something like it. But AI has been around since the 1950s. We've had AI in spam filters, recommendation systems, and navigation apps for decades. Nobody was making a huge deal about it back then. The word just wasn't as loud.

Think of AI as an umbrella. A massive umbrella. Everything else we're going to talk about - ML, Generative AI, LLMs - sits under it.

The Old Way of Building AI

Before we talk about modern AI, let me quickly explain how people used to build AI systems. Because it makes the current approach way easier to understand.

The old approach was rule-based. You literally wrote rules.

Want to build an AI that detects spam emails? You'd write: "if the email contains 'free money', mark it as spam." "If the sender is unknown and the subject line is all caps, mark it as spam." You'd keep adding rules until the system was somewhat decent.

This actually worked for narrow, well-defined problems. Rule-based AI is still used today for things like tax calculation engines, eligibility checks, and some medical diagnostic tools.

But it breaks the moment things get complex.

Try writing a rule for detecting a dog in a photo. What rule covers a golden retriever in the snow, a chihuahua inside a bag, and a poodle mid-jump at a birthday party? You can't. There are too many variations. Too many edge cases. The real world doesn't fit neatly into rules.

That frustration led to something much better.

ML

ML is Machine Learning.

And this is where the real shift happened.

The insight was simple: instead of writing rules, what if we showed the machine thousands of examples and let it figure out the rules on its own?

You show the model 50,000 photos of dogs labeled "dog" and 50,000 photos of cats labeled "cat". The model processes all of it, finds patterns, builds its own internal understanding of what makes a dog a dog. You never told it what to look for. It learned.

That's Machine Learning.

And it worked. Really, really well.

Today ML is behind almost every smart system you use daily. Netflix knows what you want to watch next. Your bank flags a suspicious transaction before you even notice it. Google Translate went from being a joke to actually useful. Doctors use ML models to detect cancer in scans earlier than any human could.

How Does a Model Actually Learn?

Let me explain this simply because it often sounds more mysterious than it is.

A machine learning model is basically a math function. It takes input - say, a photo - and produces output - say, "dog" or "cat."

This function has knobs inside it. Thousands, sometimes billions of knobs. These are called parameters. At the start of training, these knobs are set randomly. So the model is just guessing.

You feed it a photo of a dog. It predicts "cat." Wrong.

Now here's the interesting part. The model checks how wrong it was. Then it adjusts the knobs - just slightly - in a direction that would make it less wrong next time. This adjustment process is called backpropagation paired with gradient descent. Sounds fancy, but it just means: make a guess, see how wrong you were, adjust.

You do this millions of times. Across millions of examples. Slowly, the model stops being terrible at this.

After enough training, the knobs settle into a configuration where the model is making correct predictions most of the time. That configuration is the trained model. That's what gets saved and deployed.

Types of ML

Not all ML is the same. There are three main ways a model can learn.

Supervised Learning. You give the model labeled data. Photos with labels. Emails tagged spam or not spam. Medical records with diagnoses. The model learns to map input to the correct output. Most ML you see in real products is supervised learning.

Unsupervised Learning. No labels at all. You dump raw data and ask the model: "do you see any structure here?" The model finds groupings, patterns, or anomalies on its own. Useful when you don't know what you're looking for. Companies use this to discover customer segments they didn't know existed.

Reinforcement Learning. The model learns by trial and error, like training a dog. It takes actions, gets rewarded for good ones and penalized for bad ones, and slowly learns a strategy that gets more rewards. This is how Google's AlphaGo learned to beat world champions at Go. And it's also used in training language models to be more helpful - we'll get to that.

Deep Learning

One more thing on ML before we move on.

For a long time, ML was decent but had a ceiling. Complex tasks like understanding images or language - it just wasn't good enough.

Then deep learning changed everything.

Deep learning is a type of ML using neural networks with many layers. Multiple layers of processing, each one picking up something more complex than the last. Early layers might detect edges in an image. Deeper layers combine those into shapes. Deeper still - into parts of a face, a wheel, an animal. The last layers put it all together.

No one programs this hierarchy. The network discovers it during training.

Deep learning is what made image recognition superhuman. It's what made speech recognition actually usable. And it's the foundation of everything generative AI is built on.

Generative AI

Okay. Now things get really interesting.

Everything we've talked about in ML so far is about analyzing things that already exist. Is this spam or not? Is this a dog or a cat? What's the sentiment of this review?

You give the model something. It gives you back a classification, a label, a prediction.

Generative AI flips this completely.

Instead of asking "what is this?", you're asking "can you make something?"

Write me an email. Generate an image of a mountain at sunset. Create code that does XYZ. Compose a piece of music.

And the model does it. Not by fetching something from a database. Not by copying. It synthesizes something entirely new every single time.

That's the shift. From analyzing to creating. From classification to generation.

How Does It Create?

Fair question. How does a model "create" something original if it's just learned from existing data?

Think of it like this. The model has seen so much data during training - so much text, so many images, so many patterns - that it has internalized what those things look like. What structure they follow. What makes them feel natural.

When you ask it to generate something, it uses those internalized patterns to produce something that fits that space. It's not memorizing. It's not copying. It's understanding patterns deeply enough to reproduce them in new combinations.

It's similar to how a musician who's listened to thousands of songs can compose an original piece. They're not copying any one song. They've absorbed patterns - rhythm, chord progressions, phrasing - and they express that understanding in something new.

What Can Generative AI Create?

Honestly, almost anything.

Text. Images. Audio. Video. Code. 3D models. Even new drug molecules in bioinformatics research.

And every single category has had a massive leap in quality recently. A few years ago, AI-generated images had weird hands and blurry faces. Now you genuinely can't tell. A few years ago, AI-generated code was mostly snippets and small functions. Now it can write entire features end to end.

The other thing that makes generative AI powerful is that it's interactive. You don't just hit a button and get a random output. You give it a prompt - an instruction, a context, a description - and it responds to that. It feels like a collaboration.

That's actually why this technology has been so explosive. It's not just powerful. It's usable by anyone.

LLMs

LLM stands for Large Language Model.

This is the specific type of generative AI that everyone is talking about. ChatGPT, Claude, Gemini, Llama, Mistral - these are all LLMs.

Let's break down what each word means.

Large - The model has billions, sometimes trillions, of parameters. Those knobs we talked about earlier. More parameters means the model can hold more patterns, understand more nuance, handle more complex inputs. GPT-3 had 175 billion parameters when it launched and shocked the world. Models today are significantly bigger.

Language - The model works with text. It reads text. It understands text. It generates text. Language is both its input and output.

Model - It's the trained artifact. The thing you deploy. The result of training.

So an LLM is a massive model, trained on huge amounts of text, that can understand and generate human language.

How Does an LLM Actually Get Trained?

This is surprisingly simple to understand once you hear it.

You take a massive chunk of text - basically a large portion of the internet. Books, websites, Wikipedia, code repositories, research papers, forums, news articles. We're talking trillions of words.

You train the model on one task. Predict the next token.

Given "The capital of France is", what comes next? Paris.

Given "def calculate_area(radius):", what comes next? The formula for area, in Python syntax.

Given the first half of a legal contract, what comes next? Clauses that make sense legally.

You do this billions of times. Across all types of text. And here's the thing - to get good at this one task across such diverse content, the model has to genuinely understand everything it's predicting. It has to understand geography to predict "Paris". It has to understand coding to predict the next line. It has to understand logic, history, science, medicine, storytelling - everything humans have ever written about.

Prediction forces understanding. That's the magic.

After this stage, the model knows a lot. But it doesn't know how to have a useful conversation with you. It's like a person who's read everything but has never been taught how to talk to people.

Fine-tuning - Making It Actually Useful

The trained model goes through a second stage.

Human trainers write examples of good assistant responses. The model learns from those. Then, human raters compare pairs of model responses and say which one is better. A separate model learns to predict these human preferences. Then the LLM gets updated to produce responses that humans prefer.

This whole process is called RLHF - Reinforcement Learning from Human Feedback.

This is what turns a raw pretrained model into ChatGPT or Claude. The underlying knowledge was from pretraining. The conversational behavior and helpfulness come from fine-tuning.

Tokens and Context Window

Two more terms worth knowing before we wrap up on LLMs.

LLMs don't read text the way you do. They break text into chunks called tokens. A token is roughly a word, sometimes a part of a word. "unbelievable" might be two tokens. "the" is one token. Common numbers like "2024" might be one token.

Why does this matter? Because the model has a limit on how many tokens it can process at once. That limit is called the context window.

Early models had context windows of around 4,000 tokens. You couldn't give them long documents. Now frontier models handle 200,000 tokens or more. Some go even higher. That means you can paste in an entire codebase, a full book, hours of meeting transcripts, and the model can reason across all of it.

The context window is basically the model's working memory. Whatever you want the model to know during a conversation has to fit inside it.

LLMs Can Be Wrong - Confidently

This is important and often gets glossed over.

LLMs don't look up answers from a database when they respond. Everything is baked into the parameters from training. When it answers your question, it's generating what statistically seems like the right continuation of your prompt, based on patterns it learned.

Most of the time, this works fine. But sometimes the model generates something that sounds completely correct and is completely wrong.

This is called hallucination. The model confidently states a fake research paper citation. Or a lawyer who doesn't exist. Or a fact that's backwards.

It's not lying. It doesn't know it's wrong. It's just generating what looks like a reasonable continuation of the text.

This is why you don't blindly trust LLM outputs, especially for factual claims. Always verify things that matter.

How These Four Things Relate

Let me put this simply.

AI is the goal - build machines that exhibit intelligent behavior.

ML is the dominant approach today to reaching that goal - learning from data instead of writing rules.

Generative AI is a category within ML focused on creation - models that generate new content rather than just classify existing content.

LLMs are a specific type of generative AI - massive models trained on text, capable of understanding and generating language at a level that was unimaginable a few years ago.

So every LLM is generative AI. Every generative AI is ML. Every ML system is AI.

But not every AI is ML. And not every ML model is generative. And not every generative AI is an LLM.

The nesting goes one way. Specific to broad.

AI
|-- ML
      |-- Generative AI
            |-- LLMs

When someone says "we're using AI," that tells you almost nothing. When someone says "we're using an LLM", that tells you a lot.

Get comfortable with that distinction. You'll use it constantly.

That's it.

Applied AI - Prompts, Tools & Skills, RAG, Tokenizations, Multi-Agents, Observability

Part 2 of 3

In this series, we will be discussing mostly about Applied AI. Applied AI is a new job role where you aren't expected to know everything about AI, but you should be able to work between the intersection of Software Engineering and AI. You should be able to employ AI to build AI enabled applications and you should understand basics of LLM concepts & Prompt engineering.

Up next

How LLMs Work (High-Level)

In the last post, we covered what LLMs are. Massive models, trained on text, that predict the next token. But that description doesn't really tell you what's happening inside. What does the model actu