Inference
Inference is the stage where a trained AI model is used to produce output: it takes an input, such as a prompt or an image, and generates a prediction or response. Training builds the model once; inference happens every time someone uses it, so it drives speed and running cost.
During inference, the model's weights are fixed. For a language model, inference means processing the input tokens and then generating output tokens one at a time until the answer is complete. It runs on GPUs or specialised chips in the provider's data centre, or on local hardware for smaller and open-weight models.
Why it matters: when you pay for an AI API or subscription, you are mostly paying for inference. Latency, rate limits and per-token prices all reflect inference costs, and techniques such as batching, caching and smaller models exist to reduce them. For privacy-sensitive work, where inference runs, whether in the vendor's cloud, a specific region or on your own devices, can matter as much as the model itself.
Example: each time an assistant answers a question, the provider runs one inference request and bills the input and output tokens.
Note: inference (running a model) is not the same as reasoning (a model working through a problem step by step), although reasoning models spend extra inference compute thinking before they answer, which raises cost and latency.
Related terms
Learn it step by step
- Lesson 1What is artificial intelligence (AI)?
- Lesson 2What is machine learning?
- Lesson 3What is deep learning?
- Lesson 4What is a neural network?
- Lesson 11What are parameters in an LLM?
- Lesson 12What is temperature in AI models?
- Lesson 24What is open-source AI?
- Lesson 25How much does AI cost?
- Lesson 27Is AI bad for the environment?
Sources
- Efficient Memory Management for Large Language Model Serving with PagedAttention. Kwon et al., arXiv, September 2023
Topic: AI fundamentals
Last updated