# Optimizer

- **Canonical URL:** https://getaimath.com/dictionary/optimizer/
- **Topics:** [Model Training & Optimization](https://getaimath.com/dictionary/category/model-training-and-optimization/)
- **Last updated:** 2026-11-25

## What is Optimizer?

**In one sentence:** An optimizer is the algorithm that decides exactly how to update a model's weights using the gradients.

Gradients say which way to go; the optimizer decides how far and how smartly to move. Some optimizers remember past steps to move faster, and some adjust the step size for each weight separately.

![How an AI Goes to School: 3 Steps from Bookworm to Assistant — Simple 3-step cartoon showing an AI 1. Reading the whole library (Pre-training) to become a Bookworm, 2. Practicing polite Q&A with a teacher (Fine-tuning), and 3. Getting thumbs-up and thumbs-down feedback from humans (RLHF).](https://getaimath.com/diagrams/model-training-and-optimization.png)
*Napkin Diagram (Model Training & Optimization): First the model reads the internet to learn facts; next it practices answering questions; finally humans coach its manners.*

## What is an example of Optimizer?

SGD, Adam and AdamW are popular optimizers.

## Why does Optimizer matter?

The optimizer strongly affects how fast and how well a model trains.

## Related Concepts

- [Gradient Clipping](https://getaimath.com/dictionary/gradient-clipping/): Gradient clipping limits how large gradients can get, so one bad batch cannot cause a huge, damaging update.
- [Adam](https://getaimath.com/dictionary/adam/): Adam is a popular optimizer that adjusts the step size for each weight automatically, using its past gradients.
- [Gradient Accumulation](https://getaimath.com/dictionary/gradient-accumulation/): Gradient accumulation adds up gradients over several small batches before updating the model, to act like one big batch.
- [AdamW](https://getaimath.com/dictionary/adamw/): AdamW is a version of Adam that handles weight decay in a cleaner way, which usually leads to better models.
- [Gradient](https://getaimath.com/dictionary/gradient/): A gradient is a set of numbers that tells a model which direction to change each weight to reduce its mistakes, and by how much.
- [SGD](https://getaimath.com/dictionary/sgd/): SGD, or Stochastic Gradient Descent, updates a model's weights using gradients from small random batches instead of the whole dataset.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/optimizer/)
