ElemedexA pocket encyclopedia of AI architectures

Glossary (TM) › Machine learning fundamentals

TM026

Parameter (weight)

Also: weight, coefficient

In Spanish: Parámetro (peso)

One of a model's adjustable numbers, which training modifies; in neural networks, mainly the connection weights and the biases.

A model defines a family of functions; the parameters are the knobs that pick out one of them. In linear regression they are the coefficients that multiply each attribute (Witten et al., 2017, p. 68); in a neural network they are the weights of the connections between units and the biases added at each unit. Chollet (2021) puts it this way: what a layer does to its input is stored in its weights, and learning means finding values for all of them such that the network maps example inputs to their expected outputs (2021, sec. 1.1.5). They start out random; gradient descent corrects them bit by bit.

Counting parameters is the standard way to measure a model's size. The digit-recognition network that M. Mitchell (2019) uses as an example, with 324 inputs, 50 hidden units and 10 outputs, has 16,700 weights (2019, ch. 2); BERT-base has 110 million (Devlin et al., 2019, p. 4173) and GPT-3 175 billion (Brown et al., 2020, sec. 2.1). Multiplied by the bytes each one takes up, they give the "weight" on the Pokédex data sheet (see base stats).

Two common confusions. Parameters are not hyperparameters, which are set before training and left untouched by it. And an individual parameter almost never means anything on its own: when Alammar & Grootendorst (2024) write that each parameter represents the model's understanding of language (2024, p. 20), the phrase holds for the whole, not for each number. Knowledge is distributed.

The linguist will also spot a false friend. In Chomsky's (1981) principles-and-parameters theory, parameters are a few switches, mostly binary, that experience sets on top of an innate universal grammar. Here they are billions of real numbers, and what is not learned is not linguistic principles but engineering decisions: the architecture and the hyperparameters.

Sources

  • Alammar, J., & Grootendorst, M. (2024). Hands-on large language models: Language understanding and generation. O’Reilly Media. §
  • Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., . . . Amodei, D. (2020). Language models are few-shot learners. In Advances in Neural Information Processing Systems (Vol. 33, pp. 1877–1901). Curran Associates. https://proceedings.neurips.cc/paper_files/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html §
  • Chollet, F. (2021). Deep learning with Python (2nd ed.). Manning Publications. §
  • Chomsky, N. (1981). Lectures on government and binding: The Pisa lectures. Foris. §
  • Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. In J. Burstein, C. Doran, & T. Solorio (Eds.), Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers) (pp. 4171–4186). Association for Computational Linguistics. https://doi.org/10.18653/v1/N19-1423 §
  • Mitchell, M. (2019). Artificial intelligence: A guide for thinking humans. Pelican Books. §
  • Witten, I. H., Frank, E., Hall, M. A., & Pal, C. J. (2017). Data mining: Practical machine learning tools and techniques (4th ed.). Morgan Kaufmann. https://doi.org/10.1016/C2015-0-02071-8 §