It’s the engine behind ChatGPT, Gemini, Claude and any AI agent that answers a phone or a WhatsApp message. Understanding how it works explains both what it does well and why it sometimes states, perfectly calmly, something that isn’t true. Here’s what it is, how it reads and writes, how it’s trained, why it gets things wrong and what role it plays inside an agent.
In short
- LLM stands for large language model.
- It doesn’t read words but tokens, pieces of words: “won’t” is two, “won” and “’t”.
- It writes by working out, token by token, what is most likely to come after what’s already there.
- It knows what it read during training, not what happens in your company; that has to be given to it with every answer.
- It makes things up because, according to a 2025 study, the way it’s trained and evaluated rewards guessing over saying “I don’t know”.
What is an LLM?
A language model is a program that, given some text, works out what is most likely to come next. Google’s Machine Learning Crash Course defines it this way: a model that estimates the probability of a token, or a sequence of tokens, occurring within a longer sequence. With that single skill, repeated many times, it can write an email, summarize a service report, translate a manual or answer a customer.
“Large” refers to two things. The amount of text it learns from, which according to IBM runs to billions or trillions of words from books, articles, websites and code. And the size of the model itself, measured in parameters, the numbers adjusted during training: according to Google, today’s models have hundreds of billions, or even trillions.
Almost all of them are built on the same piece, the transformer, introduced by Google researchers in 2017 in a paper with a title that has become famous, “Attention Is All You Need”. Its central idea, self-attention, is that to understand each piece of the text, the model looks at how much every other piece bears on it. That’s how it knows that in “the boiler in block 3 won’t fire and its pilot light is blinking”, “its” refers to the boiler and not to the block.
How does an LLM read? Tokens
An LLM doesn’t read letters or whole words, but tokens: pieces of text that can be a word, part of a word or a punctuation mark. Before it reaches the model, every sentence is split into tokens by a tokenizer, and each token is turned into a number, its position in the model’s vocabulary. This is how it reads a typical service request, split by a public tokenizer; under each token, its number in the vocabulary:
The sentence
The boiler won’t heat up and the display shows error code E04.
What the model reads: 15 tokens
- The976
- boiler35652
- won3313
- ’t1573
- heat10609
- up869
- and326
- the290
- display4589
- shows7398
- error2915
- code3490
- E457
- 043000
- .13
Common English words like “boiler” and “display” are a single token each. “Won’t” isn’t: the tokenizer splits it into “won” and “’t”. The error code breaks in two as well, “E” and “04”, and with exactly the same numbers, 457 and 3000, as in the same sentence in Spanish. The model doesn’t see the word “won’t”: it sees 3313 followed by 1573, and it has learned from millions of texts what those two numbers together mean.
Tokens matter for two practical reasons. The first is price: providers charge per token read and written, not per word or per message. The second is the limit on how much it can read at once, the context window, which is also counted in tokens. And language matters: this sentence is 15 tokens, while its Spanish translation, “La caldera no calienta y en la pantalla sale el código E04”, is 16 with the same tokenizer, because “caldera” (boiler) is split into two pieces.
How does it write? The next word
To write, an LLM always does the same thing: it looks at all the text it has so far, works out the probability of every possible token for the next slot, picks one, adds it to the end and starts again. A ten-line answer is a few hundred turns of that loop. There’s no plan written in advance: the answer comes out token by token. This is what a commercial model calculated for the start of a call:
The text so far
“Good morning, I’m calling because the boiler…”
What could come next, according to the model
- is98.0%
- st…1.4%
- has0.3%
- won0.2%
“St” is the token that starts words like “stopped”. The model gives 98% to “is”. That makes sense: in almost everything it has read, someone calling about “the boiler” is about to say what’s wrong with it. But it’s worth noticing what that figure is not. The model knows nothing about this boiler or this customer; it knows how sentences like this one usually go on. If the customer is calling to book a service visit, the model will have bet wrong, and with the same confidence.
That’s the key to everything else. An LLM is extraordinarily good at writing what is likely to be said. Whether it’s true is another matter, and depends on what it has in front of it while it writes.
How is an LLM trained?
Training has two parts. The first, pre-training, is what makes it a language model: it’s given billions of sentences with the ending hidden and its parameters are adjusted, bit by bit, so it gets better and better at guessing what came next. Nobody explains grammar to it or labels anything; IBM calls it self-supervised learning, because the text itself acts as the answer key. At the end, the model can continue almost any text, but it still can’t hold a conversation or follow instructions.
The second part is fine-tuning. First it’s shown examples of instructions answered well. Then reinforcement learning from human feedback, RLHF, is used: people compare several of the model’s answers, rank them from best to worst, and the model is trained to prefer the ones people rate higher. That’s what makes a model answer the question instead of continuing it, and do so in a helpful tone.
That second step matters more than it seems. In the 2022 paper that popularized it, people preferred the answers of a 1.3-billion-parameter model tuned this way to those of an untuned 175-billion-parameter model, with a hundred times fewer parameters. Size helps, but how it was taught to answer counts as much as size.
What does it know and not know?
An LLM knows what was in the text it was trained on, and nothing else. It doesn’t know what happened after that date, which is called the knowledge cutoff. And, above all for a company, it knows nothing that isn’t public: not your rates, not who’s on call this weekend, not what was replaced on a customer’s boiler last month.
There are two ways to give it that. One is to put it in front of the model when it answers: search your documents and your systems for what relates to the question and pass it along with the question. That’s called RAG, and it’s the usual approach, because the data can change every day without touching the model. The other is to tune the model itself on your texts, fine-tuning, which is better for teaching it a way of answering than for learning facts that change.
Why does it make things up?
When an LLM gives a false fact with the same confidence as a true one, it’s said to hallucinate, and it isn’t a rare glitch. Google’s course says it plainly: language models hallucinate, and their predictions often contain mistakes. IBM describes it as false or misleading information that sounds plausible.
The clearest explanation came in 2025 from Adam Tauman Kalai and three other researchers, in a paper titled, fittingly, “Why Language Models Hallucinate”. Their argument is that models are trained and evaluated like a student taking a multiple-choice test with no penalty for wrong answers: if they don’t know, guessing pays better than leaving it blank. A model that says “I don’t know” scores worse than one that takes a chance.

