Level : Beginner

How ChatGPT (and other AI chatbots) work, explained simply

By The Info Agent IA editorial team ·

A person typing on a phone at a kitchen table while glowing fragments rise from the screen into a network of nodes

ChatGPT works by predicting, one word fragment at a time, the most likely continuation of your conversation, using a model trained on vast amounts of text and then tuned to hold a dialogue. Claude, Gemini and Le Chat run on the same principle, and understanding it helps you know when to trust them and when to double-check.

The core idea: autocomplete on a massive scale

You know the predictive text on your phone: you type « I’m running », it suggests « late ». ChatGPT does something similar, but on a completely different scale. It doesn’t suggest one isolated word: it extends a whole text, taking everything before it into account, and keeps going until it has written a full answer.

At the heart of ChatGPT is a large language model, or LLM: a program that has learned, from enormous volumes of text, which sequences of words are plausible in which context. The website, the app, voice mode, web search and memory are layers added around that engine. If you want to dig into the concept itself, our article on what a large language model is goes into detail.

Keep one idea in mind from the start: ChatGPT does not look up the right answer in an internal encyclopedia. It generates plausible text. Most of the time, plausible and accurate overlap. Sometimes they don’t, and that is where mistakes come from.

Step 1: your message is split into tokens

When you send a question, the model doesn’t see letters or words the way you do. It sees tokens: chunks of text that can be a short word, part of a longer word, a punctuation mark or a space. « Hello » may fit in a single token, while a rare or technical word is often split into several pieces.

Each token is then converted into a list of numbers, and the model does all its calculations on those numbers. This step explains two things you will run into regularly:

  • length limits and developer pricing are expressed in tokens, not words;
  • languages that are less common in the training data are sometimes split into more tokens, and so handled less efficiently.

To see how many tokens one of your own texts represents, try the site’s token estimator.

Step 2: the model predicts the next token, over and over

Once your message has been turned into numbers, the model calculates, for every token in its vocabulary, the probability that it comes next. It picks one, adds it to the text, then runs the calculation again on the longer text. A few paragraphs of answer are therefore hundreds of small predictions chained together. That is why the answer appears gradually on screen, as if someone were typing.

Here is an example. If the text ends with « To make pancake batter, you need flour, eggs and », the model rates « milk » as very likely, « butter » a bit less, and « cement » as almost impossible. It has no recipe filed away somewhere: during training, it came across a very large number of cooking texts in which those words appear together. That statistical knowledge, applied to every kind of subject, is what lets it draft an email, explain a concept or translate a paragraph.

The model doesn’t always pick the single most likely token. A setting adds a controlled dose of randomness: the text sounds more natural, and the same question asked twice gets two different wordings.

The Transformer: the architecture that looks at the whole context

To predict well, the model has to work out what each word refers to. In « The trophy doesn’t fit in the suitcase because it is too big », what is too big? Today’s LLMs are built on the Transformer architecture, introduced by Google researchers on June 12, 2017 in the paper « Attention Is All You Need » (accessed October 22, 2026). Its central idea lets the model weigh the importance of each token against every other one, even far apart in the text. That is where the « T » in GPT comes from: Generative Pre-trained Transformer.

That context is not unlimited. The amount of text the model can take into account at once is called the context window. When a conversation gets very long, the earliest exchanges may fall out of it or be summarized, and the assistant then seems to « forget » what you told it at the start.

How ChatGPT learned: three main phases

A model like the one behind ChatGPT isn’t programmed rule by rule. It is trained in several phases. Here is the general outline, as described in OpenAI’s publications.

PhaseWhat the model doesAnalogy
Pre-trainingIt goes through huge volumes of text and learns to predict the next tokenReading an entire library with no teacher
Learning from examplesIt studies dialogues written by humans: a question, a good answerWorking through solved exercises
Human feedbackPeople rank several answers, and the model learns to prefer the best-rated onesA coach saying « more like this, less like that »

Pre-training gives the model its general knowledge and command of language. But at that stage, it mostly knows how to continue a text, not how to answer a question helpfully. The next two phases turn it into an assistant. The last one has a technical name: RLHF, short for reinforcement learning from human feedback.

