Parameters: What a Model Learns

Updated · 6 min read

When a model "learns", what actually changes? Advitha, in San Francisco, asks this after her first AI class. Nothing inside the computer grows or remembers in a human way. What changes is a set of numbers inside the model, called parameters. Training adjusts them, little by little, until the model's outputs come out right.

This lesson shows what parameters are, how training adjusts them, and why a model is not a store of answers.

Parameters Are Learned Numbers

Parameters are the numbers inside a model that are adjusted during training. After training, they hold everything the model learned. When the model gets new input, it combines the input with its parameters to produce an output.

Training adjusts parameters until the outputs come out right

Here is an analogy. A sound engineer turns many dials on a mixing board until the music sounds right. Training turns a model's dials, its parameters, until its outputs match the examples. Real models have far more dials than any mixing board, and a computer turns them automatically.

Watching a Parameter Learn

This tiny house-price model has one parameter: a weight, in dollars per square foot. It starts at zero. At each step, the program measures how wrong the model is on three past sales, then nudges the weight to reduce the error:

Python
# Past sales: (area in square feet, price in US dollars)
sales = [(1100, 260_000), (2000, 475_000), (2400, 570_000)]
 
weight = 0.0  # the model's only parameter: dollars per square foot
for step in range(1, 9):
    # How wrong is the model, and in which direction? (bigger houses count more)
    error = sum((weight * area - price) * area for area, price in sales) / len(sales)
    weight -= 0.000000125 * error  # nudge the parameter a little
    print(f"Step {step}: weight = {weight:.1f}")
 
print(f"Prediction for 1,200 sq ft: ${weight * 1200:,.0f}")
Output
Step 1: weight = 108.5
Step 2: weight = 167.4
Step 3: weight = 199.4
Step 4: weight = 216.8
Step 5: weight = 226.2
Step 6: weight = 231.3
Step 7: weight = 234.1
Step 8: weight = 235.6
Prediction for 1,200 sq ft: $282,699

Each step gets closer, and the steps get smaller as the error shrinks. Nobody typed 235.6; the program found it from the data. This step-by-step nudging is the core of how most models train, and the next chapter, on training and inference, explains it in more depth.

From One Parameter to Billions

ModelApproximate parametersWhat they capture
This tiny house-price model1Price per square foot
A handwriting readerThousands to millionsThe shapes of digits and letters
An image recognition modelMillionsEdges, shapes and objects
A large language modelBillionsPatterns of words, facts and styles in text

More parameters let a model capture more complex patterns, but they also need more data, more computing power and more energy to train and run. Bigger isn't always better: a small model trained well on the right data can beat a huge one on a narrow task, and it is cheaper and faster.

Common Mistakes

Thinking a model looks up stored answers. It calculates every output from its parameters; that is why it can answer questions nobody asked during training, and also why it can be wrong.

Thinking parameters are settings a person chooses. Parameters are learned from data. Settings people choose, such as how big each nudge is, are called hyperparameters.

Thinking more parameters always means a better model. Size helps only with enough good data, and a smaller model is often the better choice.

Interview Corner

What are a model's parameters?

The numbers inside a model that are adjusted during training. After training, they hold what the model learned, and the model combines them with new input to produce outputs.

What is the difference between parameters and hyperparameters?

Parameters are learned from data during training, such as the weights of a neural network. Hyperparameters are chosen by people before training, such as the learning rate or the number of training steps.

Practice

Exercise: change the nudge. Run the program, then change 0.000000125 to 0.00000005. Does the weight reach about 236 faster or slower? Why? Then try 0.0000003 and describe what happens to the weight. Write one sentence about why the size of each nudge matters.

Check your understanding:

  1. What are parameters, in one sentence?
  2. In the Python example, where did 235.6 come from?
  3. Why isn't a bigger model always better?

Quick check: parameters

4 questions
1What happens to parameters during training?
2Which statement is true?
3Which is a hyperparameter rather than a parameter?
4A large language model has billions of parameters. What does that mostly tell you?

Key Takeaways

Quick reference

TermMeaning
ParameterA number inside a model, learned during training
WeightA common kind of parameter that scales an input
Training stepOne round of measuring the error and nudging the parameters
HyperparameterA setting people choose before training, such as the step size

Was this tutorial helpful?

Lesson 14 of 186