Study AI Mastery

Master AI. Shape Your Future. Learn to leverage ChatGPT, Claude AI, and the world's most powerful AI platforms—from complete beginner to expert level.

Platform

  • Start Here
  • New to AI? Start Here
  • For Parents & Educators
  • For Students
  • For Schools
  • Learning Paths
  • Platform Comparison
  • Free Resources
  • Pricing
  • Developer API
  • Alternatives
  • Best AI for…

Company

  • About Us
  • Contact
  • FAQ
  • What's New
  • Privacy Policy
  • Terms of Service
  • Refunds

© 2026 Study AI Mastery. All rights reserved.

Study AI Mastery is operated by Our Rose LLC. Charges appear on your card statement as OUR ROSE LLC.

Learning PathsChatGPT Mastery: From Zero to Power UserGetting Started with ChatGPTWhat is ChatGPT and How Does It Work?
BEGINNER
Lesson 1 of 3
FREE

What is ChatGPT and How Does It Work?

Understand the technology behind ChatGPT — large language models, tokens, and how AI generates text.

22 min with the exercise
~6 min read
beginner level
Module progress0 / 3 complete

What is ChatGPT and How Does It Work?

You ask ChatGPT a question and get back a clear, confident, well-organized answer in seconds. Then you ask a follow-up and it tells you something that turns out to be flatly wrong, in exactly the same confident tone. So which is it: brilliant or unreliable?

Both, and the reason is the same. Once you understand what is actually happening when you press Enter, the good answers and the bad ones both make sense, and you can start getting more of the first kind on purpose. That is what this lesson is for. No math, no jargon you do not need, just an accurate picture of the machine you are talking to.

What ChatGPT actually is

ChatGPT is a chat app built by OpenAI. Underneath it sits a large language model, or LLM: a very large neural network trained on an enormous amount of text, including books, websites, articles, and code.

During training, the model was shown text and asked, over and over, to guess what comes next. Each time it guessed wrong, its internal settings were nudged slightly so the next guess would be a little better. Repeat that across a huge amount of text and the model ends up holding a detailed map of how language tends to go: grammar, common facts, styles of argument, how emails open and close, how code is structured.

The important part is what it does not hold. It does not store a searchable copy of the internet. It does not look up answers in a database. It learned patterns, and it produces text from those patterns.

How an answer gets made

When you type a message, this is roughly what happens:

  1. Your text is split into tokens. A token is a small chunk of text. In English, one token is roughly 4 characters, or about three-quarters of a word. A short word like "the" is usually one token; a longer word like "understanding" might be split into two or three.
  2. The model reads all the tokens in the conversation so far. Your message, its earlier replies, and any hidden instructions the app adds.
  3. It predicts the most likely next token based on the patterns it learned in training.
  4. It adds that token and repeats. One token at a time, until the reply is complete.

So the primary job of the model is simple to state: given a sequence of tokens, predict the next one. Think of it as autocomplete on your phone, scaled up enormously. Your phone suggests the next word; the model keeps going for paragraphs, and because its patterns are so rich, the result can hold together as an explanation, a plan, or a working piece of code.

This explains the puzzle from the opening. The model is producing text that looks like a good answer to your question. Most of the time, a good-looking answer and a correct answer are the same thing. Sometimes they are not, and the model has no built-in alarm that tells it the difference.

Four ideas that explain most of its behavior

Tokens and the context window

Everything the model can "see" at once, your messages plus its replies, has to fit inside its context window, a limit measured in tokens. Limits vary by model and keep growing. As one example, GPT-4o, a widely used model, was released with a context window of about 128,000 tokens. Newer models may differ, so check the current documentation rather than memorizing a number.

What this means for you: in a very long conversation, the earliest material can fall out of view, and the model may start forgetting instructions you gave at the start. If that happens, restate the important details or start a fresh chat.

Hallucinations

A hallucination is when the AI generates confident but incorrect information: a made-up statistic, a book that does not exist, a quote nobody said. It happens because the model is predicting plausible text, not checking facts. A fake citation looks exactly like a real one, pattern-wise. You will learn how to guard against this in the third lesson.

