Inference Concepts

15% of the NCA-AMAD exam. Read each answer, then drill this domain.

Drill this domainAll study notes

What happens inside a model server when a request arrives?

The prompt is tokenized and processed in the prefill phase, which builds the KV cache and produces the first token. The decode phase then generates the rest one token at a time, reusing the cache. Model servers batch many requests together, and gateways route requests across servers and models.

Source: NVIDIA: Mastering LLM techniques, inference optimization

Which metrics describe inference performance?

Time to first token covers the wait before output starts; inter-token latency covers the speed while generating; end-to-end latency is the total. Throughput counts tokens or requests per second across all users. Load tests at realistic concurrency show these numbers and the service's limits.

Source: NVIDIA NIM benchmarking: metrics

How do you make inference faster and cheaper?

Use in-flight batching and paged KV cache to keep GPUs busy, reuse cached prefixes, quantize to FP8 or lower where accuracy allows, and try speculative decoding. For big models, use tensor parallelism or disaggregated serving with Dynamo. TensorRT-LLM provides most of these optimizations.

Source: TensorRT-LLM overview

Why do inference servers run out of GPU memory?

Weights take a fixed amount, but the KV cache grows with context length and the number of concurrent requests. Long documents or many users can exhaust memory. Fixes include limiting maximum context or concurrency, quantizing, or adding GPUs with tensor parallelism.

Source: NVIDIA NIM: troubleshooting GPU out-of-memory errors

How do you choose between real-time, streaming and batch inference?

Real-time serving answers users who are waiting, so latency matters most; streaming tokens makes it feel faster. Batch inference processes large volumes offline for throughput and cost. Bigger batches raise throughput but can add latency, so the right setting depends on your latency targets and budget.

Source: NVIDIA: LLM inference benchmarking fundamentals

Drill this domain