Inferensys

Glossary

Tokens Per Second (TPS)

Tokens Per Second (TPS) is a primary throughput metric for LLM serving that quantifies the number of output tokens a system can generate per second, directly influencing user experience and the total cost of inference.
Developer testing AI inference on mobile phone in hand, laptop with optimization code visible, casual tech review moment.
KEY THROUGHPUT METRIC

What is Tokens Per Second (TPS)?

Tokens Per Second (TPS) is the fundamental metric for measuring the raw generation speed of a Large Language Model (LLM) during inference.

Tokens Per Second (TPS) is a key throughput metric that measures the number of output tokens a language model serving system can generate per second. It is a direct indicator of inference speed and system efficiency, calculated by dividing the total tokens generated by the total wall-clock time for a request or batch. Higher TPS translates to lower latency for end-users and reduced inference cost for a fixed workload, as the same computational resources produce more output in less time. It is the primary benchmark for comparing the raw performance of different hardware, model optimizations, and serving engines.

TPS is heavily influenced by underlying inference optimization techniques. Factors like batch size, KV Cache efficiency, model quantization (e.g., GPTQ, AWQ), and advanced serving methods like continuous batching in engines such as vLLM directly determine achievable throughput. For engineering leaders, monitoring and optimizing TPS is essential for cost and resource management, as it dictates the required compute footprint to meet service-level agreements (SLAs). It is often analyzed alongside tail latency (P95/P99) to ensure consistent performance under load.

THROUGHPUT DETERMINANTS

Key Factors Influencing TPS

Tokens Per Second (TPS) is not a fixed specification but a dynamic performance metric shaped by a complex interplay of hardware, software, and workload characteristics. Understanding these factors is essential for capacity planning and cost optimization.

01

Hardware: GPU Architecture & Memory Bandwidth

The physical accelerator is the primary determinant of peak TPS. Key specifications include:

  • Compute Cores (CUDA/Stream Processors): Dictate raw parallel processing power for matrix multiplications.
  • Memory Bandwidth (GB/s): The speed at which model weights and the KV cache can be read into on-chip memory; often the bottleneck for large models.
  • VRAM Capacity: Limits the maximum model size and batch size that can be loaded. High TPS requires keeping the computational units saturated, which is constrained by how quickly data can be fed to them.

Example: An NVIDIA H100 with 1,979 GB/s memory bandwidth and dedicated Transformer Engine cores will achieve significantly higher TPS than an A100 (1,555 GB/s) for the same model.

02

Model Architecture & Size

The neural network's design imposes fundamental computational constraints.

  • Parameter Count: Larger models (e.g., 70B vs. 7B) have more weights to load and compute, reducing TPS for a given hardware setup.
  • Attention Mechanism: Standard quadratic-complexity attention is more demanding than efficient variants like FlashAttention or grouped-query attention (GQA).
  • Context Window Length: Longer sequences increase the size of the KV Cache, consuming more memory bandwidth and computation during decoding.

The relationship is inverse: TPS ∝ 1 / (Model Size × Sequence Length).

03

Inference Serving Optimizations

Software-level techniques that maximize hardware utilization.

  • Continuous Batching: Groups multiple user requests (of varying lengths) into a single batch, dynamically updating it as requests finish, maximizing GPU utilization.
  • PagedAttention (vLLM): Manages the KV Cache in non-contiguous memory blocks, drastically reducing fragmentation and waste, allowing for larger effective batch sizes.
  • Model Quantization: Using INT8 or GPTQ/AWQ (4-bit) reduces the memory footprint and bandwidth requirements of weights, directly increasing potential TPS.
  • Speculative Decoding: Uses a small draft model to propose token sequences, verified in parallel by the main model, reducing the number of costly large model runs.
04

Workload Characteristics: Request Pattern

How users interact with the system defines the achievable TPS.

  • Batch Size: The number of requests processed simultaneously. Larger batches improve GPU utilization but increase time to first token (TTFT).
  • Output Token Length: Generating longer responses increases the total computational work per request, reducing the overall request throughput.
  • Traffic Concurrency & Distribution: Steady, high-concurrency traffic allows for optimal batching. Sparse, bursty traffic leads to poor GPU saturation and lower effective TPS.
  • Prompt Complexity: Longer, more complex input prompts increase the computational cost of the initial prefill phase before token generation begins.
05

System Overhead & Network Latency

Infrastructure inefficiencies that cap realized TPS.

  • Cold Starts: The latency and throughput penalty when a new server instance must load a model into GPU memory before serving requests.
  • Host-to-Device Data Transfer: Time spent moving prompts from CPU/RAM to GPU VRAM.
  • Inter-Node Communication: In tensor or pipeline parallel deployments, network latency between GPUs can become a bottleneck.
  • Scheduling & Queueing Delays: Overhead from the serving framework (e.g., TorchServe, Triton) and load balancers in routing and preparing requests.
06

The TPS-Cost-Latency Trade-off

