Iteration time is the latency of a single forward pass of a neural network model. In the context of autoregressive decoding for large language models (LLMs), this corresponds to the time required to generate one new output token for every sequence currently active in the batch. It is the fundamental unit of work in the token-by-token generation loop and is a primary determinant of both throughput and per-token latency for interactive applications.
Glossary
Iteration Time

What is Iteration Time?
A core performance metric in autoregressive inference, iteration time measures the latency of a single forward pass through a model.
This metric is heavily influenced by the active batch size and the model's memory bandwidth consumption. During the decoding phase, iteration time is often memory-bound, as each step involves reading the entire model's key-value (KV) cache and weights to produce the next token. Optimization techniques like continuous batching aim to maximize GPU utilization by keeping iteration time consistent and high, ensuring the processor is never idle waiting for new requests to batch.
Key Characteristics of Iteration Time
Iteration time is the latency of a single forward pass of the model, which in the decoding phase corresponds to the time taken to generate one token for each sequence in the active batch. Its characteristics define the fundamental cadence of autoregressive generation.
Primary Determinant of Token Generation Rate
Iteration time is the inverse of token generation throughput for a fixed batch size. If the iteration time is 50 milliseconds, the system generates 20 tokens per second per sequence in the batch. This relationship is linear: halving the iteration time doubles the token output rate, making it the most direct metric for evaluating decoding speed.
- Throughput Formula: Tokens/sec/sequence = 1000 ms / Iteration Time (ms)
- Batch Impact: Total system throughput = (Batch Size * 1000) / Iteration Time (ms)
Memory-Bound in the Decoding Phase
During autoregressive decoding, iteration time is dominated by memory bandwidth, not compute. Each step performs a small matrix-vector multiplication to generate the next token, but must load the entire key-value (KV) cache from high-bandwidth memory (HBM). The time is largely spent waiting for data.
- Bottleneck: Speed of reading the KV cache and model weights.
- Implication: Optimizations like KV cache quantization or improved memory access patterns have a greater impact on iteration time than increasing FLOPs.
Directly Proportional to Sequence Length
Iteration time increases linearly with the total context length of all sequences in the batch due to the size of the KV cache. Processing a batch with 10 sequences of length 1000 requires accessing 10x more cached data than a batch with 10 sequences of length 100.
- Cache Size: KV cache memory ~= 2 * batch_size * num_layers * num_heads * d_head * seq_len
- Performance Impact: Longer sequences increase memory traffic per iteration, slowing down each step. Techniques like paged attention help mitigate this by organizing memory more efficiently.
Governed by the Slowest Operation in the Pipeline
The iteration time for a batch is set by the critical path—the slowest sequence or operation in that forward pass. If one sequence requires a specialized kernel or hits a memory bottleneck, it stalls the entire batch. This is a key challenge for variable-length batching.
- Synchronization Point: GPU execution is synchronous within a batch; all sequences must finish the forward pass before the next iteration begins.
- Optimization Target: Minimizing variance in per-sequence processing time through efficient kernels and memory layouts is essential for low, predictable iteration time.
Independent of Prefill Latency
Iteration time is a property of the decoding loop, separate from the initial prefill phase. Prefill is a single, compute-intensive parallel processing of the prompt. Decoding is many sequential, memory-bound steps. They are optimized differently.
- Prefill Phase: High FLOP utilization, processes the entire prompt at once.
- Decoding Phase: Characterized by iteration time; generates tokens auto-regressively.
- System Design: High-performance servers often use separate hardware queues or scheduling policies for prefill vs. decode requests.
Key Input for Latency Calculations
For any request, the total time-to-first-token (TTFT) and time-per-output-token (TPOT) can be derived from iteration time and scheduling behavior.
- TTFT: = Prefill Latency + Queueing Delay.
- TPOT: ≈ Iteration Time (when batch composition is stable).
- Total Latency: = TTFT + (Output Token Count - 1) * TPOT.
Engineers use iteration time to model and guarantee service-level objectives (SLOs) for interactive applications like chatbots, where TPOT directly impacts user perception.
How Iteration Time Works in Inference
Iteration time is a core latency metric for autoregressive language model inference, directly measuring the speed of the token-by-token generation loop.
Iteration time is the latency of a single forward pass of a model during the decoding phase, corresponding to the time taken to generate one new token for each active sequence in the batch. This metric is the fundamental unit of progress in autoregressive generation, where each iteration consumes the previous output token to produce the next. It is primarily constrained by memory bandwidth as the model reads its parameters and the cached key-value (KV) states for every generated token.
Optimizing iteration time is critical for reducing per-token latency and improving the responsiveness of interactive applications like chatbots. Techniques like continuous batching, which maximizes GPU utilization by dynamically managing the active batch, and KV cache optimization, which reduces memory traffic, directly target this bottleneck. In a well-tuned system, iteration time remains stable even as batch composition changes, ensuring predictable performance.
Factors Affecting Iteration Time
A comparison of primary system components and their impact on the latency of a single model forward pass (iteration time).
| Component / Factor | High Impact | Medium Impact | Low Impact |
|---|---|---|---|
Model Size (Parameters) | |||
Sequence Length (Context) | |||
Hardware (GPU/TPU Type) | |||
Numerical Precision (e.g., FP16 vs. INT8) | |||
Batch Size | |||
Memory Bandwidth (HBM) | |||
Kernel Launch Overhead | |||
Host-to-Device Data Transfer | |||
Software Framework & Kernel Optimization | |||
Network Latency (for Distributed Inference) | |||
System Software (Driver Version) |
Frequently Asked Questions
Iteration time is a core latency metric in autoregressive model inference, directly impacting user experience and system throughput. These questions address its definition, measurement, and optimization.
Iteration time is the latency of a single forward pass of a neural network during inference, which, in the decoding phase of an autoregressive model, corresponds to the time taken to generate one new token for each sequence in the currently active batch.
This metric is distinct from end-to-end latency (the total time for a full request) and throughput (tokens generated per second). It is a fundamental determinant of the perceived responsiveness of interactive applications like chatbots. Iteration time is primarily governed by the time to compute the model's attention mechanism and feed-forward layers, and to read/write the key-value (KV) cache from high-bandwidth memory.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Iteration time is a core latency metric in autoregressive inference. These related terms define the performance characteristics and bottlenecks of the decoding phase.
Tail Latency
Tail latency refers to the high-percentile response times (e.g., p95, p99) of inference requests, which are critical for user experience in interactive applications. While average latency may be low, a few slow requests can dominate user perception.
- Causes: Variability in sequence length, system noise, garbage collection, and head-of-line blocking in batches.
- Impact: Directly affects service-level agreements (SLAs) for real-time applications like chatbots.
- Mitigation: Techniques like request interleaving and intelligent scheduling aim to reduce tail latency variance.
Memory-Bound Operation
A memory-bound operation is one where execution time is limited by the speed of reading from or writing to memory (e.g., GPU HBM or DRAM), not by the processor's computational speed. The decoding phase of autoregressive generation is typically memory-bound.
- Primary Bottleneck: The time to load the model's weights and the KV cache for each generated token.
- Contrast with Compute-Bound: The prefill phase is usually compute-bound, dominated by matrix multiplications.
- Optimization Focus: Techniques aim to reduce memory bandwidth pressure, such as KV cache quantization and optimizing data layout.
Decoding Phase
The decoding phase is the iterative, sequential stage of autoregressive model inference where output tokens are generated one at a time. Each step (iteration) conditions on the previously generated tokens.
- Characteristics: Inherently sequential, memory-bandwidth-bound, and latency-sensitive.
- Key Component: Relies heavily on the KV (Key-Value) Cache to avoid recomputing previous attention states.
- Performance Driver: Iteration time is the fundamental latency of this phase. Throughput is determined by iteration time and effective batch size.
Prefill Phase
The prefill (or prompt processing) phase is the initial, parallel computation stage where the model processes the entire input prompt to generate the first output token and populate the initial KV cache.
- Characteristics: Compute-intensive, parallelizable across the prompt length, and typically compute-bound.
- Contrast with Decoding: The prefill phase has high latency for long prompts but is amortized over many generated tokens.
- Scheduling Impact: In continuous batching, a new request's prefill can cause a temporary spike in iteration time for the active batch.
Throughput
Throughput is the rate at which a system processes work, measured in tokens per second or requests per second. For inference, it represents the total capacity of the system.
- Relationship to Iteration Time: System throughput = (Effective Batch Size) / (Iteration Time). Lower iteration time enables higher throughput.
- Trade-off with Latency: Increasing batch size generally improves throughput but can increase per-request latency (iteration time may stay constant, but queueing delay increases).
- Measurement: Requires steady-state load and is distinct from peak or burst performance metrics.
Kernel Launch Overhead
Kernel launch overhead is the latency incurred when dispatching a computational kernel (a GPU function) for execution. This includes costs from the driver, runtime, and hardware scheduler.
- Impact on Iteration Time: For very small operations, this overhead can dominate the actual computation time. In decoding, each iteration involves launching multiple kernels.
- Optimization: Operator/Kernel fusion combines multiple small operations into a single kernel to amortize launch overhead and improve memory access patterns.
- Significance: Becomes a critical bottleneck for low-latency, single-token generation scenarios.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us