What is a hyperparameter in AI?
Also called: Hyper-parameter
In one minute
A hyperparameter is a setting that decides how an AI learns. It isn’t worked out during training; people (or a tool that searches for settings) choose it before training starts.
Examples are how strongly the numbers inside the AI (its weights and biases) are changed each time (the learning rate), how many examples are used before each change (the batch size), how many times training goes through all the examples (the number of epochs) and how many layers to stack. They are different from the weights and biases (the parameters) that training sets.
Good values depend on the AI’s design and its data; no single answer works for all. So you train several times with different values, compare the results on data kept out of training (a validation set) and pick the best.
A common mix-up
“An AI decides its hyperparameters by itself during training, too.”
Only partly right. There are tools that choose the values automatically. But they are not set during training itself. What the training calculation adjusts little by little are the weights and biases (the parameters); settings such as the learning rate are usually decided before training starts. Even with a tool, you train many times with different settings and compare the results. The choosing happens outside training, by repeating training itself. That is why the longer an AI takes to train, the more work it takes to choose its settings.
Explained in pictures
Think of it like this
The “plan” for studying for a test
Think of an AI’s training as studying for a test with a workbook. The know-how that builds up in your head is like the parameters (the weights and biases). But “how many questions to do before checking the answers” (the batch size), “how many times to go through the workbook” (the number of epochs) and “how much to change your approach after a mistake” (the learning rate) are the plan you make before you start. Those are the hyperparameters.
A good plan differs from person to person and from subject to subject. So you try a few plans and compare your scores on a practice exam you didn’t study from (the validation set). If you chose your plan while looking at the real exam questions (the test set), your score on that exam might go up, but it would no longer show what you can really do.
But the comparison has limits. A person can change plans midway, while for an AI, each change of plan usually means another, separate training run to compare. And in a big AI, the “know-how” is tens of billions of numbers, none of which carries a label saying what it means.
Key points
How is it different from a parameter?
Parameters are the weights and biases a model learns during training. Hyperparameters are the values that decide how that training goes, supplied from outside training by people (or by a tool that searches for settings). For example, you might train with a learning rate of 0.01 and, if that turns out to be too high, try 0.003 in the next training run.
In the mixing-desk comparison on the “Parameter” page, the position of each knob is a parameter, and the rules for turning them, such as how far to turn each time, are the hyperparameters. Hyperparameters are not numbers inside the model, so they are not counted in “70 billion parameters.”
What happens when you change the learning rate, batch size or number of epochs?
The learning rate is how strongly the weights and biases are changed each time. A learning rate of 0.3 changes them three times as strongly as 0.1. If it is too low, training takes too long. If it is too high, the model jumps over the point with the smallest error and bounces around it, or the error even keeps growing.
The batch size is how many examples are used before each change to the weights and biases. With 1,000 training examples and a batch size of 100, 10 changes make one pass through all of them (one epoch). Twenty passes mean 200 changes; using one example at a time means 20,000, and using all of them at once means 20. With small batches, such as one example at a time, the results vary a lot from step to step (noise), and the error sometimes goes up. But a little noise can actually help.
The number of epochs is how many times training goes through all the examples. More passes usually make a better model, but they take more time. Too many, though, and the error on data kept out of training can start to rise partway through (overfitting; more on the “Machine learning” page).
Values that set a model’s size and shape, such as the number of layers and the number of nodes (artificial neurons) in each layer (the layer width), are also hyperparameters. So is the strength of the methods that keep a model from memorizing too much (regularization).
Is there a right value that works for every AI?
No. The ideal learning rate depends on the problem: each model and dataset has its own. The ideal batch size, too, depends on the data and the computing power available.
Settings are also tied to each other. The best values of most hyperparameters depend on the batch size, so if you change the batch size, you have to choose the learning rate and others again. The best learning rate also depends on the model’s shape, such as the number of layers.
Which settings matter most also differs with the data. A 2012 paper by Bergstra and Bengio showed that for most datasets only a few of the settings really matter, and that different settings matter on different datasets. That is why each new AI has to be tuned by trying.
How are they chosen?
The basic idea is to train with several values and compare the results. One long-used method is “grid search”: you choose the values to try for each setting and try every combination, lined up like a grid. But the number of combinations multiplies. Trying just 3 values for each of 4 settings already takes 3 × 3 × 3 × 3 = 81 training runs.
“Random search” picks the values to try at random. A 2012 paper by Bergstra and Bengio showed that, searching the same range of settings for neural networks, random picks find models as good or better with far less computing. For a neural network with one hidden layer, 8 random tries did as well as or better than grids of 100 tries on average. When only a few settings matter, a grid keeps repeating the same values of the settings that matter.
“Bayesian optimization” uses the results so far to predict how untried values are likely to do, then tries a promising one next, over and over. A 2012 paper (Snoek et al.) used it to choose the settings of several kinds of AI, including neural networks, and showed it could match or beat human experts. A guide by Google researchers recommends near-random choices for exploring widely at first, and Bayesian optimization and similar tools for narrowing in on a good region.
Why compare on a validation set?
If you compare on the data used for training (the training set), settings that memorize the data (overfit) look best. What you want to know is how the model does on data it has never seen. So the data is split into three. The model learns from the training set, settings are compared and changed using the validation set, and the best one is finally checked on the test set. One example split is 70% training, 15% validation and 15% test.
The test set isn’t used for choosing settings. If you keep changing settings after each test, round after round, the model can quietly fit the quirks of the test set. Then the test score looks better than the model’s real ability on data it has never seen.
A validation set also “wears out” with repeated use. The more often you compare and choose on the same data, the more likely you are to pick settings that happen to suit that data’s quirks, and the less you can trust that the model will do well on new data. Collecting new data to refresh it is recommended. Since you look at labeled data to decide the settings, there is also a view that choosing settings is itself a kind of training.
How are they chosen for big AIs?
A big AI with billions of parameters needs a huge amount of computing for a single training run, so training it many times with different settings costs far too much money and time.
One answer is to choose the settings on a small model and use them on the big one. A 2022 paper (Yang et al., researchers at Microsoft and OpenAI) showed that if a model is built in a special way called “μP” (the learning rate and similar values for each layer are scaled in a fixed way as the model gets wider), many of the best values, such as the learning rate, stay about the same as the model grows. Settings chosen on a small model with about 40 million parameters, used as they were on the 6.7-billion-parameter size of GPT-3, beat the previously published results, and choosing them took only 7% of the computing for the whole training. The paper also says some settings, such as those for regularization, can’t be carried over this way.
Another way picks among many candidates like a tournament. All the candidates are first tried with a little computing, and only the best-scoring ones get more computing in the next round, again and again (this is called successive halving).
Is an AI’s “temperature” a hyperparameter too?
Temperature is a setting that controls how random an AI’s output is when it answers. Higher temperatures make the answers more varied, and lower ones make them less varied. The best temperature depends on what it is used for.
What it is called differs between sources. Google’s machine learning glossary calls it a hyperparameter, while Google’s guide to using Gemini (Google AI Studio) calls it a “model parameter.” Either way, it isn’t about how the AI is trained: it is a setting for how a trained AI produces answers, and it is separate from the weights and biases set by training.
Check yourself
Q1In AI training, when and by whom are “hyperparameters” such as the learning rate and batch size usually decided?
Answer and explanation
Answer: B Before training, by people or a search tool
Hyperparameters are settings that decide how training goes, chosen before training starts by people or by a tool that searches for settings. What the training calculation adjusts bit by bit are the weights and biases (the parameters). After changing the settings, you train again and compare the results.
Q2When training an AI, you try several settings (such as different learning rates) and pick the best by comparing results. Which data should you compare them on?
Answer and explanation
Answer: C The validation set, kept out of training
On the training set, settings that memorize the data (overfit) look best. Choosing again and again on the test set quietly fits its quirks, so you can no longer tell the real ability. That is why settings are compared and chosen on the validation set, and the test set is used only for the final check.
Q3A 2012 paper by Bergstra and Bengio showed that, when choosing an AI’s training settings, picking the values to try at random tends to reach good settings in fewer tries than lining them up on a grid. What is the main reason?
Answer and explanation
Answer: A It tries more values of the settings that matter
In many cases, only a few settings make a big difference to the results. On a grid, 9 tries test only 3 values of the setting that matters. Picked at random, all 9 tries use different values, so they are more likely to land near a good one. In the paper, for a neural network with one hidden layer, 8 random tries did as well as or better than grids of 100 tries on average.
Related terms
- Parameter
- Machine learning
- Deep learning
- Neural network
- Overfitting
- Gradient descent
- Large language model
Sources and how we checked
- Google, "Machine Learning Glossary" (entries for hyperparameter, parameter, learning rate, batch size, epoch, test set, overfitting and temperature; read November 8, 2026)
- Google Machine Learning Crash Course, "Linear regression: Hyperparameters" (read November 8, 2026)
- Google Machine Learning Crash Course, "Dividing the original dataset" (read November 8, 2026)
- Google Machine Learning Crash Course, "Overfitting" (read November 8, 2026)
- scikit-learn, "3.2. Tuning the hyper-parameters of an estimator" (scikit-learn 1.9.1 documentation; read November 8, 2026)
- Bergstra and Bengio, "Random Search for Hyper-Parameter Optimization" (Journal of Machine Learning Research 13, pp. 281–305, February 2012; abstract, section 1, Figures 1 and 5; read November 8, 2026)
- Snoek, Larochelle and Adams, "Practical Bayesian Optimization of Machine Learning Algorithms" (arXiv, June 2012; abstract; read November 8, 2026)
- Godbole et al., "Deep Learning Tuning Playbook" (a guide by Google Research researchers and a Harvard University researcher, GitHub; it notes it is not an officially supported Google product; read November 8, 2026)
- Yang et al., "Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer" (Microsoft and OpenAI, arXiv, March 2022; abstract, section 1, section 7.4 and Table 1; read November 8, 2026)
- Google AI Studio, "Prompt design strategies" (Gemini API documentation, section "Experiment with model parameters"; read November 8, 2026)
AI wrote this page from the sources above, and a different AI checked it against the text of those sources (November 8, 2026). A person with a master’s degree in science and a Japanese high-school science teaching license also read and checked it before publishing. Numbers are as of that date. If anything was hard to follow, you spot a mistake, or there’s a term you’d like explained, please write to [email protected].
AI terms
- AI agent
- Artificial general intelligence (AGI)
- Artificial intelligence (AI)
- Context window
- Deep learning
- Fine-tuning
- Generative AI
- Hallucination
- You are hereHyperparameter
- Intelligence explosion
- Large language model (LLM)
- Machine learning
- Mixture of experts (MoE)
- Neural network
- Parameter
- Prompt
- Prompt injection
- Reasoning model
- Recursive self-improvement (RSI)
- Reinforcement learning (RL)
- Retrieval-augmented generation (RAG)
- Superintelligence (ASI)
- Technological singularity
- Token
- Transformer