How AI Chatbots Work: Large Language Models Explained Simply
ChatGPT, Claude, Gemini and other chatbots seem to understand you, but what's really going on? A clear, jargon-free explanation of large language models, training and their limits.
Information current as of November 2026 · How we research · Report an error
AI chatbots such as ChatGPT, Claude, Gemini and Copilot can write emails, explain homework, summarize documents and hold surprisingly natural conversations. It’s tempting to imagine a digital brain that “knows” things the way we do. The reality is different, and understanding it helps you use these tools far better.
The core idea: predicting the next word
At their heart, these chatbots are built on large language models (LLMs). An LLM is a computer program trained to do one thing extremely well: predict what text is likely to come next.
Give it “The capital of France is” and it predicts “Paris.” Give it the start of an email, and it predicts a sensible continuation. A chatbot’s answer is produced this way, one small piece at a time, with each new piece based on everything that came before.
That sounds too simple to explain a model that can debug code or write a poem. The surprise of the last decade is that when you make these models large enough and train them on enough text, predicting the next word well requires learning grammar, facts, writing styles, reasoning patterns and much more.
Tokens: how the model sees text
Models don’t read whole words the way we do. Text is split into tokens, which are common chunks of characters. A short word might be one token; a long or rare word might be split into several. Spaces and punctuation are part of tokens too.
This is why AI services often describe limits and prices in tokens rather than words. In English, a token is roughly three-quarters of a word on average.
Training: learning from huge amounts of text
Step 1: pre-training
The model starts as a gigantic mathematical function with billions of adjustable numbers, called parameters. At first, its predictions are random.
During pre-training, it is shown enormous amounts of text, such as books, websites, articles and code. Again and again, it guesses the next token, compares its guess with the real text, and slightly adjusts its parameters to make a better guess next time. Repeated trillions of times on powerful computers, this gradually encodes patterns of language and knowledge into those parameters.
Step 2: turning it into an assistant
A pre-trained model is good at continuing text but not at being helpful. Ask it a question and it might answer with more questions. So developers train it further:
- Fine-tuning on examples of good conversations, where an assistant answers questions helpfully.
- Learning from feedback, where people (and sometimes other AI systems) rate different answers, and the model is adjusted to prefer the better ones. This is often called reinforcement learning from human feedback.
This stage also teaches the model to follow instructions, admit uncertainty, and decline harmful requests.
The neural network inside
LLMs are a type of neural network, software loosely inspired by how brain cells connect. Today’s models use a design called the transformer, introduced by Google researchers in 2017.
The key innovation of transformers is attention: when processing a word, the model can weigh how relevant every other word in the text is. In the sentence “The trophy didn’t fit in the suitcase because it was too big,” attention helps the model work out that “it” refers to the trophy.
What chatbots don’t do
Understanding the limits is the most useful part.
- They don’t look things up by default. A basic model answers from patterns learned during training. Many chatbots can now search the web or read documents you provide, but when they don’t, they rely on what they learned.
- They have a knowledge cutoff. Training data stops at a certain date, so the model may not know about recent events unless it’s connected to search.
- They can be confidently wrong. Because they generate likely-sounding text, they can produce plausible but false statements, sometimes called hallucinations.
- They don’t remember you by default. Each conversation is processed using the text in it. Some products add optional memory features that store information between chats.
- They have a context window. There’s a limit to how much text a model can consider at once, though modern models can handle very long documents.
Why answers vary
Ask the same question twice and you may get different answers. That’s because chatbots don’t always pick the single most likely next token; they sample from several likely options. This makes writing more natural and creative, but it also means you shouldn’t treat one answer as the definitive one.
How to get better results
- Be specific. “Write a polite email to my landlord asking to fix a leaking tap by Friday” beats “write an email.”
- Give context. Say who the text is for, what you already know, and what format you want.
- Ask it to show its reasoning for math or logic, and check each step.
- Paste in the source material when you want a summary or answer about a specific document.
- Verify facts that matter. Check important information, especially numbers, quotes, legal, medical and financial details, against reliable sources.
- Don’t share sensitive data such as passwords, ID numbers or confidential work documents unless you understand how the service stores and uses it.
The bottom line
AI chatbots are powerful pattern-prediction machines trained on vast amounts of text, then refined to be helpful assistants. They’re excellent for drafting, explaining, brainstorming and summarizing, but they aren’t all-knowing. Use them like a very well-read assistant whose work you still check.
New to AI? Our beginner’s guide to AI explains how it works, what it’s good at, and how to use it safely.