Glossary

What is Weight decay?

In Turkish: Ağırlık azaltma (weight decay) · Topic: Math foundations

A regularization technique that nudges a neural network's weights toward zero at every training step, preventing them from growing very large and helping reduce overfitting.

How does it work?

During training, model weights are updated in the direction that reduces the error. With weight decay, the weights are also shrunk by a small fraction at each update, so the model can keep large weights only if the data clearly calls for them. In effect, simpler functions are preferred. In plain gradient descent it gives results similar to L2 regularization; with adaptive optimizers the two differ, and AdamW, which applies decay separately from the gradient update, is widely used. The decay rate is a hyperparameter.

Why does it matter?

Large models, including language models, can memorize their training data and then perform poorly on new data. Weight decay is cheap and easy to apply, so it appears often in modern training recipes. Setting the rate too high, however, can keep the model from learning enough.

Example

When training a language model, it is common to set a nonzero weight decay value in the AdamW optimizer.

FAQ

Is weight decay the same as L2 regularization?

In simple gradient descent the two are equivalent. With adaptive optimizers such as Adam they behave differently, which is why AdamW was developed to apply weight decay separately.

How is the weight decay rate chosen?

It is usually tuned by trial, based on performance on validation data. If it is too low it has little effect, and if it is too high the model cannot learn enough.

All terms