Topic Weights
Foundations · How models work · 8 min read
What really changes inside an AI model when it learns?
Weights · Part 1 of 3 · 3 min
How a model is made, starting with one weight
When people say ChatGPT "learned" something, what actually changed inside it is surprisingly concrete. A program that turns an input, like your question, into an answer is called a . On the inside it is a huge collection of numbers called , and learning means adjusting those numbers until the answers come out right. Every model, from ChatGPT to the app that recognizes faces in your photos, is made and used in the same three stages. People design it, learning from past examples sets its numbers, a stage called training, and the finished numbers are saved and put to work. Following one tiny model through those stages shows what a weight is, why chatting with ChatGPT never changes it, and why one model can even grade another.
Take the smallest model there is, one that estimates what a house will sell for. A widely used deep learning textbook, Dive into Deep Learning, builds exactly this from two facts about a home, its size and its age. Before any training happens, someone has to decide what goes in, what should come out and how the two are connected. Together those three choices are the model's blueprint, which engineers call its . Here a home's size and age go in, the sale price that should come out is the , and the connection is the simplest one possible, a straight-line rule.
ChatGPT is the same idea at a vastly bigger scale. It runs on an AI trained on huge amounts of text, largely by predicting the next word, the kind of AI known as a , or LLM. Its designers made the same three decisions. Text goes in, a guess at the next word comes out, and the connection, instead of a single line, is many of calculations stacked together, a neural network.
A straight-line rule is the simplest possible guess about the world. It assumes every extra square foot adds the same amount to the price, and every extra year of age changes it by the same amount, which leaves the model only a few numbers to learn, its . Each fact gets its own number, called a weight, and there is one starting value, the . Nobody writes any of them in. Training works them out from examples.
If you've ever heard a home described by its price per square foot, you already know what a weight is. It's a rate that says how much the answer moves for each extra unit of input, which makes it the of the line for that fact. Bigger homes sell for more, so the weight for size is positive, and if older homes in the data tend to sell for less, the weight for age comes out negative. The model multiplies each fact by its weight to get how much that fact adds to or takes off the price, and adds those amounts to the bias. The textbook puts it plainly. The weights decide how much each fact influences the , and the bias is where the estimate sits before any fact counts.
Real problems rarely hang on two inputs. As Google's machine learning course notes, a more sophisticated model can use many inputs, each with a weight of its own. A fuller house model might add the number of bedrooms or the distance to a good school. Every input is multiplied by its weight and the results are added to the bias. A large weight means its input matters a lot, a weight near zero means it barely matters, and a negative weight pulls the answer down, the way age can.
What comes out is the model's answer for this one home, its prediction. The prediction is worked out fresh for each request and leaves nothing behind, while the weights and the bias stay locked in. That is why asking a model questions never changes what it knows.
In short
A model starts as a design people choose. Its weights are rates that say how much each input moves the answer, so it multiplies inputs by weights and adds the bias, a starting level, to predict one case.
- Inputsfacts about this case, such as a home's size and age
- Times the weightseach weight is a rate, how much the answer moves per unit of inputSet during training, then fixed
- Plus the biasa starting level, so the line sits where the real data areSet during training, then fixed
- The predictionthe model's best guess for this one input
Quick check (optional)
A model estimates how long a food delivery will take from the distance to the restaurant. Its bias is 10 minutes and its weight for distance is 3 minutes per mile. What are those two numbers telling you?
Quick check (optional)
A model predicts a used car's resale price from its mileage, and its weight for mileage is large and negative. What is that weight telling you?
Go deeper
A real model's actual numbers
Google's machine learning course trains the same kind of model on cars, predicting fuel efficiency from how heavy a car is, and it reports the numbers training found. The weight is negative 4.6 and the bias is 34. So every extra thousand pounds lowers the guess by 4.6 miles per gallon, and the line crosses the side of the chart at 34. For a 4,000-pound car, the model multiplies 4 by negative 4.6, adds 34 and predicts 15.6 miles per gallon. Nobody thinks a car weighing nothing would get 34 miles per gallon. The bias is simply the starting level that lets the line run through real cars instead of above or below them. With several inputs, the course writes the same idea as one equation, each input times its own weight, all added to the bias.
What "the direction that reduces the loss" means
The course calls this procedure gradient descent, a mathematical technique that repeatedly finds the weights and bias that give the lowest loss, and the name hides a simple picture. For each weight, training asks whether the loss would rise or fall if that number went up a tiny bit, and the answer is the slope of the loss for that weight. Taken together, the slopes for every weight are the gradient, so training steps each weight a small amount downhill and then asks again from wherever it landed. The size of each step matters more than it sounds, because steps that are too small take forever and steps that are too large can overshoot. Picture the loss as hilly ground, where height is how wrong the model is and the lowest valley is the best set of weights. A step that is too long can jump right over the bottom and land on the far slope.
Not every weight works on every word
Newer models complicate the simple count of weights. DeepSeek-V3, described in a December 2024 paper, was trained on 14.8 trillion tokens after reusing a design DeepSeek had tested on an earlier model. It reports 671 billion total parameters, of which only 37 billion are activated for each token, a word or piece of a word. That is possible because of a design called a mixture of experts, in which the weights are split into many separate blocks and only some of them do the arithmetic for any one token. So the question of how many weights a model has now has two honest answers. The total is how many numbers have to be stored, and the active count is how many do the work on each token, which is why it pays to check which of the two a company is quoting when you compare models.
A judge has blind spots of its own
A judge model is still a model, so its weights carry habits from its own training, and the researchers who studied LLM judges set out to find them. They examined position bias, self-enhancement bias and verbosity bias, along with limits on how well a judge can reason. Position bias means the judge can favor whichever answer it was shown first, self-enhancement bias means it can favor answers that sound like its own, and verbosity bias means it can favor longer answers even when they are no better. The same researchers proposed ways to reduce some of these, and their headline result, over 80% agreement with human preferences, came from strong judges on their own two benchmarks. That is why careful teams treat a judge like any other measuring tool. They swap the order of the answers, keep the grading instructions specific, and check a sample of the judge's grades against people's before trusting it at scale.
For your work · Generalist
Now that you know a model is a saved file of numbers that only training changes, the AI tools you use at work get easier to read. When one says it "learns from you", most often it is saving your earlier messages or notes and sending them back in with each prompt, the way the chat app in this lesson remembered a name, while its weights stay exactly as they were. That is worth knowing, because what the tool "knows" about you then lives somewhere you can usually see, edit or delete, and the two-chat test shows you which kind of memory you are dealing with.
For your career · Telling training apart from use is the skill under most conversations about customizing AI, from memory features to fine-tuning. Inference, the next lesson, follows what happens inside a single reply.
Career paths are getting more detailed and more tailored to you soon.
People to know
Andrej Karpathy
A founding member of OpenAI and later Director of AI at Tesla.
His free course, Neural Networks: Zero to Hero, builds models like the one in this lesson from scratch, in code. It starts with a tiny model that learns to guess the next letter, then grows it video by video into the same kind of model as GPT, so you can watch weights being learned step by step.
Neural Networks: Zero to Hero ↗Words in this lesson (22)
- activation function
- A small bend applied between a neural network's layers. Without it, stacked layers would act like one straight line and could only capture simple patterns.
- activations
- The temporary numbers a model computes for one particular input as it works through its layers. They are thrown away once the answer is out.
- API
- Short for application programming interface, the way a developer's software sends requests to a model and gets answers back.
- architecture
- A model's basic blueprint, chosen by people before training: what it reads, what it predicts and how its calculations are arranged.
- bias
- The model's starting value, added to every guess so its line sits where the real data are. Training sets it along with the weights. In a house-price model it is where the estimate sits before size or age counts.
- checkpoint
- A saved copy of a model's learned weights, written to a file when training stops. Together with the model's design, it is what gets loaded to answer questions.
- gradient descent
- The training method that moves each number a small step in whichever direction lowers the loss, over and over.
- inference
- Using a trained model to produce an answer. The weights stay fixed while it runs.
- label
- The real, known answer for an example, such as the price a house actually sold for. Training compares predictions with labels to measure mistakes.
- large language model
- An AI model trained on huge amounts of text to predict the next word, which is what powers chatbots. Often shortened to LLM.
- layers
- Stages of calculation stacked inside a model. Each layer takes the numbers the one below produced and turns them into new numbers using its own weights.
- loss
- A single number that scores how wrong the model's guesses are on examples with known answers. Training tries to make it smaller.
- model
- A program that has learned from examples to turn an input, such as your question, into an output, such as an answer. Inside, it is a large set of learned numbers.
- neural network
- A model built from many layers of simple calculations, each passing its numbers to the next. Every modern chatbot is one.
- open-weight
- A model whose weights are published, so anyone can download it, run it on their own machines and train it further.
- parameters
- Every number a model learns in training. Weights and biases are both parameters, so the two words are often used loosely for the same thing.
- prediction
- The model's answer for one input, its best guess, such as the price it estimates for one home from its size and age.
- prompt
- The text you give a model as its input, including any instructions or examples.
- slope
- How steeply a line rises or falls. For one input, the slope is its weight, such as how much the price rises for each extra square foot.
- tokens
- The small chunks of text a model reads and writes, such as a word, part of a word or a punctuation mark.
- training
- The stage where a model learns. It guesses on examples with known answers, and its numbers are nudged until the guesses improve. It happens before the model is put to use.
- weights
- The numbers inside a model that training sets. Each one decides how much an input counts toward the answer, and they stay fixed while you use the model.
Sources
Original research and official documents used for this version.
d2l.ai ↗developers.google.com ↗developers.google.com ↗developers.google.com ↗arxiv.org ↗developers.google.com ↗arxiv.org ↗arxiv.org ↗karpathy.ai ↗karpathy.ai ↗