What is AI Inference?

InferenceAIEdge ComputingDeploymentReal-time

Inference is when a trained AI model takes a new input (an image, sensor data, text) and produces a prediction or decision. It is the "run-time" phase of AI: the model no longer learns, it only uses what it has learned.

Training vs inference

FeatureTrainingInference
What it doesUpdates the weightsRuns a forward pass with fixed weights
Compute loadVery high (forward + backward pass, many iterations)One forward pass per input
DurationHours – weeksMilliseconds – seconds
HardwarePowerful GPUsGPU, CPU, NPU or microcontroller
FrequencyOccasionallyContinuously, on every new input

How is inference made faster?

Two measures matter in the field: latency (how long one input takes to produce a result) and throughput (how many inputs are processed per second). Common ways to improve them:

  • Quantization: converting 32-bit floating-point (FP32) weights to 8-bit integers (INT8). Model size drops to about a quarter and speed improves on compatible hardware; the small loss in accuracy must always be measured.
  • Pruning and smaller architectures: removing unnecessary connections, or choosing a smaller model from the start.
  • Optimised runtimes: tools such as ONNX Runtime, TensorRT, OpenVINO and TensorFlow Lite compile the model for the target hardware.
  • Batching: raises throughput but can lengthen the latency of a single input.

Example: memory and latency budget

Take an image model with 25 million parameters:

  • FP32: 25,000,000 × 4 bytes = 100 MB
  • INT8: 25,000,000 × 1 byte = 25 MB

If the line passes 2 products per second, there are 500 ms per product. Image capture, pre-processing, inference, post-processing and writing the result to the PLC must all fit in that time. If inference alone takes 300 ms, 200 ms is left for everything else; a round trip to the cloud can easily break this budget.

Edge or cloud?

Edge inferenceCloud inference
LatencyLow, independent of the networkDepends on network latency
Connection lossKeeps workingStops
Data privacyData stays on siteData leaves the site
Model sizeLimited by the hardwareLarge models possible

Common mistakes

  • Pre-processing differently from training: a different colour order (RGB/BGR), normalisation or image size silently lowers accuracy.
  • Timing only the model: end-to-end latency must be measured including pre- and post-processing.
  • Skipping validation after quantization.
  • Not monitoring field performance: accuracy can drop as the data changes.

Where is it used in industry?

Visual quality control on the line, fault detection from vibration and anomaly detection in sensor data are typical inference applications. We aim to explore edge inference capabilities in future versions of our data acquisition products. For inference on microcontrollers see our TinyML and predictive maintenance with NPU MCUs posts, and for preparing the model see model training and optimization.

Related Terms