No live internet by default

The model's knowledge comes from its training data, which stops at a knowledge cutoff date. The model itself has no real-time connection to the internet. Some versions of ChatGPT add a web search tool on top, and when that tool runs you will usually see it searching or citing sources. Without that, anything that happened after training is simply unknown to the model, and it may guess.

No learning from your conversations

The model does not learn from your chats. Its training is finished before you ever talk to it. Within one conversation it can refer back to what you said, because that text is sitting in its context window. Close the chat and start a new one, and by default it starts fresh.

Some apps offer a "memory" feature. That works by saving short notes about you and quietly adding them to future conversations. The model itself has not changed or learned anything; it is just being handed a reminder.

Why your wording matters so much

Because the model predicts from everything in the conversation, your prompt is the single biggest lever you control. A vague prompt gives it little to go on, so it falls back on the most generic, average answer. A specific prompt steers it toward a narrower, more useful set of patterns.

Here is the difference in practice.

Before:

Explain how a car engine works.

This usually gets you a textbook-style paragraph about pistons, combustion, and crankshafts, pitched at nobody in particular.

After:

Explain how a car engine works to [WHO IT'S FOR, e.g. my 10-year-old].
Use simple words and one everyday analogy they would recognize.
Keep it under [NUMBER] sentences and end with one question
I can ask them to check they understood.

Same topic, same model. The second prompt tells it who the audience is, how long to go, and what shape the answer should take. Every one of those details changes which patterns the model draws on. You are not unlocking a hidden mode; you are giving the prediction machine better material to predict from.

Try this

Set aside 10 to 15 minutes.

Step 1. Open ChatGPT and send this exact prompt:

Explain how a car engine works.

Step 2. Start a new chat and send the "after" version above, filling in the brackets with a real person you know and a sentence limit.

Step 3. Compare the two. Note three concrete differences: length, vocabulary, and structure.

Step 4. In the same chat, ask a follow-up about something recent, for example:

What happened in the news in [YOUR CITY] this week?

Watch what it does. Does it search the web and show sources, or does it tell you it cannot access current events, or does it guess? Any of those is useful to see, because it shows you where the model's own knowledge ends.

Step 5 (optional). If you have access to the Study AI Mastery Playground, run the "after" prompt in compare mode on two or three different models side by side. You will see that the same prompt produces different answers, which is a good reminder that you are dealing with prediction, not a single correct lookup.

What to remember

  • ChatGPT is built on a large language model that predicts the most likely next token, one token at a time, based on patterns learned in training.
  • A token is a small piece of text, roughly 4 characters in English; everything in a conversation must fit in the model's context window.
  • The model can be confidently wrong. That is called a hallucination, and it is why important facts need checking.
  • It has no real-time internet access by default and does not learn from your past conversations; a new chat starts fresh unless a memory feature feeds it notes.
  • Your prompt is your biggest lever: specific instructions steer the prediction toward what you actually need.

Code Examples

Basic OpenAI API Call

from openai import OpenAI

client = OpenAI(api_key="your-key-here")

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful tutor."},
        {"role": "user", "content": "What is machine learning?"}
    ]
)

print(response.choices[0].message.content)
Up Next · Lesson 2 of 3

Crafting Effective Prompts

Learn the fundamentals of writing prompts that get useful, accurate responses from ChatGPT.

22 min

In this module

Getting Started with ChatGPT

1.
What is ChatGPT and How Does It Work?
22 min
2.
Crafting Effective Prompts
22 min
3.
Strengths and Limitations
21 min

Resources

No resources available for this lesson yet.

AI Study Buddy

Ask me anything about this lesson!

I'm here to help you understand the concepts better.

Practice Quizzes

Test your understanding of this lesson

Generate AI Quiz:

AI will generate 5 questions tailored to this lesson

Available Quizzes:

What is ChatGPT and How Does It Work? - Quiz
easy

Test your understanding of What is ChatGPT and How Does It Work?

2 questions
70% to pass
What is ChatGPT and How Does It Work? — Knowledge Check
beginner

Test your understanding of What is ChatGPT and How Does It Work?

5 questions
70% to pass