Start with when the prediction is needed
How response-time requirements and prediction freshness distinguish batch workloads from interactive online predictions. · foundational
Inference means applying a trained model to input to produce an output, such as a recommendation or a risk score. Batch inference processes a collected dataset as a job, with predictions available for later use. Online inference processes incoming application requests on demand.
The first distinction is the response-time requirement: how long the consumer can wait. Batch consumers can wait for a job to finish, although the job may still have a deadline. For interactive online inference, the application needs the prediction soon enough to continue the current interaction, such as showing recommendations while someone opens a page.
Neither pattern has one universal time limit. What counts as fast enough depends on the application. Batch also does not require a fixed schedule: a job can start whenever a collected dataset is ready.
| Distinction | Batch inference | Interactive online inference |
|---|---|---|
| Work begins | For a collected dataset | For an incoming request |
| Result needed | After job completion | During the interaction |
| Timing target | Job completion deadline | Application response budget |