Once training is over, the model’s internal settings are frozen. It therefore does not change while you are chatting with it. What can change is the next version, which may be trained partly on user conversations, depending on each person’s privacy settings.

What happens when you press « Send »

In the app, the model is only one part of the system. Here is a simplified version of your question’s journey:

  1. Hidden instructions. Your message is preceded by instructions written by the provider (tone, safety rules, today’s date), sometimes supplemented by your custom instructions and items from memory.
  2. Optional tools. If the question is about current events, the assistant may run a web search and insert snippets of pages into its context. It can also read a file you attached.
  3. Generation. The model writes its answer token by token, based on everything together: instructions, history, documents and question.
  4. Filters. Safety systems may block or alter certain answers.

This explains why an assistant can seem perfectly up to date in one conversation and out of date in another: it all depends on whether web search is on. Without it, the assistant only knows the world as it was at the end of its training data.

ChatGPT, Claude, Gemini, Le Chat: same engine, different cars

All the major consumer assistants work on this principle, including Mistral AI’s Le Chat, renamed Mistral Vibe in 2026. What sets them apart is the model used, the training data, how the human feedback was gathered and, above all, the tools built around them. According to information collected from the providers’ websites as of October 22, 2026, ChatGPT runs on the GPT-6 Astra, GPT-6.1 Sol and GPT-6 Luna models; our ChatGPT profile details what each plan unlocks.

AssistantFreePaid fromWeb searchAgent modeVoiceImages
ChatGPT Limited$8/mo YesYesYesYes
Claude Limited$20/mo YesYes——
Gemini Limited€4.99/mo Yes—YesYes
Le Chat (Mistral Vibe) Limited$5.99/mo YesYesYesYes
Source: editorial survey of the providers' websites, data as of October 22, 2026 · method.

When a capability isn’t listed for an assistant, it means the provider hasn’t specified it, not necessarily that the feature is missing.

Why ChatGPT is sometimes confidently wrong

Since the model generates plausible text, it can produce false information stated with the same confidence as true information: this is called a hallucination. It mostly happens with rare details (a specific date, a reference, a number), with recent topics when web search is off, or when the question contains a mistake that the model goes along with instead of challenging. Our guide on why AI makes things up offers practical ways to protect yourself.

Another limit comes from tokens: tasks that require handling letters one by one, such as counting the letters in a word or spelling it backwards, sometimes fail, because the model doesn’t always see letters separately. Recent models partly make up for this by writing out intermediate steps before answering.

Three practical takeaways for better results

Give it context. The model predicts the continuation of whatever you give it. The more your request spells out the goal, the audience and the format you expect, the closer the « likely » continuation gets to what you want.

Check the facts that matter. Numbers, dates, quotes, legal or medical references: ask for sources, turn on web search and cross-check against an official website. For a question about health, law or money, the assistant gives general information, not a professional’s advice.

Start fresh when the conversation drifts. If the assistant gets tangled up in a long discussion, open a new conversation with a clear summary of the situation: you are tidying up its context. That often works better than correcting the same mistake three times in a row.

Check yourself Why can ChatGPT cite a book that doesn't exist?

Because it generates the most plausible continuation instead of checking a database of references. A title, an author and a year that « sound right » can be produced without existing. Without web search or a source to verify, nothing in the mechanism guarantees accuracy.

To go back to basics, our guide to what artificial intelligence is places chat assistants within the history and main families of AI.

Frequently asked questions

Does ChatGPT look up its answers on the internet?

Not necessarily. Without tools, it writes its answer from what its model learned during training. When web search is turned on, it also reads web pages and can cite its sources. That option is what lets it talk about recent events.

Does ChatGPT learn from my conversations?

The model does not change in real time while you chat with it. Depending on your settings, however, your conversations may be used to train future versions. In ChatGPT, the switch is under Settings, Data Controls, « Improve the model for everyone ».

Why does ChatGPT never give the exact same answer twice?

Because it picks each piece of a word from several likely options, with a controlled dose of randomness. Two attempts therefore produce two different wordings. This is deliberate: it makes the text sound more natural and varied.

Do Claude, Gemini and Le Chat work the same way as ChatGPT?

Broadly, yes. They all rely on a large language model trained to predict how a text continues, then tuned for conversation. They differ in their models, training data, safety rules and the tools built around them.

Go further