Explained · 2 min
What is inference?
The step where a trained AI model is used to answer, and why it is the part you pay for.
Written by AI and checked against our editorial standards. Not reviewed by a human editor.
Inference is the step where a trained AI model is used. You give it something new, and it works out an answer. Google’s course on machine learning defines it as making predictions by applying a trained model to unlabeled examples. Those are new data where nobody has given the answer.
An AI model goes through two phases. First it is trained. That is slow and expensive, and it happens once or a few times. Then it is used, again and again, by everyone who asks it something. That second phase is inference.
Think of it like this: training is a cook learning to cook. Inference is the cook making your dinner. The learning took years and happened once. The dinners are made every evening, one plate at a time, and each one costs time and ingredients.
For a language model, inference means reading your prompt and then writing the answer one token at a time. Each token needs a lot of calculation on a chip. So the speed of inference is often given as tokens per second, and the price as dollars per million tokens.
Inference can run in many places. A lab can run it in its own cloud and charge for each request. A company can rent it from a cloud service. Or, with an open model, it can run the model on its own servers, or even on a laptop if the model is small enough. Where inference runs decides who sees your data.
Why it matters to you: almost every AI price you see is a price for inference. When a firm says its model is faster or cheaper to run, it is talking about inference. And when a firm wants to keep its data private, the question is where inference happens.
Learn more: Google Machine Learning Crash Course: Static vs. dynamic inference · Hugging Face docs: Inference Providers