Start with the milk
“She put the milk in the...”
You’d probably finish that sentence with “fridge”. You know something about language, milk and keeping food cold. Change it to “The milk had been in the sun all day, so she decided to...” and you’ll probably suggest throwing it away.
A language model learns through a mathematical version of this exercise: predict the next piece of text, measure the mistake, then adjust the system to improve its predictions.
Repeated across enormous amounts of material, this can teach grammar, facts, writing styles and patterns of problem-solving. That’s the starting point for a large language model, or LLM.
Tokens: the pieces it works with
The model usually processes tokens, which can be whole words, parts of words, punctuation or other pieces of text. A tokeniser divides the text into pieces and gives each one an ID number. 1
Think of letter tiles mixed with common word fragments. Familiar words can be represented compactly; an unusual surname or invented word can be assembled from smaller pieces.
So an unfamiliar word doesn’t necessarily defeat it. If you explain that a “fluffatron” removes cat hair from sofas, the model can use your definition while answering. It hasn’t necessarily learned that definition permanently.
The ID is just a label, like a library catalogue number. Two models can give “the” different IDs, split other words differently and learn different numerical representations.
Embeddings: where the numbers come from
Each token ID points to a row in an embedding table. Imagine a huge spreadsheet with one row per token and hundreds or thousands of numbers in each row.
Those numbers usually start as random values. During training, they’re adjusted along with the rest of the model’s settings. Nobody has to decide in advance what the numbers for “cat” should be. 2
As the model encounters cats, dogs, feeding and pets in related situations, useful relationships can develop between their representations. That happens because those relationships help it predict text.
Imagine making a map from records of journeys. You begin with towns scattered randomly, then keep shifting their positions until the map fits the evidence. Eventually, their positions tell you something useful.
An embedding is a little like a position on that map, with many more coordinates. The coordinates usually don’t have tidy labels such as “fluffiness” or “size”. Meaning depends on patterns across the numbers.
These are starting representations. Later processing uses the surrounding sentence to help distinguish the “bank” beside a river from the “bank” holding your money.
Weights: the settings that training changes
A neural network processes those numbers through connected layers of mathematical operations. A simple artificial neuron multiplies inputs by weights, combines them and applies a function to produce an output.
The resemblance to a biological neuron is very loose. Think of weights as adjustable dials on a mixing desk: changing the settings changes what comes out, even when the incoming recordings stay the same.
An “8-billion-parameter model” has roughly 8 billion learned numerical settings. Parameters include weights and other adjustable quantities. They aren’t 8 billion words or neatly labelled facts.
The temporary numerical results produced while it processes an input are called activations. The settings can stay fixed while the activations change with every sentence.
This grew from decades of research. Rosenblatt described the perceptron, an early trainable network, in 1958. Later networks stacked many layers, giving us the term “deep learning”. 3
Training: learning where to set the dials
At first, the model’s guesses are poor. Given “She put the milk in the...”, it assigns probabilities to possible next tokens. The original passage supplies the answer against which its prediction is checked.
An error score, called the loss, measures how well it did. Backpropagation calculates how changes to the parameters would affect that error; an optimiser uses this information to make small updates. 4
Imagine finding your way downhill in fog. You can’t see the whole valley, but you can estimate the local slope and take a step. Here, the possible directions are changes to an enormous number of settings.
A landmark 1986 paper helped establish learning through backpropagation. The practical recipe is repeated prediction, measurement and adjustment, across many examples.
During ordinary use, those learned settings usually stay fixed. Supplying a new fact in a conversation gives the model something to work with; training changes the machinery itself.
Attention: using the surrounding sentence
Language creates a particular difficulty: something early in a sentence can change the meaning of something much later.
Earlier recurrent networks passed an internal state from one position to the next, like reading while continually updating a short summary. The LSTM, introduced in 1997, improved how information could be kept and discarded. 5
But imagine translating a paragraph when you can only consult your running summary. Keeping the original available would help. Attention gives a model a way to combine information from useful positions as it works.
Consider: “The cat drank the milk because it was hungry.” You’ll probably connect “it” with the cat. Change “hungry” to “delicious”, and you’ll probably connect it with the milk.
Attention calculates how strongly a token should draw on information from other available tokens. Bahdanau and colleagues’ translation work, first posted in 2014, was an influential step in developing this approach. 6
The 3 ingredients are query, key and value. Each is a list of numbers calculated from a token’s current representation using learned weights.
Think of a library. Your query is a request for information. Catalogue entries act like keys that can be matched to the request. The books contain the values, the information you bring together after finding relevant entries.
In the model, matching queries and keys determines how strongly values contribute. Several attention heads make different combinations, and later layers process the updated representations. 7
Those query, key and value numbers depend on the current text. The learned weights used to calculate them can remain unchanged.
The transformer, and what GPT means
A transformer puts attention together with other processing blocks in a neural-network design. Vaswani and colleagues introduced it in the 2017 paper “Attention Is All You Need”. 7
It let more training calculations happen in parallel, helping computers process many positions together rather than waiting for a running state to move through them in order.
GPT stands for Generative Pre-trained Transformer. “Generative” means it produces new text; “pre-trained” means it first learns broad patterns from a large collection; “transformer” names the network design.
The GPT work appeared in 2018, combining generative pretraining with adaptation to language tasks. GPT-3, reported in 2020, showed how a much larger model could perform many tasks from instructions and examples in its input. 8,9
To answer, the model scores possible next tokens, the software selects one, adds it to the text and repeats. Each new choice changes the input for the next prediction.
Further training can make the model more useful as an assistant. But a convincing continuation can still be false. Fluency alone doesn’t establish that a fact or citation is real.
Why this needs CPUs and GPUs
All these calculations have to run on physical chips. A CPU, the central processing unit, handles varied general-purpose work and coordinates the computer.
A GPU, the graphics processing unit, excels at large amounts of similar arithmetic across data. Imagine a versatile cook handling varied jobs, alongside a team preparing many similar portions in parallel. 10
Graphics already needed calculations across enormous numbers of pixels. Neural networks turned out to need much of the same kind of repeated arithmetic.
One major operation is matrix multiplication: combining rows and columns of numbers through repeated multiplication and addition. A matrix is a grid; tensor is the broader machine-learning term for arrays with different numbers of axes.
These “dimensions” describe how numbers are arranged. For an image, axes might represent height, width and colour channel. They don’t imply extra physical dimensions.
NVIDIA’s CUDA platform, introduced in 2006, made graphics chips easier to use for general computation. In 2012, AlexNet helped demonstrate what deep learning could achieve with an efficient GPU implementation. 11,12
Memory matters too. Storage holds the files between uses; working memory holds the weights and temporary calculations while they run. A huge pantry won’t compensate for a worktop too small to prepare the meal.
Capacity determines how much fits. Bandwidth determines how quickly the numbers can reach the processors. GPUs also need electricity, cooling and connections to the rest of the system.
What happens when you press Send?
The application assembles your message, instructions, selected conversation history and perhaps documents. This is the context, the material laid out on the model’s workbench.
The trained weights are usually already loaded on the serving machines. The system processes the prompt, then generates successive tokens. A key-value cache reuses earlier attention work to avoid unnecessary recalculation. 13
The context window limits how much material can be available for a response. A document stored elsewhere won’t become available as specific text unless the application supplies it. Even material that fits can be used imperfectly.
That’s different from parameter count. Parameters measure the model’s learned settings. Tokens measure its training material, current input or generated output. Playing more music through a mixing desk doesn’t add more dials.
In a dense model, much of the same network runs for every token. A mixture-of-experts model routes tokens through selected processing blocks, so total parameters and active parameters differ. 14
A bigger model, a longer context and a longer answer can each require more resources, for different reasons.
Tools, agents and the software around the model
Suppose you ask for 17% of 238. The application can tell the model that a calculator tool is available and describe the information it needs.
The model generates a structured request equivalent to “calculator: 0.17 × 238”. The application recognises the request, runs the calculator and receives 40.46. It sends that result back to the model to help form the answer. 15
Generating the request and performing the calculation are separate steps. An API is a defined way for programs to request operations from each other; many tools use APIs to reach other services.
Now ask for a comparison of 3 papers. The model requests a search. The application runs it and calls the model again with the results. The model chooses a paper to open, receives its text and decides what to do next.
This repeated action-and-observation cycle is the basis of many agents: systems that use a model to choose steps towards a task. One apparent reply may involve many model calls and tool operations. 16
The coordinating software is often called an agent harness. It assembles inputs, executes allowed tool requests, returns results and manages when the process continues or stops. 17
The model brings learned capabilities; the surrounding software provides the working arrangement. The same model can therefore behave quite differently in applications with different tools, instructions and checks.
“I’ll save the table” is still generated text. A successful file-writing operation and a check of the saved file provide evidence that the task actually happened.
Memory, local models and smaller versions
“Memory” can mean several things. The weights hold learned patterns. The context holds material available now. Separately stored notes can preserve preferences or project details, ready to be supplied in a later conversation. 18
That notebook doesn’t automatically retrain the model. And summarising a long conversation can lose qualifications or details, just as replacing a thick folder with one page of notes can.
A hosted model runs on someone else’s computers. A local model runs on hardware you control, often using downloaded trained weights. You usually don’t need to repeat the original training before using it.
Smaller models generally need fewer resources, although performance depends on their training and the task. Quantisation saves space by representing the settings with fewer possible values. Parameter count can stay the same. 19
Distillation trains a student using signals from a teacher model. Like an apprentice taught through selected examples, it can acquire useful abilities without acquiring everything its teacher can do. 20
These methods can make models practical on ordinary machines. How much capability changes needs checking on the work you want done.
And pictures and video?
Images are arrays of numbers too. Networks can turn image patches into representations that a language model uses when describing a picture. 21
Making a picture can use a different process. A diffusion model learns transformations that turn noise into a coherent sample, often guided by text. Video generation must also preserve relationships across time. 22,23
The interface may look like a conversation. Behind it, different models, tools and programs can be doing different jobs. Understanding those parts makes it easier to judge what a system can do, what it costs to run and what needs checking.
Optional referenceA glossary to dip into
- Activation
- A temporary numerical result produced while the network processes an input. An activation function is the mathematical transformation used by a unit; the terms are related but distinct.
- Agent
- A system that uses a model to choose actions across several steps towards a task, usually with tools and a loop that returns their results.
- API
- Application programming interface: a defined way for one program to request a service or operation from another.
- Arguments / schema
- Arguments are the values supplied in a request. A schema specifies the allowed structure, names and types, for example a search tool requiring a text query.
- Attention
- A calculation that combines information from available token representations using input-dependent weights. These attention weights differ from the model’s learned parameters.
- Batch
- A group of examples or requests processed together. Batching can improve overall throughput while affecting how long an individual request waits.
- Checkpoint
- A saved state from training. A training checkpoint can include model parameters and additional information needed to resume training.
- Context window
- The limit on material the model can consider in a request. Instructions, supplied history, tool results and generated text can occupy that space.
- Embedding / vector
- An embedding is a learned numerical representation. A vector is a list of numbers; embeddings and many temporary representations take this form.
- Evaluation
- Testing whether a model or complete system performs the intended work correctly. A benchmark is a defined set of test tasks.
- Fine-tuning / LoRA
- Fine-tuning makes further parameter updates to an existing model. LoRA learns a smaller set of updates while keeping the original weights frozen.
- GPT / LLM
- GPT means Generative Pre-trained Transformer, a particular model family. LLM means large language model, the wider category.
- Harness / orchestration
- The harness is the software arranging model inputs, tool execution, context and the action loop. Orchestration means coordinating the steps. Usage varies between systems.
- Inference
- Running a trained model to calculate an output. In ordinary inference, the trained parameters stay fixed.
- Key-value cache
- Stored attention information reused during generation. It saves calculation and occupies working memory; it isn’t by itself a lasting notebook about the user.
- Logit / softmax
- Logits are scores before conversion into probabilities. Softmax turns a set of scores into positive proportions that sum to 1.
- Matrix / tensor
- A matrix is a grid of numbers with 2 axes. Tensor is the broader array term used in machine learning, including scalars, vectors, matrices and arrays with more axes.
- Matrix multiplication
- A rule for combining compatible arrays through repeated multiplication and addition. It performs much of a neural network’s arithmetic.
- Mixture of experts
- A network design that routes each token through selected processing blocks. Total parameter count and the number active per token differ.
- Parameters / weights
- Learned numerical settings. Weights are parameters, alongside other learned quantities such as biases. Parameter count is one measure of model size.
- Precision / quantisation
- Precision concerns how numbers are represented. Quantisation uses a representation with fewer possible values, often saving memory while potentially changing performance.
- Prefill / decoding
- Prefill processes the supplied prompt. Decoding generates successive output tokens, using the available context and cached calculations.
- Prompt / system instructions
- A prompt is input supplied to the model. Applications can include instructions describing its role, available tools and rules, alongside the user’s request.
- Retrieval / RAG
- Retrieval finds relevant stored material. Retrieval-augmented generation supplies retrieved material for the model to use while producing an answer.
- Runtime / inference engine
- Software that loads a model and carries out its calculations on the available hardware. This differs from the harness coordinating the wider task.
- Skill / workflow
- A skill is usually a reusable set of task instructions. A workflow specifies a sequence of operations; some steps can involve model-selected actions.
- Temperature
- A setting affecting how concentrated the token-selection probabilities are. Lower temperature doesn’t establish whether an answer is true.
- Token / tokeniser
- A token is a piece of text represented by an ID. A tokeniser converts text into those pieces and IDs; different models can use different tokenisers.
- Tool call
- A structured request generated by the model for surrounding software to execute. A generated request alone doesn’t establish that execution succeeded.
- Transformer
- A neural-network architecture using attention alongside other processing blocks. Transformer-based systems can be trained for language, vision and other kinds of data.
- Training / distillation
- Training adjusts parameters using examples and feedback. Distillation trains a student using signals from a teacher model; the student needn’t acquire every teacher capability.
- VRAM / bandwidth
- VRAM is working memory associated with a GPU. Capacity measures how much fits; bandwidth measures how quickly data can move.
References
Primary research, technical documentation and company disclosures. Preprints are identified. Sources checked on 22 October 2026. Technical papers describe particular systems or experiments; they don’t disclose every commercial model.
- Kudo, Taku, Richardson, John. SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing. arXiv. 2018. Preprint; arXiv:1808.06226. DOI: 10.48550/arXiv.1808.06226. Source ↗
- Yoshua Bengio, Réjean Ducharme, Pascal Vincent, Christian Jauvin. A Neural Probabilistic Language Model. Journal of Machine Learning Research. 2003. 3:1137-1155. Accessed 22 October 2026. Source ↗
- F. Rosenblatt. The perceptron: A probabilistic model for information storage and organization in the brain. Psychological Review. 1958. 65(6):386-408. DOI: 10.1037/h0042519. Source ↗
- David E. Rumelhart, Geoffrey E. Hinton, Ronald J. Williams. Learning representations by back-propagating errors. Nature. 1986. 323(6088):533-536. DOI: 10.1038/323533a0. Source ↗
- Sepp Hochreiter, Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation. 1997. 9(8):1735-1780. DOI: 10.1162/neco.1997.9.8.1735. Source ↗
- Bahdanau, Dzmitry, Cho, Kyunghyun, Bengio, Yoshua. Neural Machine Translation by Jointly Learning to Align and Translate. arXiv. 2014. Preprint; arXiv:1409.0473. DOI: 10.48550/arXiv.1409.0473. Source ↗
- Vaswani, Ashish, Shazeer, Noam, Parmar, Niki, Uszkoreit, Jakob, Jones, Llion, Gomez, Aidan N., et al. Attention Is All You Need. arXiv. 2017. Preprint; arXiv:1706.03762. DOI: 10.48550/arXiv.1706.03762. Source ↗
- Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever. Improving Language Understanding by Generative Pre-Training. OpenAI. 2018. Accessed 22 October 2026. Source ↗
- Brown, Tom B., Mann, Benjamin, Ryder, Nick, Subbiah, Melanie, Kaplan, Jared, Dhariwal, Prafulla, et al. Language Models are Few-Shot Learners. arXiv. 2020. Preprint; arXiv:2005.14165. DOI: 10.48550/arXiv.2005.14165. Source ↗
- NVIDIA. GPU Performance Background User’s Guide. NVIDIA. n.d.. Accessed 22 October 2026. Source ↗
- NVIDIA. What Is CUDA?. NVIDIA. 2012. Accessed 22 October 2026. Source ↗
- Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. Advances in Neural Information Processing Systems 25. 2012. Accessed 22 October 2026. Source ↗
- Kwon, Woosuk, Li, Zhuohan, Zhuang, Siyuan, Sheng, Ying, Zheng, Lianmin, Yu, Cody Hao, et al. Efficient Memory Management for Large Language Model Serving with PagedAttention. arXiv. 2023. Preprint; arXiv:2309.06180. DOI: 10.48550/arXiv.2309.06180. Source ↗
- DeepSeek-AI, Liu, Aixin, Feng, Bei, Xue, Bing, Wang, Bingxuan, Wu, Bochao, et al. DeepSeek-V3 Technical Report. arXiv. 2024. Preprint; arXiv:2412.19437. DOI: 10.48550/arXiv.2412.19437. Source ↗
- Timo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, et al. Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv. 2023. Preprint; arXiv:2302.04761. DOI: 10.48550/arXiv.2302.04761. Source ↗
- Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, et al. ReAct: Synergizing Reasoning and Acting in Language Models. arXiv. 2022. Preprint; arXiv:2210.03629. DOI: 10.48550/arXiv.2210.03629. Source ↗
- Anthropic. Effective harnesses for long-running agents. Anthropic. 2025. Accessed 22 October 2026. Source ↗
- Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, et al. MemGPT: Towards LLMs as Operating Systems. arXiv. 2023. Preprint; arXiv:2310.08560. DOI: 10.48550/arXiv.2310.08560. Source ↗
- Frantar, Elias, Ashkboos, Saleh, Hoefler, Torsten, Alistarh, Dan. GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers. arXiv. 2022. Preprint; arXiv:2210.17323. DOI: 10.48550/arXiv.2210.17323. Source ↗
- Hinton, Geoffrey, Vinyals, Oriol, Dean, Jeff. Distilling the Knowledge in a Neural Network. arXiv. 2015. Preprint; arXiv:1503.02531. DOI: 10.48550/arXiv.1503.02531. Source ↗
- Dosovitskiy, Alexey, Beyer, Lucas, Kolesnikov, Alexander, Weissenborn, Dirk, Zhai, Xiaohua, Unterthiner, Thomas, et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv. 2020. Preprint; arXiv:2010.11929. DOI: 10.48550/arXiv.2010.11929. Source ↗
- Ho, Jonathan, Jain, Ajay, Abbeel, Pieter. Denoising Diffusion Probabilistic Models. arXiv. 2020. Preprint; arXiv:2006.11239. DOI: 10.48550/arXiv.2006.11239. Source ↗
- Ho, Jonathan, Salimans, Tim, Gritsenko, Alexey, Chan, William, Norouzi, Mohammad, Fleet, David J.. Video Diffusion Models. arXiv. 2022. Preprint; arXiv:2204.03458. DOI: 10.48550/arXiv.2204.03458. Source ↗