IBM Technology

What Is LLM Inference? How AI Models Generate Responses

Published 2026-10-22 · Duration 7:46

Summary

LLM inference is the process by which a static, trained model (a set of weights) generates real-time responses to new inputs, forming the backbone of modern chatbots and AI applications. This process is managed by an inference engine (e.g., vLLM, Ollama) and involves several critical steps: tokenization, hardware routing, and efficient batching. The core computation is divided into two distinct phases—the compute-bound prefill phase and the memory bandwidth-bound decode phase—each requiring specific optimization to ensure low latency and high throughput.

Download summary

Key takeaways

  1. Inference vs. Training

    Inference is the process of running a trained model against new input (happening every request), while training is a one-time process that tunes the static weights. Inference is crucial because it reoccurs with every request and often costs more over time than training.

  2. The Role of the Inference Engine

    An inference engine (like vLLM or Ollama) manages the process by scheduling requests, managing GPU resources, and turning a pile of weights into a service that can handle requests reliably, quickly, and at scale.

  3. Optimizing Throughput with Batching

    To prevent wasting GPU resources, modern engines use continuous batching, where a scheduler slots a new request into the hardware immediately after another request finishes, keeping the GPUs near full utilization.

Technical details

  • Tokenization 215s

    This initial step translates raw text into tokens (which can be words, parts of words, or punctuation) and maps them to arbitrary token IDs. The model only processes the stream of IDs, and this step determines the cost per token.

  • Prefill Phase (Compute-Bound) 390s

    When a request enters the model, the prefill phase reads the entire prompt at once to build an understanding, creating a Key-Value (KV) cache. This step is compute-bound, meaning its speed is limited by the raw computational power of the hardware.

  • Decode Phase (Memory Bandwidth Bound) 420s

    The decode phase generates the response one token at a time. It uses the KV cache and runs a forward pass to produce a probability distribution over the vocabulary. This step is memory bandwidth bound, meaning its speed is limited by how fast data can move out of memory.

  • Latency Metrics 460s

    Two key metrics are used to measure LLM latency: Time to First Token (TTFT), which measures the prefill step duration; and Inter Token Latency (ITL), which measures the time between subsequent tokens during the decode phase.

Mentioned resources

  • vLLM (Inference Engine)
  • Ollama (Inference Engine)
  • Llama CPP (Inference Engine)

Channel & topics

Watch on YouTube · Back to latest

This independent, AI-assisted summary is provided for commentary and informational purposes. It may contain errors or omit important context. Please watch the original video for the creator's complete presentation. Video, thumbnail, and related copyrights belong to their respective owners.