Deep learning inference is how a trained neural network turns new data into useful results. Unlike training, which learns model parameters, inference applies the learned parameters to tasks such as recognizing an object, converting speech to text, or generating a response. Its performance depends on the model, hardware, input size, and the way requests are processed.
For the architecture that manages concurrent language model requests, see our LLM serving guide.
What is deep learning inference?
Deep learning inference is the process of applying a trained neural network to new input to produce a prediction, classification, representation, or generated output. Training establishes the model’s learned parameters; inference uses them. For example, a neural network trained on labeled product photographs can evaluate a new photograph and estimate which product category it belongs to.
An inference request can return a single numerical estimate, a set of category scores, bounding boxes, an embedding, or a sequence of generated tokens. The output depends on the model architecture and task. Running inference does not ordinarily update the model’s weights, although an application may separately collect feedback for future training.
How neural network inference works
The computation begins with an input in the format the network expects. An image classifier might resize a photograph and normalize its pixel values. A text model converts text into token IDs. Inputs then pass through the model’s layers, which perform operations using learned weights and intermediate activations.
The final network output may need additional processing. A classifier can convert logits to probabilities, an object detector can suppress overlapping boxes, and a text generator selects tokens repeatedly until a stopping condition is met. The application may also validate the result against its own requirements.
For example, consider a classifier for three product categories. If its output scores after softmax are 0.70, 0.20, and 0.10, the highest-scoring class is the predicted category. A score of 0.70 is not automatically a calibrated 70% chance of correctness; that interpretation requires validation against representative labeled data.
Inference vs. training
| Characteristic | Training | Inference |
|---|---|---|
| Purpose | Learn or adapt model parameters | Apply learned parameters to inputs |
| Computation | Forward pass, loss, and usually gradient computation and updates | Forward computation; possibly repeated generation steps |
| Typical resource needs | Model parameters, activations, gradients and optimizer state | Model parameters and inference-time activations or caches |
| Key performance measures | Training time, validation performance, resource cost | Quality, latency, throughput, memory and cost per task |
NVIDIA’s technical explanation of neural-network inference distinguishes forward computation from the extra gradient and parameter-update work in training. That explains why a single inference pass often uses less memory and compute than a training step for the same model. It does not mean all inference workloads are inexpensive: a large model serving millions of requests may require substantial capacity.
For an application that is ready to serve predictions, our AI deployment guide explains staging, controlled releases, and rollback.
Where deep learning inference is used
| Task | Input | Typical output |
|---|---|---|
| Image classification | Product photograph | Category scores |
| Object detection | Video frame | Object locations and labels |
| Speech recognition | Audio signal | Transcribed text |
| Semantic search | Text query or document | Embedding vector |
| Text generation | Tokenized prompt | Generated token sequence |
The difference between a classification and a generation task is important when estimating performance. An image classifier can produce its result in one network evaluation. An autoregressive language model must generally repeat its computation to generate a sequence of tokens, often reusing stored key-value information from earlier tokens.
What hardware is needed for inference?
For a comparison of individual desktop graphics cards for local models, see our local AI GPU guide.
For guidance on selecting an entire development workstation, compare these computer setups for machine learning, including GPU memory and local versus cloud costs.
CPUs can be a sensible starting point for smaller models, low-volume services, or workloads already operating on general-purpose infrastructure. GPUs accelerate many neural-network operations through parallel computation and can be useful for larger models and high request volumes. Dedicated accelerators such as Google’s TPUs and mobile NPUs may suit compatible workloads.
Hardware choice should be based on the actual model, supported operators, memory, batch size, power constraints, and end-to-end latency. A faster accelerator may provide little benefit if decoding files, transferring data, or waiting for the network dominates response time. IBM’s AI inference overview discusses GPUs, TPUs, NPUs, and distributed computation as different options rather than a universal ranking.
For an industry-focused perspective on selecting models and validating their business results, see our guide to enterprise deep learning.
How to measure inference performance
| Metric | What it measures |
|---|---|
| Latency | Time from request to result |
| Throughput | Completed inputs or requests per unit of time |
| Tail latency | Slow requests, such as the 95th or 99th percentile |
| Memory use | Capacity required for model weights, inputs, activations and caches |
| Task quality | Correctness or usefulness on representative inputs |
| Cost per successful result | Compute and other processing costs divided by accepted results |
Latency and throughput answer different questions. Suppose a classifier takes 40 milliseconds to process one image, or 120 milliseconds to process eight together. Ignoring other overhead, the first setting can process 25 images per second; the second can process about 67. The batched operation increases throughput, but an individual image may wait longer. If the application has to collect eight incoming requests before starting, that waiting time adds to end-to-end latency.
These numbers are illustrative, not measured hardware benchmarks. Test with realistic arrival patterns and input sizes. For an LLM, also measure the time to the first output token and generation speed after that token, along with total time for the task.
How to optimize deep learning inference
Choose an appropriate batch size
Grouping independent inputs can improve hardware utilization. NVIDIA’s TensorRT optimization documentation explains why batching can reduce per-input overhead, but also why different batch sizes need testing. Interactive services should limit the time spent waiting to form a batch.
Use a suitable numerical precision
Lower-precision formats and quantization can reduce memory use or improve execution speed on compatible hardware. They can also change outputs or reduce quality. Compare the optimized model with the original on a representative test set, including important edge cases.
Reduce unnecessary computation
Use an appropriately sized model, avoid redundant preprocessing, cache repeatable intermediate results when valid, and choose a runtime that supports the model’s operators. For language generation, reduce irrelevant prompt content and set a task-appropriate output limit. Do not cache private requests across users without permission.
Benchmark the complete system
Measure preprocessing, model execution, post-processing, transfer time, and queue delays separately. Change one configuration at a time and compare quality, resource use and latency under comparable load. A change that improves an isolated model benchmark may not improve the application.
Frequently asked questions
Does inference require training data?
A trained model normally needs its learned parameters and a correctly formatted input to run inference, not the original training dataset. Some applications also retrieve external context or use a separate feature store.
Is inference the same as prediction?
Prediction is one type of inference output. Other outputs include embeddings, transcriptions, detections and generated text.
Does inference change neural network weights?
Standard inference does not update learned weights. An application can collect feedback and later retrain or adapt a model, but that is a separate process.
Can deep learning inference run offline?
Yes, when the model, runtime and required inputs fit the device and are available locally. Cloud-hosted APIs require access to the remote service.
Why is inference sometimes slow?
Large models, long inputs, memory transfers, insufficient capacity, queuing, and repeated generation steps can all contribute. Measure each part of the request before selecting an optimization.

