Definition
What is Hyperparameter?
Hyperparameter is a hyperparameter is a setting chosen by people before training begins, such as the learning rate or batch size, that controls how a model learns rather than being learned from the data itself.
A hyperparameter is a dial that a person sets before a model starts learning. The model never changes it on its own. That is the difference from a parameter, which the model adjusts itself during training.
Parameters versus hyperparameters
Think of baking bread. The recipe says how long to bake and at what temperature. Those are the hyperparameters, chosen by the baker. The texture that results is shaped by the dough, which stands in for the parameters. The oven setting is decided up front, and the loaf is what comes out of it.
In machine learning, the parameters are the billions of weights a model updates as it trains. The hyperparameters are the choices wrapped around that process.
Common examples
- Learning rate. How big a step the model takes each time it updates its weights during gradient descent. Too large and training becomes unstable. Too small and it crawls.
- Batch size. How many training examples the model looks at before each update.
- Number of epochs. How many times the model passes over the full training set.
- Model size choices. How many layers the network has and how wide each one is.
- Regularization strength. How strongly training discourages the model from memorizing, which helps against overfitting.
When you use a chat model, you meet a related set of settings at generation time, such as temperature. Those are usually called inference settings or sampling parameters, and they are adjustable by you after training is finished. The word hyperparameter normally refers to the training side.
How people choose them
There is no formula that gives the right values. Teams usually try several combinations, train for a while, and compare results on data the model has not seen. This is called hyperparameter tuning. Common approaches are a grid of options, random sampling, and smarter searches that learn from earlier trials.
Because each trial can mean a full training run, tuning is one reason training large models is expensive. Small test runs are often used to pick values that are then applied to a much bigger run.
Why it matters to you
If you fine-tune a model, you will be asked for hyperparameters, usually the learning rate, the number of epochs and the batch size. Defaults are often fine to start. If your tuned model forgets its general skills or just repeats your examples, the usual suspects are a learning rate that is too high or too many passes over a small dataset.
The practical lesson is simple. Two teams with the same model and the same data can get very different results because of these choices alone. When you compare a result, ask not only what data was used, but how the training was set up.
Questions people ask
What is the difference between a parameter and a hyperparameter?
Parameters are the weights a model learns from data during training. Hyperparameters are settings people choose beforehand, like learning rate or batch size, that control how that learning happens.
Is temperature a hyperparameter?
It is usually called an inference or sampling setting, since you adjust it when generating text after training. The term hyperparameter normally refers to training choices.