19
$\begingroup$

So in a normal distribution, we have two parameters: mean $\mu$ and variance $\sigma^2$. In the book Pattern Recognition and Machine Learning, there suddenly appears a hyperparameter $\lambda$ in the regularization terms of the error function.

What are hyperparameters? Why are they named as such? And how are they intuitively different from parameters in general?

$\endgroup$
2
  • 3
    $\begingroup$ I personally just think it's an epidemic of people going hyper. Hyper this, hyper that. Hypersphere - it's a sphere, d@manit, stop getting so hyper just because dimension exceeds 3. Hyperparameter - it's a parameter, d@mnit, stop getting hyper just because you have several of them, and you somehow seem to think you need to indicate hierarchial level or something. In any event, if you have an optimization problem, spell out clearly what parameters are being optimized over, and any constraints (if it's multi-level optimization, spell that out). I hope I didn't get too hyper in this comment. $\endgroup$ Commented Apr 19, 2016 at 23:30
  • 2
    $\begingroup$ I always used "hypersphere" to mean "co-dimension one sphere", so at least in math, it seems to mean something. Or at least when I talk about math. I'll calm down now. $\endgroup$ Commented Apr 20, 2016 at 0:04

5 Answers 5

17
$\begingroup$

The term hyperparameter is pretty vague. I will use it to refer to a parameter that is in a higher level of the hierarchy than the other parameters. For an example, consider a regression model with a known variance (1 in this case)

$$ y \sim N(X\beta,I) $$

and then a prior on the parameters, e.g.

$$ \beta \sim N(0,\lambda I) $$

Here $\lambda$ determines the distribution of $\beta$ and $\beta$ determines the distribution for $y$. When I want to just refer to $\beta$ I may call it the parameter and when I want to just refer to $\lambda$, I may call it the hyperparameter.

The naming gets more complicated when parameters show up on multiple levels or when there are more hierarchical levels (and you don't want to use the term hyperhyperparameters). It is best if the author's specify exactly what is meant when they use the term hyperparameter or parameter for that matter.

$\endgroup$
1
  • $\begingroup$ This is a nice explanation. I am now imagining it as a 'composition of functions-ish'. To translate what you put in symbols, $y$ is Normally distributed with mean $X\beta$, but $beta$ is in turn, Normally distributed so and so. Thanks $\endgroup$
    – cgo
    Commented Apr 19, 2016 at 18:03
9
$\begingroup$

A hyperparameter is simply a parameter that impacts, completely or partly, other parameters. They do not directly solve the optimization problem you face, but rather optimize parameters that can solve the problem (hence the hyper, because they are not part of the optimization problem, but rather are "addons"). For what I've seen, but I have no reference, this relationship is unidirectional (a hyperparameter cannot be influenced by the parameters it has influence on, hence also the hyper). They are usually introduced in regularization or meta-optimization schemes.

For example, your $\lambda$ parameter can freely impact $\mu$ and $\sigma$ to adjust for the regularization cost (but $\mu$ and $\sigma$ have no influence on $\lambda$). Thus, $\lambda$ is a hyperparameter for $\mu$ and $\sigma$. If you had an additional $\tau$ parameter influencing $\lambda$, it would be a hyperparameter for $\lambda$, and a hyperhyperparameter for $\mu$ and $\sigma$ (but I've never seen this nomenclatura, but I wouldn't feel it would be wrong if I saw it).

I found the hyperparameter concept very useful for cross-validation, because it reminds you of the hierarchy of parameters, while also reminding you that if you are still modifying (hyper-)parameters, you are still cross-validating and not generalizing so you must remain careful about your conclusions (to avoid circular thinking).

$\endgroup$
7
$\begingroup$

The other explanations are a bit vague; here's a more concrete explanation that should clarify it.

Hyperparameters are parameters of the model only, not of the physical process that is being modeled. You introduce them "artificially" to make your model "work" in the presence of finite data and/or finite computation time. If you had infinite power to measure or compute anything, hyperparameters would no longer exist in your model, since they wouldn't be describing any physical aspect of the actual system.

Regular parameters, on the other hand, are those that describe the physical system, and aren't merely modeling artifacts.

$\endgroup$
6
$\begingroup$

It's not a preciseley defined term, so I'll go ahead and give you yet another definition that seems to be consistent with common usage.

A hyperparameter is a quantity estimated in a machine learning algorithm that does not participate in the functional form of the final predictive function.

Let me unwind that with an example, ridge regression. In ridge regression we solve the following optimization problem:

$$ \beta^*(\lambda) = \text{argmin}_{\beta} \left( (y - X\beta)^t (y - X\beta) + \lambda \beta^t \beta \right)$$ $$ \beta^* = \text{argmin}_{\lambda} (y' - X'\beta(\lambda))^t (y' - X'\beta(\lambda)) $$

In the first problem $X, y$ is the training data, and in the second $X', y'$ is a hold out data set. The final functional form of the model, which I called above the predictive function is

$$ f(X) = X \beta^* $$

in which $\lambda$ does not appear. This makes $\beta$ a parameter vector, and $\lambda$ a hyper parameter.

$\endgroup$
3
$\begingroup$

As precisely pointed out by @jaradniemi, one use of the term hyperparameter comes from hierarchical or multilevel modeling, where you have a cascade of statistical models, one built over/under the others, using usually conditional probability statements.

But the same terminology arises in other contexts with different meanings as well. For instance, I have seen the term hyperparameter been used to refer to the parameters of the simulation (running length, number of independent replications, number of interacting particles in each replication etc.) of a stochastic model, which did not result from a multilevel modeling.

$\endgroup$
2
  • 1
    $\begingroup$ FWIW I would typically refer to running length, number of interacting particles, etc. as tuning parameters. $\endgroup$
    – jaradniemi
    Commented Apr 21, 2016 at 1:24
  • $\begingroup$ I agree. To me, it sounds a more adequate choice than hyperparameters. Nonetheless, to others, in other areas of knowledge, it still sounded reasonable enough. $\endgroup$ Commented May 1, 2016 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.