liveBook · Manning

Batch inference

As explained in Machine Learning System Design

The process of applying a machine learning model to a collected batch of inputs rather than processing each input continuously.

Batch inference applies a model to collected inputs on a schedule or on demand instead of answering each request continuously. It fits workloads where latency is mild but throughput, cost, and predictable completion matter: daily forecasts, large-scale indexing, or periodic reprocessing. section 15.5.2 section 15.5.1

A practical batch-inference design typically checks:

  • Schedule jobs to read input data, run predictions, and write results to durable storage; expose an on-demand trigger when reprocessing is occasionally required. section 15.5.2 section 15.5.1
  • Prioritize throughput and cost over per-request latency, then scale workers horizontally to handle large or uneven workloads. section 15.5.2 section 15.5.1
  • Track job success, duration, failures, rows processed, resource use, data validation, and prediction quality rather than trusting a successful job status alone. section 14.3.1 section 15.5.1
  • Make reruns safe and available: processing or source-data failures can be corrected by rerunning the model, unlike some high-load streaming failures. section 14.3.1

Photo indexing and demand forecasting

A photo-search system can generate vectors for its searchable catalog once a day, with an additional on-demand run after a core-model update. Its real-time query path remains separate, even when both paths use the same model converted to ONNX. Similarly, a retailer can run daily, weekly, or monthly forecasts from S3 and return predictions to S3 through scheduled AWS Batch jobs. section 15.5.2 section 15.5.1

Batching is not automatically a performance improvement. Profile the complete pipeline first: preprocessing, I/O, serialization, thread management, and caching may dominate model execution, leaving batching ineffective. section 15.4.1

How Machine Learning System Design covers it

How deep it goes
Explains scheduling, scaling, monitoring, reruns, and profiling, but stops short of implementation code or model internals.
Examples
Uses photo-index generation and scheduled retail demand forecasting as concrete batch workloads.
What it assumes
Assumes familiarity with machine-learning pipelines and production data systems while emphasizing operational choices over algorithms.
What you can do after
Operate scalable scheduled prediction jobs with monitoring, durable outputs, and recovery through reruns.
How it connects
Contrasts real-time inference, data preprocessing, vector similarity search, monitoring, and horizontal scaling.

Also explained in

Compare how 3 books explain batch inference →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.