An LLM is a very large deep neural network trained on text. During training, it repeatedly predicts missing or next tokens, measures its errors, and adjusts billions of parameters across many layers. During inference, it keeps those parameters mostly fixed and uses them to predict one next token at a time.
Bridge from deep learning to LLMs: the previous page showed that a neural network is built from layers, weights, and mathematical bias terms. An LLM uses the same idea at a much larger scale. Transformer layers process relationships between tokens; training adjusts huge numbers of weights; inference runs those layers repeatedly to generate text. The mathematical bias term inside a neuron is not the same thing as social or cultural bias in an output.
Engineers create a transformer: many neural-network layers with attention mechanisms that connect tokens to relevant context.
Text becomes tokens. The model predicts tokens, compares predictions with training targets, and uses error feedback to adjust its parameters. Further tuning and human feedback shape behaviour.
Your prompt is tokenised and passed through every layer. The model calculates next-token probabilities, selects a token, appends it, and repeats until the response ends.
Text can contain historical inequalities, stereotypes, dominant viewpoints, missing communities, and unequal representation across languages and cultures.
Dataset selection, filtering, labels, model objectives, safety rules, and human-feedback processes all influence which behaviours are rewarded or suppressed.
Prompts, deployment settings, probability-based token selection, and weak testing for particular groups can expose or amplify learned patterns.
The model starts with many examples of written language.
It practises predicting tokens and adjusts its weights when it is wrong.
The learned patterns are stored as numbers inside the model.
A prompt goes in, then the model predicts one next token at a time.
Text is broken into tokens. A token can be a word, part of a word, or punctuation.
During training, the model practises predicting the next token from earlier tokens.
The useful patterns are saved in weights. This demo shows them as a small table.
During inference, the model uses the prompt and weights to produce tokens one by one.
Choose a tiny dataset, show what patterns training finds, then run inference from a prompt.
In a real LLM, training adjusts billions of weights. In this teaching demo, we show that idea as a small memory table of token patterns.
| Seen Context | Possible Next Token | Why It Learned That |
|---|
The model starts from the prompt, checks which patterns match the recent context, then picks the most likely next token.
This is the core of inference: after training, the model gives candidate next tokens different probabilities.