Jump to content

Model parameters (ANN): Difference between revisions

From Wikibase
Drop the bridge note: the parameter count is now |theta| on every page, so no cross-reference is needed (via update-page on MediaWiki MCP Server)
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Artificial neural network]]
[[Category:Artificial neural network]]
The '''model parameters''' of an [[artificial neural network (ANN)|neural network]] are the quantities learned during training, written collectively as $\theta$: the weights and biases of every layer. They are what distinguishes 1 trained model from another of the same architecture, and they are fixed once training ends.
The '''model parameters''' of an [[artificial neural network (ANN)]], collectively denoted as $\theta$, are the [[artificial neuron#Mathematical_representation|'''weights''', '''biases ''', and other adjustable parameters]] that connect individual [[artificial neuron]]s, learnt during [[#Training|traning]].


== Definition ==
In general, parameters do not change while the model is in use. They are only adjusted during [[#Training|training]] between iterations.


For a network of $N$ layers with widths $d_0,\cdots,d_N$, the parameters are the weights and biases of every layer,
== Base case ==


$$
For a simple [[artificial neural network (ANN)]] of $N$ layers each with $d_0,\cdots,d_N$ [[artificial neuron]]s, obtained by [[artificial neuron#Layer_composition|basic layer composition]] and [[feedforward algorithm]], where each neuron satisfies
\theta=\left\{\mathbf{W}^{(l)},\vec b^{(l)}\right\}_{l=1}^{N},
 
\qquad
{{#content:Q3075|noNote}}
\mathbf{W}^{(l)}\in\mathbb{R}^{d_l\times d_{l-1}},
\qquad
\vec b^{(l)}\in\mathbb{R}^{d_l},
$$


so the parameter count is
Let $\mathbf{W}^{(l)}, \vec b^{(l)}$ represent [[artificial neuron#Basic_form|'''weights''' and '''biases''']] of layer $l$,


then the '''parameters'''
$$
$$
|\theta|=\sum_{l=1}^{N}\left(d_{l-1}d_l+d_l\right).
\theta=\left\{\mathbf{W}^{(l)} \in\mathbb{R}^{d_l\times d_{l-1}},\vec b^{(l)} \in \mathbb{R}^{d_l}\right\}_{l=1}^{N}.
$$
$$


The parameter count $|\theta|$ is the quantity that the [[large language model (LLM)#Scaling laws|scaling laws]] and the [[Chinchilla prescription]] scale, and the "very large parameter count" that defines a [[large language model (LLM)|large language model]] is this count.
<blockquote>
'''Distinction from hyperparameters''': The '''[[hyperparameter]]s''' of an [[artificial neural network (ANN)]] determines its '''architecture''', while the '''parameters''' its '''behaviour'''.
</blockquote>


== Role in the model ==
=== Parameter count ===
 
Parameters turn an architecture into a particular function. The [[forward pass]] evaluates it as $f_\theta$, and predictions are conditional distributions indexed by $\theta$,


$$
$$
P_\theta(y\mid x),
|\theta|=\sum_{l=1}^{N}\left(d_{l-1}d_l+d_l\right).
$$
$$


so $\theta$ appears as a subscript wherever the output distribution of the model is written.
=== Training ===
 
== Distinction from hyperparameters ==
 
The number of layers $N$, the widths $d_l$, the [[activation function]] $\sigma$, and the learning rate $\eta$ are '''hyperparameters''': they fix the shape of $\theta$ and the manner of its training, but they are chosen rather than learned.
 
== Distinction from state ==
 
Parameters are not state. They are set during training and do not change while the model is in use, whereas state is whatever a model carries between steps: the hidden state of a recurrent network, the fixed-size state of a state-space model, or the keys and values held by [[KV caching]]. A state-space model updates its state at every token; it does not update its parameters.


== Training ==
With [[gradient descent]], training is the iteration with step
 
Training is the search for the $\theta$ that minimises the [[language model loss|loss]], and [[gradient descent]] updates it in steps of the form


$$
$$
\theta_{i+1}=\theta_i-\eta\nabla_\theta L(\theta_i),
\theta_{i+1}=\theta_i-\eta'\nabla_\theta L(\theta_i),
$$
$$


with [[backpropagation]] supplying $\nabla_\theta L$.
<div class=center>
{| class="wikitable"
|-
| $\eta' \in \mathbb{R}$
| '''effective learning rate''', generally on the scale of $10^{-5}\to 10^{-3}$
|-
| $\nabla_\theta L(\theta_i)$
| the '''local gradient''' at $\theta_i$, determined via [[backpropagation]]
|}
</div>
 
For a [[large language model (LLM)]], the loss function is generally [[language model loss]].

Latest revision as of 11:42, 17 November 2026

Languages: English · français · Esperanto

The model parameters of an artificial neural network (ANN), collectively denoted as $\theta$, are the weights, biases , and other adjustable parameters that connect individual artificial neurons, learnt during traning.

In general, parameters do not change while the model is in use. They are only adjusted during training between iterations.

Base case

For a simple artificial neural network (ANN) of $N$ layers each with $d_0,\cdots,d_N$ artificial neurons, obtained by basic layer composition and feedforward algorithm, where each neuron satisfies

$$\begin{gathered}a = f\left(z \right)\\ \text{Basic form}: z = \sum_{i=1}^{n} w_i x_i + b\end{gathered}$$

Let $\mathbf{W}^{(l)}, \vec b^{(l)}$ represent weights and biases of layer $l$,

then the parameters $$ \theta=\left\{\mathbf{W}^{(l)} \in\mathbb{R}^{d_l\times d_{l-1}},\vec b^{(l)} \in \mathbb{R}^{d_l}\right\}_{l=1}^{N}. $$

Distinction from hyperparameters: The hyperparameters of an artificial neural network (ANN) determines its architecture, while the parameters its behaviour.

Parameter count

$$ |\theta|=\sum_{l=1}^{N}\left(d_{l-1}d_l+d_l\right). $$

Training

With gradient descent, training is the iteration with step

$$ \theta_{i+1}=\theta_i-\eta'\nabla_\theta L(\theta_i), $$

$\eta' \in \mathbb{R}$ effective learning rate, generally on the scale of $10^{-5}\to 10^{-3}$
$\nabla_\theta L(\theta_i)$ the local gradient at $\theta_i$, determined via backpropagation

For a large language model (LLM), the loss function is generally language model loss.