Inferensys

Glossary

Tokens Per Second (TPS)

A throughput metric measuring the rate at which an inference server generates output tokens after the first token has been produced.
Developer testing AI inference on mobile phone in hand, laptop with optimization code visible, casual tech review moment.
INFERENCE THROUGHPUT METRIC

What is Tokens Per Second (TPS)?

Tokens Per Second (TPS) is the primary metric for measuring the raw generation speed of a language model inference server, quantifying how many discrete text units are produced each second after the initial response latency.

Tokens Per Second (TPS) measures the rate at which an inference engine generates output tokens during the decoding phase, excluding the Time To First Token (TTFT) latency. It directly reflects the computational throughput of the serving stack, influenced by factors such as model quantization, KV cache efficiency, and batching strategies. For enterprise deployments, high TPS is critical to maintaining interactive user experiences and maximizing the utilization of expensive GPU resources.

Achieving optimal TPS requires a combination of hardware-aware kernels like Flash Attention and serving engines such as vLLM that implement continuous batching and PagedAttention. Unlike TTFT, which measures initial responsiveness, TPS defines the perceived speed of content streaming. This metric is often inversely correlated with model size and precision, making it a key optimization target when balancing output quality against infrastructure cost in self-hosted environments.

THROUGHPUT DETERMINANTS

Key Factors Influencing TPS

Tokens Per Second (TPS) is not a static benchmark; it is a dynamic metric shaped by the interplay of hardware capability, model architecture, and inference software optimization. Understanding these variables is essential for capacity planning in self-hosted deployments.

01

Model Architecture & Parameter Count

The structural complexity of the model directly dictates computational cost per token. Mixture of Experts (MoE) architectures achieve higher TPS by activating only a fraction of total parameters per token, while dense models scale compute linearly with size. Grouped-Query Attention (GQA) reduces KV cache bandwidth, accelerating generation compared to full Multi-Head Attention. Smaller parameter counts generally yield higher TPS, but quantization can make larger models viable on fixed hardware.

7B-70B
Common Dense Model Range
02

Quantization Precision

Reducing numerical precision from 16-bit to 4-bit integers using formats like GGUF dramatically decreases memory bandwidth pressure and compute requirements. This allows larger models to fit entirely in GPU VRAM or even run on CPU with acceptable TPS. QLoRA enables fine-tuning at this precision. The trade-off is a minor perplexity increase for a substantial throughput gain, making quantization the single most impactful software lever for TPS on consumer or edge hardware.

2-4x
Typical TPS Uplift from 4-bit
03

Inference Engine & Batching Strategy

The serving software stack is critical. vLLM utilizes PagedAttention to manage KV cache memory with near-zero fragmentation, enabling high Continuous Batching efficiency. Llama.cpp is heavily optimized for CPU and hybrid GPU inference on personal devices. NVIDIA Triton Inference Server provides dynamic batching and model ensembles for enterprise deployments. The choice of engine and its ability to overlap computation with memory transfers directly governs achievable TPS under concurrent load.

10-20x
Throughput Gain with Continuous Batching
04

Hardware Memory Bandwidth

For token generation, performance is often memory-bound rather than compute-bound. The rate at which model weights can be streamed from VRAM or system RAM to the processing units is the primary bottleneck. High-bandwidth memory (HBM) on data-center GPUs provides a massive advantage. On consumer hardware, ensuring the model fits entirely in fast GPU memory avoids the catastrophic TPS drop caused by offloading layers to slower system RAM or swap.

900 GB/s+
HBM Bandwidth Target
05

KV Cache Management

The KV Cache stores attention keys and values to avoid recomputation for each new token. Its size grows linearly with batch size and sequence length. Inefficient memory allocation leads to fragmentation and waste, capping the number of concurrent sequences. PagedAttention solves this by allocating cache in blocks, while Prefix Caching reuses the cache for identical prompt preambles. Effective cache management directly increases the maximum batch size and thus total system TPS.

2-4x
Batch Size Improvement
06

Sequence Length & Generation Profile

TPS is measured on output tokens, but the prompt's length impacts the prefill phase and initial memory allocation. A very long prompt with a short generation will show a lower average TPS if prefill time is included. Speculative Decoding uses a smaller draft model to propose tokens rapidly, which the large model verifies in parallel, effectively decoupling TPS from the large model's inherent latency for low-batch, interactive scenarios.

2-3x
Interactive TPS Gain
THROUGHPUT METRICS

Frequently Asked Questions

Understanding Tokens Per Second (TPS) is critical for capacity planning in sovereign AI deployments. These answers clarify how to measure, interpret, and optimize generation speed on self-hosted infrastructure.

Tokens Per Second (TPS) is the primary throughput metric measuring the rate at which an inference server generates new output tokens after the Time To First Token (TTFT) latency has elapsed. It is calculated by dividing the total number of output tokens generated by the total generation time, excluding the prefill phase. For a precise measurement, the clock starts ticking the moment the first token is streamed back to the client and stops when the end-of-sequence token is emitted. In a self-hosted environment, TPS is typically measured using benchmarking tools that simulate concurrent user load against an endpoint. It is crucial to distinguish between prefill throughput (processing the input prompt) and decode throughput (generating the output), as TPS specifically quantifies the latter. This metric directly dictates the user-facing responsiveness and the maximum number of concurrent sessions a specific GPU cluster can sustain before latency degrades unacceptably.

PERFORMANCE COMPARISON

TPS vs. Other Inference Metrics

How Tokens Per Second compares to other critical serving metrics for self-hosted LLM deployments

MetricTokens Per Second (TPS)Time To First Token (TTFT)Throughput (Requests/Sec)

Primary Focus

Output generation speed after first token

Initial response latency

System-level request handling capacity

Measurement Unit

Tokens per second

Milliseconds or seconds

Requests per second

Directly Affected By

Model size, quantization, GPU compute, batch size

Prompt processing, model loading, network latency

Batching efficiency, concurrency, queue management

User Experience Impact

Perceived reading speed and fluidity

Perceived responsiveness and interactivity

System scalability under load

Optimization Techniques

Quantization, Flash Attention, Tensor Parallelism, Speculative Decoding

Prefix Caching, prompt compression, hardware acceleration

Continuous Batching, Paged Attention, request queuing

Relevance to Self-Hosting

Critical for cost efficiency and user satisfaction

Critical for interactive applications

Critical for production serving at scale

Measurement Scope

Per-request generation phase only

Per-request prefill and scheduling phase

System-wide across concurrent requests

Trade-off Relationship

Often inversely related to TTFT under high load

Can increase if maximizing TPS via large batches

Can decrease if prioritizing low TTFT per request

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.