What is a large language model?

A large language model (LLM) is a type of machine-learning model trained on large amounts of text and other data so it can work with language. Many modern systems are based on transformer architectures, which are especially effective at modelling relationships across sequences of tokens.

CORE IDEA

An LLM receives text as tokens, processes those tokens through many learned layers, and produces probabilities for what token should come next. Repeating that prediction step allows it to generate sentences, code and longer responses.

1. Text becomes tokens

Models do not read text exactly the way you do. The input is broken into units called tokens. A token might represent a whole word, part of a word, punctuation or another symbol depending on the tokenizer.

Those tokens are converted into numeric representations that the neural network can process.

2. Training adjusts parameters

During training, the model repeatedly tries to predict missing or next pieces of data. When its prediction is poor, an optimisation process adjusts many internal parameters. Across enormous numbers of examples, those parameters come to encode useful statistical relationships in language and other training data.

Parameters are not a searchable database of sentences. They are learned numerical values that shape how the network transforms inputs into outputs.

3. Attention helps connect context

Transformer models use a mechanism called attention to weigh relationships between different tokens in the current context. This helps the model connect information that may be several words or sentences apart and decide what is relevant to the next prediction.

4. Generation happens one step at a time

When you send a prompt, the model processes the available context and calculates a probability distribution over possible next tokens. A token is selected, added to the context, and the process repeats.

That simple-sounding loop can produce surprisingly complex behaviour because the model and its learned representations are very large and the context contains rich patterns.

Why can an LLM answer questions?

Training on diverse language teaches the model patterns connecting questions, explanations, facts, reasoning steps, styles and code. Additional training and system design can make the model more useful at following instructions. But an LLM can still generate confident-sounding mistakes, so important facts should be verified.

Context is not the same as long-term memory

The text and data available during a conversation form a context window. The model uses that context to produce its next output. Separate product features may add saved memory, retrieval from documents or access to tools, but those are system capabilities around the language model rather than the basic next-token mechanism itself.