Optimizer

An optimizer turns gradients into parameter updates. Basics: gradient descent and SGD (with optional momentum). Adaptive methods (Adam, AdamW) track per-parameter statistics.

Defaults for LLMs

AdamW (Adam + decoupled weight decay) is the usual choice for transformers. Pair with a sensible learning rate, warmup, and schedule (cosine / constant). Tuning LR, decay, and batch size together matters more than swapping exotic optimizers.

What to watch

Wrong LR or missing warmup → loss spikes. Too little weight decay → overfitting on small SFT sets. Report effective tokens/step when comparing runs.

← Back to AI Glossary