What does an LLM do inside an AI agent?
On its own, an LLM writes text. An AI agent is an LLM that has been given a goal, tools and rules. The model is the part that understands what the customer writes and decides the next step: ask for the address, look up the contract in the ERP, open the work order or hand the request to a person. The tools are what actually do those things, and the rules set what it must never do.
The difference from using the bare model is where the facts come from. When an agent says the customer has a contract with 24-hour service, the model hasn’t “remembered” that: it read it in the ERP a second earlier. The model brings the language and the judgment; your systems bring the facts. That’s how we work at Delegic: the model writes and decides, but it only states what it has read in your systems or your procedures, and what it can’t find, it asks about or hands to a person.
Is an LLM the same as generative AI or a chatbot?
Not quite. Generative AI is the broad name for AI that creates new content: text, images, audio or video. LLMs are the part of generative AI that works with text. A chatbot is a program that holds a conversation, and it may or may not have an LLM inside: older ones followed menu trees. And ChatGPT, Gemini or Claude are products, applications with an LLM inside and an interface to talk to it; the model is the engine, and the product is the whole car.
Frequently asked questions
What does LLM stand for?
Large language model. It’s also often just called a language model.
Does an LLM understand what it reads?
It depends on what you mean by understand. It grasps the meaning of a text very well, knows what each thing refers to and answers coherently. But it doesn’t check whether what it writes is true: it writes what is likely. For business use, the prudent approach is to treat it as someone very capable who doesn’t know your company and won’t say “I don’t know” unless taught to.
Does it learn from what we tell it?
Not while it’s talking to you: what it reads in a conversation is used for that answer, but it doesn’t change its parameters. What the provider does with those conversations afterwards is another matter, and depends on its contract. It’s worth getting in writing that they aren’t used to train models.
What is a parameter?
Each of the numbers the model adjusts during training, which together hold what it has learned. More parameters usually means a more capable model, but also a slower and more expensive one, and it isn’t always worth it: you don’t need the biggest model on the market to take a service request.
Related terms
- RAG: how your documents are given to the model with each answer.
- Hallucination: when the model gives a fact that sounds right but is false.
- Context window: how much text the model can read at once.
- AI agent: a model with a goal, tools and rules.
- Chatbot: a program that holds a conversation, with or without a model inside.