What Is an LLM? Large Language Models, Explained
You type a question into a chatbot such as ChatGPT, Gemini or Claude, and a tidy, confident paragraph appears in a few seconds. It feels as if someone on the other side understood you. So what is an LLM, the thing that actually wrote that paragraph? The answer surprises most people: it is a program that has become extremely good at one narrow job, guessing which piece of text comes next.
From phone autocomplete to a large language model
LLM stands for large language model. A language model is any program that predicts which piece of text is likely to come next. Your phone keyboard runs a small one. An LLM does the same job at a vastly bigger scale, which is what the word "large" points to.
"Large" describes the number of weights inside it. A weight is a single learned number, the kind of trust level you met in What Is a Neural Network? Today's LLMs have from a few billion to hundreds of billions of weights. Some companies keep the exact count secret.
Almost every modern LLM is built on a neural network design called the transformer, introduced by Google researchers in 2017. Its key idea is attention: while it works on the next word, the network can look back at every earlier word and weigh which ones matter. In "The trophy did not fit in the suitcase because it was too big", attention helps link "it" to "trophy".
The only trick: predict the next token, again and again
An LLM does not read whole words exactly. It reads tokens, which are chunks of text: often a whole word, sometimes part of a word, a space or a punctuation mark. The next lesson looks at tokens closely. For now, think of a token as roughly a short word.
Here is the whole process. The model takes all the text so far and gives a score to every token in its vocabulary, the fixed list of tokens it knows, usually tens of thousands to a few hundred thousand of them. The software running the model picks one token, adds it to the end of the text and runs the model again on the longer text. This repeats until the model produces a special "stop" token or hits a length limit.
Notice what the loop reveals: there is no finished draft waiting somewhere to be shown bit by bit. Each token is chosen only after all the earlier ones exist. This is why chatbot answers appear word by word on your screen.
The scores are probabilities, numbers that say how likely each token is to come next. The software does not always take the top one. It usually adds a controlled amount of randomness, set by a value called temperature, so the same question can come back worded differently each time.
How an LLM learns: reading first, then manners
The first stage is called pretraining. The model is shown a huge collection of text, often trillions of tokens from websites, books and code. It runs the learning loop from How Does Machine Learning Work?: hide the next token, let the model guess, measure the error and nudge the weights. This runs for weeks or months on thousands of chips, as described in Training vs Inference.
To predict text well, the model has to pick up grammar, common facts, writing styles and coding patterns. The result is a base model. It continues any text you start, but it is not yet an assistant: give it a question and it may simply write more questions, like the next line of a quiz sheet.
The second stage is fine-tuning, which means training further on a smaller, carefully chosen set of examples. People write example conversations that show good answers. Then people rate pairs of answers, and the model is nudged toward the ones they preferred. A widely used version of this is called reinforcement learning from human feedback (RLHF). The result is a chat model that follows instructions and answers helpfully.
What an LLM is good at, and what it is not
An LLM shines at language work where a well-formed answer is the goal and you can judge the result: summarising a long email, drafting a letter, explaining an idea in simpler words, translating, brainstorming names, and writing or explaining code.
It is not a database of verified facts. A database stores checked records you can look up. An LLM stores patterns spread across its weights. Facts that appeared often in its training text usually come out right. Rare facts can come out wrong, and they sound just as fluent, a problem covered in the last lesson of this section.
It is also not a calculator. It produces digits the same way it produces words, as likely-looking text, so long sums can go wrong. Many chat apps quietly hand such sums to a real calculator tool instead.
Frozen after training, with a cutoff date
Once training ends, the weights are saved and stop changing. Every chat you have is inference, running the finished model. It does not learn from your conversation. It seems to remember earlier messages only because the app sends the whole chat again with each new question.
Some apps offer a "memory" feature. That is the app saving notes about you and quietly adding them to later chats; the weights are untouched. A company may also use past chats to train a future version, depending on your settings, but that is a new model, not this one learning live.
Training text is collected up to a date called the knowledge cutoff. Ask about events after it and the model either says it does not know or guesses. Chatbots with web search work around this by fetching pages and placing them in the text the model reads.
Check yourself
Why can the same question get two differently worded answers?
The software picks among several likely next tokens instead of always the top one, and one early difference changes everything after it.
You tell a chatbot your name, then start a new chat. Has the model learned your name?
No. The weights are frozen; only an app memory feature that saves a note and adds it to new chats would make it seem to know.
Why is a base model, straight out of pretraining, not yet a good assistant?
It only learned to continue text, so it may extend your question instead of answering it; fine-tuning teaches it to follow instructions.