🧠
Domain 1 · Essential AI Knowledge · 38% of the exam

Training vs inference: two very different workloads

Same model, two jobs. One learns for days on a big cluster; the other answers a user in milliseconds. Their hardware needs are almost opposite.

Lesson 4 of 29~15 min read5 quiz questions6 key terms
Exam objectives this lesson covers
  • Compare and contrast training and inference architecture requirements and considerations.

This is one of the most tested ideas in Domain 1, because almost every infrastructure decision later depends on it. Toggle the widget to see the difference, then read on.

Training: forward + backward, huge memory, runs for days
Data batchthousands of samplesLayer 1Layer 2Layer 3Losshow wrong?backward pass: gradients update every weightforward passGPU memory usedweightsgradientsoptimizer stateactivations

01What training actually does

Training is the learning phase. A batch of examples goes forward through the network to produce predictions, a loss function measures how wrong they are, and then a backward pass (backpropagation) works out how every weight should change. An optimiser applies those changes. Repeat millions of times.

Three consequences follow, and the exam loves all three:

02What inference does

Inference is using the trained, frozen model to make predictions. Only the forward pass runs. No gradients, no optimiser state, no weight updates. That changes the priorities completely:

03Side by side

TrainingInference
GoalLearn the weightsUse the weights to predict
PassesForward + backwardForward only
Optimise forThroughput, time to trainLatency, throughput per dollar, cost per token
PrecisionMixed precision (BF16/FP16, FP8 on newer GPUs)Lower precision common (FP8, INT8, FP4)
Memory holdsWeights, gradients, optimiser state, activationsWeights, activations, KV cache
Batch sizeLargeSmall to medium, dynamically batched
Scale patternScale up and out: many GPUs working on one jobScale out: many replicas, each serving requests
NetworkVery high bandwidth, low latency between GPUs (NVLink, InfiniBand)Front-end network to users; multi-GPU only for very large models
DurationHours to months, then stopsContinuous, 24/7
Typical hardwareDGX/HGX nodes in a cluster (e.g. DGX SuperPOD)From single GPUs and edge devices to multi-GPU servers
SoftwarePyTorch, NeMo, NCCL, SlurmTensorRT, Triton, NIM, Kubernetes

04Architecture considerations the exam expects

Sizing training

Start from model size and dataset size. Model size sets the minimum GPU memory (and therefore the number of GPUs needed just to hold the training state). Dataset size and the number of training passes set the compute time. Then ask how fast GPUs can exchange gradients: if the interconnect is slow, adding GPUs stops helping. That is why training clusters use NVLink/NVSwitch inside a node and a non-blocking InfiniBand fabric between nodes, plus fast parallel storage that can feed data and absorb checkpoints (periodic saves of the training state so a failure does not lose days of work).

Sizing inference

Start from the service-level objective: maximum latency and expected requests per second. Pick a precision and optimisation (TensorRT) that meets accuracy needs, measure throughput per GPU at that latency, then divide demand by it to get replicas. Leave headroom for peaks. If many small models share a cluster, partition GPUs (MIG, fractional GPUs) instead of giving each a whole GPU.

Training is writing and editing a textbook: a big team, months of work, every draft revised. Inference is a student answering a question using the finished book: quick, done millions of times, and the book does not change while they read it.

05Fine-tuning sits in between

Fine-tuning (and parameter-efficient methods such as LoRA) adapts a pretrained model to a specific task with much less data and compute than full training. It is still training, with a backward pass and gradients, but often fits on a single node. Questions sometimes use fine-tuning to test whether you remember that any weight update means training-class requirements.

✦Key terms: flip the cards

What the exam looks for
  • Training = forward + backward, memory for gradients and optimiser state, throughput-oriented, tightly coupled GPUs.
  • Inference = forward only, latency-oriented, lower precision, scale out with replicas.
  • Interconnect and storage matter most for training; latency and cost per request matter most for inference.
Common traps
  • Inference is not "cheap and unimportant": over a model's life it usually uses more total compute than training.
  • Fine-tuning still needs training-style resources (backward pass, gradients).
  • Lower precision is common in inference; training typically uses mixed precision, not INT8.

?Quick quiz

1. Which workload stores gradients and optimiser state in GPU memory?

Why: Only training computes gradients and keeps optimiser state.

2. A chatbot must answer within 200 ms for thousands of users. Which metric dominates design?

Why: Interactive inference is latency-bound.

3. Why do training clusters need very high-bandwidth GPU-to-GPU links?

Why: Distributed training exchanges gradients (AllReduce) at every step.

4. Inference capacity is usually increased by:

Why: Inference scales out with more replicas.

5. Which precision choice is most typical for optimised production inference?

Why: Lower precisions such as FP8 and INT8 cut latency and memory for inference.

Score: 0 / 5

Original readingDeep Learning Training vs. Inference: Do You Know the Difference?, AI TutorMaster (Medium) ↗

Medium blocked automated reading of this article (HTTP 403), so this lesson is built from the standard training-versus-inference material in NVIDIA and IBM documentation rather than from that post. Read the original yourself; the concepts are the same.

All lessons →
↑