Training is one-time. Inference is forever, and now it is a million tokens long.
In 2026, 1M-token context became the default (Claude 5.x, Gemini 4, GPT-6 Sol/Luna, DeepSeek-V4, Kimi K3), and agents made long, repetitive prefixes the normal workload. Serving that economically now starts at architecture: sparse and compressed attention (DeepSeek Sparse Attention, DeepSeek-V4's CSA/HCA), linear-attention hybrids (Kimi Delta Attention, Gated DeltaNet) and multi-token-prediction heads are designed in for inference. On top sit the serving engines, vLLM and SGLang, with paged and hierarchical KV caches, prefix caching, speculative decoding (EAGLE-3/3.1, MTP self-speculation), FP8/NVFP4 kernels and disaggregated prefill/decode. The result is steep price deflation: Opus 5.5 costs 40% less than Opus 5, and GPT-6 Sol and Luna cost about half of GPT-5.6.
A frontier-grade implementation, in order.
If you control pretraining, choose attention for your target context: MLA or compressed KV, top-k sparse attention (DSA-style), or a 3:1 linear-to-full hybrid (Gated DeltaNet/KDA). Add MTP heads; they improve training signal and give you a free drafter. Retrofitting these after pretraining is much harder.
vLLM for the broadest model and hardware support; SGLang for structured generation, radix prefix caching and day-0 support of new DeepSeek/Kimi architectures; TensorRT-LLM for maximum NVIDIA throughput. Check that the engine has kernels for your attention variant; a fallback path can be 10× slower.
FP8 weights and activations are nearly lossless on Hopper/Blackwell. NVFP4 or MXFP4 weights on Blackwell roughly halve memory again; validate on reasoning and long-context evals, not just perplexity. Keep the KV cache in FP8 if quality holds.
Paged KV by default; radix or prefix caching for shared system prompts and agent histories; tier cold KV to CPU or NVMe (HiSparse-style) for million-token sessions. Expose explicit prompt-cache breakpoints to customers, since cache hit rate dominates agent economics.
Use the model's own MTP heads first, then a trained EAGLE-3-style draft head. Tune draft length per batch size: gains are largest at low concurrency and shrink as the GPU saturates. Tree drafts help at batch 1.
Run prefill (compute-bound) and decode (memory-bound) on separate pools with different parallelism, transferring KV between them (DistServe, Mooncake). Continuous batching with chunked prefill keeps long prompts from stalling decode.
Offer reasoning-effort tiers and a priced fast mode. Route easy requests to small models (Haiku/Flash/Luna class) and reserve frontier models for hard turns.
In rough order of foundational → recent. Click any title to open the arXiv abstract.
Shah et al. · 2024
Kwon et al. · 2023
Zheng et al. · 2023
RadixAttention prefix caching
Leviathan et al. · 2022
Cai et al. · 2024
Li et al. · 2024
Li et al. · 2025
Gloeckle et al. (Meta) · 2024
DeepSeek-AI · 2024
Yuan et al. (DeepSeek) · 2025
DeepSeek-AI · 2025
DeepSeek Sparse Attention (lightning indexer + top-k)
DeepSeek-AI · 2026
CSA/HCA hybrid; 10% of V3.2's KV cache at 1M tokens
Moonshot AI · 2025
Kimi Delta Attention; up to 75% less KV cache
NVIDIA · 2025
Lin et al. · 2023
Frantar et al. · 2022
Xiao et al. · 2023
Zhong et al. · 2024
Qin et al. (Moonshot AI) · 2024
NVIDIA · 2026
One model decoding autoregressively, by diffusion, or self-speculatively