# Algorithm

- **Canonical URL:** https://getaimath.com/dictionary/algorithm/
- **Topics:** [AI & Machine Learning Fundamentals](https://getaimath.com/dictionary/category/ai-and-machine-learning-fundamentals/)
- **Last updated:** 2026-11-25

## What is Algorithm?

**In one sentence:** An algorithm is a step-by-step set of instructions for solving a problem or doing a task.

A recipe for cookies is an algorithm: follow the steps in order and you get cookies. In AI, algorithms describe how a model learns, such as how it adjusts its numbers after a mistake. The algorithm is the method; the model is what you get after using that method on data.

![Training vs. Inference: Studying Flashcards vs. Taking the Test — Simple cartoon diagram comparing AI Training (studying 1,000 flashcards and fixing mistakes until the brain learns the pattern) with AI Inference (answering a brand-new question in 1 second on test day).](https://getaimath.com/diagrams/ai-and-machine-learning-fundamentals.png)
*Napkin Diagram (AI & Machine Learning Fundamentals): Training is the long study session where the AI learns from examples; inference is test day when you actually use it.*

## What is an example of Algorithm?

Gradient descent is an algorithm that tells a model how to change its numbers to make fewer mistakes.

## Why does Algorithm matter?

Every piece of software, including AI, is built from algorithms.

## Related Concepts

- [Model](https://getaimath.com/dictionary/model/): In AI, a model is the trained program that takes an input and produces an output, like an answer, a label or a picture.
- [Dataset](https://getaimath.com/dictionary/dataset/): A dataset is a collection of examples, like texts, pictures or numbers, used to train or test an AI model.
- [Underfitting](https://getaimath.com/dictionary/underfitting/): Underfitting is when a model is too simple or not trained enough, so it fails to learn the pattern even on its training data.
- [Training Data](https://getaimath.com/dictionary/training-data/): Training data is the set of examples a model actually learns from.
- [Overfitting](https://getaimath.com/dictionary/overfitting/): Overfitting is when a model learns its training examples too closely, including the noise, so it does badly on new data.
- [Validation Data](https://getaimath.com/dictionary/validation-data/): Validation data is a separate set of examples used during training to check how well the model is learning.

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