# Inference

- **Canonical URL:** https://getaimath.com/dictionary/inference/
- **Topics:** [AI & Machine Learning Fundamentals](https://getaimath.com/dictionary/category/ai-and-machine-learning-fundamentals/), [LLM Inference: Prefill & Decode](https://getaimath.com/dictionary/category/llm-inference-prefill-and-decode/)
- **Last updated:** 2026-11-25

## What is Inference?

**In one sentence:** Inference is when a trained AI model is actually used to give answers, instead of still learning.

Training is like studying for a test, and inference is taking the test. When you type a question into a chatbot and it replies, the model is doing inference. It uses what it already learned and does not change itself while answering. Inference happens every time anyone uses the model, so making it fast and cheap matters a lot.

![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.*

### Quick Math / Rule of Thumb

Training happens once (or occasionally); inference runs every time anyone uses the model. For a widely used model, the total compute spent answering requests over its lifetime can end up larger than the compute used to train it.

## What is an example of Inference?

Each time you ask a voice assistant for the weather, it runs inference to understand you and reply.

## Why does Inference matter?

Most of the cost and speed you notice when using AI comes from inference.

## Inference vs. Training

Training builds the model by updating its weights from data once (or periodically); inference runs those frozen weights millions of times to answer real users.

| Dimension | Inference | [Training](https://getaimath.com/dictionary/training/) |
| --- | --- | --- |
| Goal | Use learned weights to produce outputs | Learn patterns and update weights |
| Weights change? | No, weights stay frozen | Yes, every optimization step |
| Compute pattern | Continuous per-request cost on every user query | One-time (or periodic) massive GPU cluster job |

## Related Concepts

- [Training](https://getaimath.com/dictionary/training/): Training is the learning phase, when an AI model studies lots of examples and slowly gets better at its task.
- [Supervised Learning](https://getaimath.com/dictionary/supervised-learning/): Supervised learning is training an AI with examples that already have the right answers attached.
- [Inference Engine](https://getaimath.com/dictionary/inference-engine/): An inference engine is software built to run trained AI models quickly and efficiently.
- [Perceptron](https://getaimath.com/dictionary/perceptron/): A perceptron is one of the first and simplest artificial neurons, invented in 1958, that makes a yes-or-no decision.
- [Unsupervised Learning](https://getaimath.com/dictionary/unsupervised-learning/): Unsupervised learning is when an AI looks for patterns in data that has no labels or right answers.
- [Inference Pipeline](https://getaimath.com/dictionary/inference-pipeline/): An inference pipeline is the full chain of steps from receiving a request to returning the model's answer.

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