Naru News日本語

Home › Glossary › AI

What is a hyperparameter in AI?

Also called: Hyper-parameter

Term explainer · Checked November 8, 2026 · 11 min read

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

A figure of how hyperparameters are chosen (the numbers are an example made up for this page). Title: “Settings are chosen outside training.” Left box, “① Choose settings (hyperparameters)”: learning rate 0.01, batch size 100, epochs 20. An arrow to the middle box, “② Train”: nudge the weights and biases (the parameters) bit by bit (over and over). An arrow to the right box, “③ Measure”: on the validation set (not used in training), accuracy 86%. An arrow runs from under the right box back to under the left box: “Change the settings and train again.” Below, “Learning rates tried”: 0.1 → 80%, 0.01 → 86% (thick border, “Best”), 0.001 → 83%. Band at the bottom: Pick the best, then check once on the test set at the end.
The settings on the left (the hyperparameters) are decided before training starts. In training, in the middle, the weights and biases (the parameters) are adjusted over and over, following those settings. On the right, the results are measured on a validation set that was not used for training, and changing the settings and training again is repeated until the best settings are found. The test set is kept for a final check. Ways to choose which values to try include grid search.
A figure of how the size of the learning rate changes the way a model learns (the curves and points are an example made up for this page). Title: “The learning rate changes how it learns.” Subtitle: up is the error (loss), across is a weight. Three identical bowl-shaped curves, each with its lowest point labeled “Bottom” (the smallest error). Left, “Too low”: the points creep down from high on the left in tiny steps and are still far from the bottom. Below: “Tiny steps: takes a long time.” Middle, “Just right”: the points step down in bigger strides and reach the bottom in 2 steps. Below: “Reaches the bottom in a few steps.” Right, “Too high”: the points jump over the bottom, back and forth from side to side, creeping higher. Below: “Overshoots and bounces around.” Band at the bottom: The best learning rate differs for each AI and its data.
Each curve shows the error (loss), the gap between the AI’s answer and the right answer, as one weight changes, and the bottom is the point with the smallest error. If the learning rate is too low, each change is tiny, so it takes a long time to reach the bottom. If it is too high, each change is too big: it overshoots the bottom and bounces around it, and has trouble settling down (the error may even keep growing). Just right, it reaches the bottom in a few steps.
A figure comparing two ways to search for good hyperparameter values, grid search and random search, with 9 tries each (made for this page, based on Figure 1 of Bergstra and Bengio’s 2012 paper). Title: “Searching for settings: in 9 tries, random tests more.” Left, “Grid search: values lined up on a grid”: 9 points in a square, in 3 columns and 3 rows. Right, “Random search: values picked at random”: 9 points scattered in a square. Each point is one training run with those settings. In both, across is “Matters a lot” and up is “Matters little.” Dotted lines drop from the points to marks under each square: only 3 marks on the left, 9 on the right. Below: left “Key setting: 3 values tried,” right “Key setting: 9 values tried.” Band at the bottom: Paper: 8 random tries matched or beat grids averaging 100.
This figure compares two ways to search for good hyperparameter values. Each dot is one training run with those settings. Both make 9 tries, and suppose the results depend almost only on the setting across, and hardly on the one going up. Lined up on a grid, only 3 values of the setting across get tried; the other 6 tries repeat the same values. Picked at random, all 9 tries use different values across, so they are more likely to land near a good one. The paper reports that, for a neural network with one hidden layer (the layer between input and output), 8 random tries did as well as or better than grids of 100 tries on average.

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

  1. 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.

    More on this → In one minute

  2. 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.

    More on this → Key points: Why compare on a validation set?

  3. 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.

    More on this → Key points: How are they chosen?

Sources and how we checked

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

All 25 AI terms →