What is AI inference?

AI inference is using a trained model to produce an output from an input. A chatbot replying to a prompt, a camera app recognizing a face, and a spam filter classifying an email are all examples of inference.

On this page

Training and inference happen at different points

During training, an algorithm adjusts the model from examples or other training signals. During ordinary inference, the trained model processes a new request. A chat app can pass earlier messages and retrieved documents into the model as extra context without retraining the model on that conversation.

What happens in a chatbot

The app gathers the prompt and relevant context, turns text into tokens, and runs the model. The model generates more tokens, which the app turns back into text. Some assistants make multiple model calls when they use tools or evaluate intermediate results. One visible reply can therefore involve more than one inference request.

What changes speed and cost

The model, amount of input, length of the output, hardware, and number of calls all matter. A model can run on a user device or a remote service. When comparing speed, use the same task and record both time to the first visible text and time to the finished answer.

A familiar example

A spam filter may use thousands of labeled examples to learn patterns. When it checks a new email and assigns it a spam score, it is doing inference. If the filter is later updated using new examples, that update is a separate learning step.

Sources