AI models like ChatGPT continue to amaze people with their ability to converse, explain, write, and even comfort. Many of us have had the same moment of astonishment: How can a machine talk like this? How can it solve problems, analyse literature, write code, and create art? To understand this, we have to look beneath the surface and ask a simple but essential question, “What are models like GPT-4 made of, and how are they trained to behave the way they do?” This article walks through the core ideas—slowly, clearly, and in plain English.
The AI Triad: Data, Algorithms, Compute
Every modern AI system rests on three pillars known as the AI Triad. Data is the text, images, audio, and other information the model learns from. Without data, the model knows nothing. Algorithms are the mathematical rules and procedures that learn patterns from the data and generate outputs. Compute refers to the specialised hardware—especially GPUs—that run the algorithms during training. These three components shape what an AI system can do, how powerful it becomes, and how safely it can be deployed.
Now let’s delve deeper into each pillar of the AI Triad.
Where Does the Data Come From?
Models like GPT-4 belong to a class of systems called large language models (LLMs). They are trained on massive collections of text gathered from publicly available parts of the internet, books and research papers, licensed data sets, human-written examples, code repositories and even multimodal sources (for image and audio capabilities). During training, the model reads massive amounts of text and gradually transforms that information into numerical patterns called parameters.
Parameters don’t store the original text. Instead, they store a kind of compressed mathematical representation of everything the model learned by reading the text. This compression happens because the model only keeps what is useful for predicting the next word, not the full text it saw. This is why the compression is lossy: the model keeps only what is useful for prediction.
However, the key question here is why is a LLM trying to predict the next word?
What Does It Mean to Train an AI Model?
A large language model is, at its core, a sophisticated mathematical function that predicts the next word or token (3Blue1Brown 0:43). For any text you give it, the model assigns a probability to all possible next tokens and chooses the most likely one or samples from the top few. This then leads us to the question how does the model learn to assign those probabilities? The answer lies in neural networks.
Neural Networks: Billions of Parameters Learning from Examples
A simple neural network might take an input x and compute an output y using parameters:
y = ax + b, where ‘a’ is a parameter and ‘b’ is a weight.
Now imagine this not with one equation but with hundreds of billions of adjustable parameters interacting in complex layers. These parameters start off random—meaning the model initially outputs gibberish. During training, the model is given part of a sentence as an input. It tries to predict the next token. Its prediction is then compared with the correct answer. A mathematical process called backpropagation slowly adjusts the parameters so that the correct answer becomes more likely next time.
This process is repeated again and again trillions of times and eventually, the model becomes astonishingly good prediction and as a result at language. This is called as pretraining a model.
So do models keep processing one word at a time?
Transformers and the Power of Parallel Processing
Older models processed text one word at a time. This became too slow as data sizes exploded.
The breakthrough came in 2017 when Google introduced the Transformer architecture, the design that powers modern AI systems (3Blue1Brown). Transformers have two key innovations.
Parallel Processing in Transformer models process text all at once, in parallel, rather than left to right. This requires enormous compute power, which is why modern GPUs (and now AI accelerators) are essential.
The process of Attention lets every word in a sentence “look at” every other word at the same time. This helps the model understand context, nuance, and meaning. For example, the word “sunny” means something different in “My name is Sunny” and in “It is a sunny day.” Attention helps the model tell the difference.
Beyond Pretraining: RLHF and Human Guidance
Once pretraining is complete, the model can predict text—but prediction alone is not enough to make it helpful, safe, or conversational. That’s where Reinforcement Learning from Human Feedback (RLHF) comes in. For any prompt that a model is expected to answer, a human writes preferred answers to the prompts, ranks multiple model outputs and flags harmful or unhelpful responses. The model then learns to align its behaviour with human intentions and safety guidelines. This is what turns a raw LLM into a helpful assistant like ChatGPT.
Putting It All Together
Training a system like GPT-4 therefore requires enormous amounts of diverse data, sophisticated algorithms that learn patterns, massive compute to run the training efficiently and human feedback to shape its behaviour. At its heart, though, a large language model is still a mathematical system that predicts the next word. What makes it feel almost magical is the scale at which this simple idea is applied.
Conclusion
Understanding how LLMs are trained helps us appreciate both their power and their limitations. They are not databases or reasoning machines—they are pattern learners. They do not “know” the world directly but infer it from statistical footprints left in text. As we build and deploy these systems, especially in high-stakes environments, this basic understanding becomes essential for governance, ethics, and safety.
Citation:
-3Blue1Brown. “Large Language Models explained briefly.” YouTube, 20 Nov. 2024, www.youtube.com/watch?v=LPZh9BOjkQs&t=41s.
