What Is a Large Language Model?
What an LLM is, how it writes one token at a time, how it is trained, and where it goes wrong, explained simply for your AI interview.
In short
A large language model (LLM) is an AI model with a very large number of parameters, trained on huge amounts of text to predict the next token. It writes one small piece at a time, so it can sound fluent while being wrong.
11 min readBeginnerVery common · estimateFacts checked 26 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
A large language model is an AI model with a very large number of parameters, which are the numbers it learns during training. It is trained on huge amounts of text to predict the next token, a small piece of text such as a word or part of a word. It writes a reply one token at a time, so it can sound fluent and still be wrong. It predicts text and does not check facts on its own. So in a real product I give it the facts it needs, check its output, and keep the important decisions in code.
A large language model, or LLM, is a neural network, a type of software that learns patterns from examples, with a very large number of parameters. Parameters are the numbers the model adjusts during training. Google's definition is short: at a minimum, a language model with a very high number of parameters. More informally, Google's glossary uses the term for any Transformer-based language model. A Transformer is a design that uses attention, a way of weighing which words matter most to each other.
Training works by prediction. The model reads a huge amount of text and repeatedly guesses the next token, which is a word or part of a word. Each wrong guess nudges the parameters a little. After a very large number of these nudges, it has learned grammar, facts about the world and patterns that look like reasoning, all stored in its parameters.
Writing is the same loop. Given your prompt, the model scores every possible next token, picks one, adds it to the text, and repeats. Its working memory for one conversation is the context window, the number of tokens it can read at once.
The limits follow from this design. Its knowledge comes from training and from whatever you put in the prompt, so it needs tools to look anything up live. Because it predicts plausible text, it can hallucinate, which means it states false things in a fluent, sure tone. In a real product I supply the facts, check the output and keep the decisions in code.
What is a large language model, in plain words?
Picture a claims handler at an insurance company who has read thousands of policy wordings. Asked to finish a sentence in a customer letter, they write from the pattern of policy language they have absorbed. Most of the time it is right. Sometimes it sounds right and is wrong, because they remembered the pattern instead of checking the policy on file.
A large language model, or LLM, does the same thing with text. It has absorbed patterns from a very large amount of writing, and it predicts what comes next. Chat assistants such as Claude are built on this kind of model.
“At a minimum, a language model having a very high number of parameters.”
Google, machine learning glossary
“Large language models (LLMs) are AI language models with many parameters that are capable of performing a variety of surprisingly useful tasks.”
Anthropic, glossary
Key words
- Parameter
- A number inside the model that training adjusts. A large model has a very great many of them.
- Token
- A small piece of text the model reads or writes: a word, part of a word, or a single character.
- Pretraining
- The first, general training pass on a huge pile of text.
- Context window
- How many tokens the model can read at once. Its working memory for one conversation.
How does an LLM write a reply, one token at a time?
An LLM does not write whole sentences in one go. It writes tokens. Google's crash course puts it simply: LLMs predict a token or sequence of tokens. A token can be a word, part of a word or a single character.
- 1
Read the text so far
Your prompt and the reply so far, cut into tokens.
- 2
Score every next token
The model gives each possible next token a chance of coming next.
- 3
Pick one
Pick one token from those chances. Temperature, a setting, controls how much the choice varies.
- 4
Add it and repeat
The new token joins the text, and the loop runs until the reply ends.
How one reply is built
Text so far
your prompt and the reply so far
Language model
scores every possible next token
Chances for each token
the chances add up to 100%
Pick one token
chosen by its chance
Add it and repeat
stops when the reply ends
- 1Your prompt and the reply so far are cut into tokens.
- 2The model gives every possible next token a chance.
- 3The chances across all the options add up to 100%.
- 4The model takes one token, based on those chances.
- 5The token joins the text, and the loop repeats until the reply ends.
Google's glossary adds that, more informally, the term covers any Transformer-based language model. The Transformer is a design "based solely on attention mechanisms": as it reads, each token weighs how much the other tokens in the text matter to it.
Tip
Say the loop out loud: read, score, pick, add, repeat. It shows you know the mechanics, not just the buzzwords.
How is an LLM trained?
Training has two big passes. The first is pretraining, the general step on a huge pile of text. The second is fine-tuning, which teaches a specific job or behaviour.
- Pretraining
General language
The model predicts the next token across a huge pile of text. This builds broad language skill.
- Fine-tuning
One job, one style
A second training run on examples of one task, such as answering questions in a chat format.
Two training passes
Huge pile of text
raw text, with no labels
1. Pretraining
Predict the next token
learns general language patterns
2. Fine-tuning
Examples of one job
answers in the style you want
Assistant model
follows instructions in a chat
- 1Pretraining reads a huge pile of text and predicts the next token.
- 2Fine-tuning is a second pass on examples of one job.
- 3The tuned model follows instructions in a chat, which pretraining alone does not teach well.
Pretrained models are not built to chat. Anthropic's glossary says they are not inherently good at answering questions or following instructions, which is why the second pass matters.
Chat assistants add further tuning. Anthropic's glossary says fine-tuning and RLHF are used to refine these pretrained models, making them more useful for a wide range of tasks.
Why can a fluent answer still be wrong?
Because the model predicts plausible text, it can produce an answer that sounds sure and is false. The field has a name for this: hallucination.
“The production of plausible-seeming but factually incorrect output by a generative AI model that purports to be making an assertion about the real world.”
Google, machine learning glossary
- Known from training
Learned patterns
Its knowledge sits in its parameters. It cannot check a fact against a source unless you give it one.
- Given in the prompt
Working memory
Anything you paste in sits in the context window. The model reads it as it writes.
Anthropic's glossary calls the context window the model's "working memory", separate from the data it was trained on. Answers can also change between runs: temperature is a setting that controls how random the model's picks are, and Anthropic notes that even at temperature 0 the results will not be fully deterministic.
Worked example. Here is a made-up claims letter at a home insurer. The model drafts a line about a burst pipe. The chances are invented for this example, and they favour a figure that is not in the policy on file. The model cannot tell the difference, so code checks the figure before the letter goes out.
# A simplified claims-letter step. The chances are invented for this example, not from a real model.
POLICY = "Water damage from a sudden pipe burst is covered up to 18,000 dollars, after a 750 dollar excess."
NEXT_OPTIONS = [("25,000", 0.46), ("18,000", 0.31), ("10,000", 0.15), ("unlimited", 0.08)]
def pick_most_likely(options):
# Greedy choice: always take the option with the highest chance.
return max(options, key=lambda option: option[1])
amount, chance = pick_most_likely(NEXT_OPTIONS)
draft = "Your policy covers water damage from a burst pipe up to $" + amount + "."
print("Draft:", draft)
print("Chance of that pick:", chance)
def check_against_policy(figure):
# Code, not the model, decides whether a figure is on file.
if " " + figure + " " in " " + POLICY + " ":
return "OK: " + figure + " is in the policy"
return "HOLD: " + figure + " is not in the policy, send to a claims handler"
print(check_against_policy(amount))Output
Draft: Your policy covers water damage from a burst pipe up to $25,000. Chance of that pick: 0.46 HOLD: 25,000 is not in the policy, send to a claims handler
Tip
In an interview, lead with the fix: the figure comes from the policy document that code retrieves, and a check in code blocks any figure that is not on file. It cannot tell whether a figure on file is used correctly, so the drafting step should also name the field it fills.
What does the interviewer want to hear?
A strong answer covers
- A plain definition: a very large model that predicts the next token.
- Parameters and training: learned from huge text by predicting tokens.
- How a reply forms: one token at a time, from the text so far.
- Pretraining vs fine-tuning, and what each one adds.
- Hallucination and the context window as the two limits to plan for.
- Honest about variation: the same prompt can give different wording.
Common traps
Trap"An LLM looks the answer up in a database."
BetterIt predicts text from patterns in its parameters. It only reads what is in the context window or what a tool returns.
Trap"It understands things the way a person does."
BetterDescribe what it does: it predicts tokens well, and that can look like understanding. Do not overclaim.
Trap"A bigger model is always the better choice for my product."
BetterSize is one choice. Cost, speed and the task decide it, so test candidates on your own examples.
Can you spot the problem?
Spot the problem
A claims assistant drafts a customer letter. Which line is the risk?
Quick check
What does a large language model do when it writes a reply?
Can you answer these from memory?
Flash cards · tap a card to flip it
What will they ask next?
Learn it in depth
Last updated on 26 November 2026
Building a product on an LLM for your team?
I design and build AI products and agents: the interface and the system behind it, with checks on the model's output. Book a short call and tell me what you need.