Maximizing TPS is not an isolated goal; it exists within a critical trilemma with cost and latency.

  • High TPS via Large Batches: Increases throughput and lowers cost per token but raises Tail Latency (P99) for individual users.
  • Low Latency Prioritization: Requires smaller batches or even no batching, maximizing responsiveness for a single user but drastically reducing overall TPS and increasing cost.
  • Optimization Target: Engineering teams must configure their serving systems (batch size, autoscaling rules) based on the Service Level Objective (SLO)—whether it's minimizing cost, maximizing throughput, or guaranteeing low-latency user experiences.
KEY METRICS

TPS vs. Latency: A Critical Distinction

A comparison of the throughput metric Tokens Per Second (TPS) and the responsiveness metric latency, highlighting their distinct roles in performance evaluation and cost management for LLM serving.

Metric / CharacteristicTokens Per Second (TPS)Latency (Time to First Token / Per-Token)

Primary Definition

The rate of output token generation, measured in tokens/second.

The time delay between sending a request and receiving a response, measured in milliseconds or seconds.

What It Measures

System throughput and batch processing efficiency.

End-user perceived responsiveness and interactivity.

Primary Influence on

Total cost of inference for a given workload.

User experience and application feel (e.g., chat responsiveness).

Key Optimization Target

Maximizing GPU utilization (e.g., via continuous batching).

Minimizing idle compute time and serial bottlenecks.

Relationship to Batch Size

Generally increases with larger batch sizes.

Generally increases with larger batch sizes due to queuing.

Typical Trade-off

Higher TPS often comes at the cost of increased latency.

Lower latency often requires smaller batches, reducing TPS.

Critical for Workload Type

Batch processing, offline tasks, high-volume background jobs.

Interactive applications, real-time chat, user-facing APIs.

Direct Cost Correlation

High. Higher TPS processes more tokens per dollar of compute.

Indirect. Lower latency may require premium hardware or underutilized resources, increasing cost per token.

Monitoring Percentile

Average or peak throughput is typically sufficient.

Tail latency (P95, P99) is critical for quality of service guarantees.

INFERENCE OPTIMIZATION

Primary Techniques for Optimizing TPS

Optimizing Tokens Per Second (TPS) requires a multi-faceted approach targeting computational efficiency, memory management, and system architecture. These techniques directly reduce inference cost and latency while improving user experience.

03

Model Quantization & Compression

Reducing the numerical precision of model weights and activations decreases memory bandwidth requirements and accelerates computation.

  • INT8/FP8 Quantization: Using 8-bit integers or floats instead of 16-bit (FP16) or 32-bit (FP32) can double theoretical TPS by enabling faster matrix operations on supported hardware.
  • GPTQ & AWQ: Advanced 4-bit post-training quantization methods that minimize accuracy loss. A 4-bit quantized model requires 1/4 of the original GPU memory, allowing larger batch sizes or the use of smaller, cheaper GPUs for the same model, directly boosting TPS per dollar. Quantization is often the first step in any TPS optimization pipeline.
4x
Memory Reduction (4-bit vs 16-bit)
05

Hardware-Aware Serving & Parallelism

Matching the model architecture to the underlying hardware is essential for peak TPS.

  • Tensor Parallelism: Splits individual model layers across multiple GPUs. Essential for serving models larger than a single GPU's memory (e.g., 70B+ parameter models). While it introduces communication overhead, it's the only way to serve such models at all.
  • Optimized Kernels: Using framework-specific optimized kernels (e.g., FlashAttention for faster attention computation, fused operators) reduces core computational latency.
  • Right-Sizing Instances: Selecting the optimal cloud GPU instance (e.g., A100 80GB vs. H100) based on model size, batch size, and latency targets to maximize TPS per dollar.
2-4x
Attention Speedup (FlashAttention-2)
06

System-Level Traffic Management

TPS is a system-level metric, not just a model-level one. Infrastructure decisions have a major impact.

  • Autoscaling: Dynamically adding or removing model inference pods based on request queue length to handle traffic spikes without over-provisioning.
  • Load Shedding & Rate Limiting: Proactively rejecting low-priority requests during overload to protect the system's ability to serve high-priority requests at target TPS and latency (P99).
  • Optimized Cold Starts: Using techniques like pre-warming instances or snapshotting loaded models to minimize the latency penalty when scaling out, ensuring consistent TPS for all users.
TOKENS PER SECOND (TPS)

Frequently Asked Questions

Tokens Per Second (TPS) is a critical performance and cost metric for Large Language Model inference. These questions address its technical definition, influencing factors, and its role in production system design and financial planning.

Tokens Per Second (TPS) is a throughput metric that quantifies the number of output tokens a language model inference system can generate per second. It is measured by dividing the total number of tokens produced in a completed inference job by the total wall-clock time elapsed from the start of the first token's generation to the end of the last token's generation. This measurement is distinct from hardware-level metrics like FLOPS, as it encompasses the entire software serving stack, including prefill (processing the input prompt) and decode (autoregressively generating output tokens) phases, as well as system overhead. In production, TPS is often reported as an average across many requests under a specific load, with P95 and P99 TPS (tail latency equivalents) being crucial for understanding worst-case performance.

Prasad Kumkar

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.