Contents
  1. Part I — From request to generated tokens
    1. The serving contract
      1. From acceptance to release
      2. Three operational quantities
    2. Prefill and decode
      1. The first-token boundary
  2. Part II — State and progress
    1. The KV cache
      1. A cache-payload estimate
      2. Keep the memory ledger separated
    2. Latency has boundaries
      1. Progress and completion metrics
  3. Part III — Sharing a server
    1. Continuous batching
      1. Three batching policies
    2. Scheduling and admission
      1. Allocating delay
      2. Policy dimensions
  4. Part IV — Selecting and delivering output
    1. Sampling, stopping, and streaming
      1. Selection is not system determinism
      2. Ways generation ends
    2. Speculative decoding
      1. Accept, reject, correct
      2. Conditions governing benefit
  5. Part V — Development and capacity
    1. Serving developments
    2. Precision and resources
      1. Cache precision
      2. A comparison ledger
    3. The capacity envelope
      1. A consistency relation
      2. Workload objectives
  6. Part VI — Measurement and decisions
    1. Benchmark the workload
      1. Open-loop and closed-loop load
    2. Locate the bottleneck
      1. Controlled sweeps
      2. Warm execution is not startup
    3. Routing and reasoning budgets
      1. Responsibility boundary
  7. Check understanding
  8. Open questions
  9. Selected talks
  10. References
  11. Talk library
← All topics

Inference Engineering: Turning Model Computation Into Responsive Services

Inference engineering turns trained model weights into a service that can handle real requests. It includes loading and placing the model, processing prompts, generating tokens, managing attention state and scheduling competing work. The goal is useful response time and throughput within hardware and cost limits. This chapter follows the serving path so batching, caching, quantization and speculative decoding can be understood as parts of a complete system rather than isolated speed claims.

Part I — From request to generated tokens

The serving contract

A serving request is not merely the user's visible text. It is the complete model-visible sequence produced by a model-specific chat template, together with generation controls and an allowance for new output. System instructions, message history, retrieved passages, tool definitions, role markers, and special tokens may all contribute to the input. The application should count the complete serialized request and reserve room for generation before admission. A context limit constrains the combined sequence; cache capacity does not enlarge that architectural limit.

From acceptance to release

The request then passes through distinct responsibilities. Admission control decides whether bounded resources and policy permit activation. An admitted request may wait in a queue before model work begins. Execution produces zero or more incremental outputs until an end token, stop match, output limit, cancellation, or error supplies a disposition. Completion initiates cleanup, but it does not prove that already-launched accelerator work stopped instantly or that every allocation became reusable at the same moment. One documented vLLM lifecycle, for example, can defer block release while a GPU step or remote cache transfer remains in flight.

Three operational quantities

QuantityMeaningRequired boundary
LatencyElapsed time for one named intervalStart event, end event, and observation location
ThroughputCompleted work per unit timeWork unit, completion rule, and measurement duration
CapacityWorkload sustainably served under stated constraintsArrival pattern, request mix, latency objectives, and completion requirements

These quantities answer different questions. High accelerator utilization says that a resource was busy, not that useful requests completed within their objectives. Likewise, an HTTP success status describes a transport or API boundary; it does not establish answer quality. Production inference also needs readiness, lifecycle management, observability, recovery, and controls around the model engine itself. The chronology traces distinct serving constraints: latency-aware batching, benchmark contracts, iteration scheduling, speculative execution and KV organization. These mechanisms can coexist.

Different constraints, complementary serving mechanisms

  1. March 2017ClipperAdapt batch size to online prediction’s latency objective.Sources & context

    Contributors: Berkeley team

    What changed: Published at NSDI 2017. Per-model controllers adjusted maximum batch size to amortize overhead without ignoring interactive latency. Clipper addressed ordinary prediction calls, not token-by-token generation.

  2. November 2019 preprint; ISCA 2020MLPerf InferenceCompare performance under explicit workload, quality, and latency contracts.Sources & context

    Contributors: Reddi and 46 coauthors

    What changed: The initial server scenario measured sustainable throughput under independent arrivals and a tail-latency constraint. The offline scenario supplied all inputs together. Their distinction explains why bulk throughput does not establish interactive capacity.

  3. July 2022OrcaReturn scheduling control after each generation iteration.Sources & context

    Contributors: Seoul National University and FriendliAI researchers

    What changed: Published at OSDI 2022. Completed requests could leave and new requests enter between iterations, addressing wasted work and delayed admission when outputs have unequal lengths.

  4. November 2022 preprint; ICML 2023Fast Inference from Transformers via Speculative DecodingTrade draft and verification work for fewer serial target steps.Sources & context

    Contributors: Google

    What changed: The procedure preserves the target output distribution while using draft proposals and parallel target scoring. Benefit depends on accepted advancement, draft cost, and wasted verification work—not acceptance rate alone.

  5. September 2023 preprintPagedAttentionOrganize KV state in noncontiguous blocks allocated as needed.Sources & context

    Contributors: Woosuk Kwon and colleagues

    What changed: Block-based organization reduces reservation waste and fragmentation and permits compatible state sharing. It addresses memory organization, separately from the serial-execution constraint targeted by speculative decoding.

Five contributions address distinct constraints. Dates distinguish preprints and conference publication; ordinal spacing is not to scale. The sequence does not imply influence or universal replacement.

Prefill and decode

An autoregressive language model maps its current prefix to vocabulary scores called logits. A selection rule chooses one token, appends it to the prefix, and changes the conditional distribution used for the following choice. The full model mechanism lives in Producing an unknown continuation; the serving consequence is that known input positions and unknown output positions create different execution shapes.

The first-token boundary

Prefill processes the complete supplied prefix and establishes contextual state for its positions. The logits at the final prompt position support selection of the first output token. Because all prompt tokens are already known, an implementation can process substantial work across their positions together while causal masking prevents a position from reading future content. Decode begins after that first selection. Each iteration processes the newest selected token with retained state, produces the next logits, selects another token, and repeats. The next iteration cannot know its input token until the preceding selection finishes.

A selected token gets its KV state in the next step

Symbolic prompt P₁–P₃; ordinary full-history cache. Columns follow computation dependencies from left to right.

At this boundaryPrefill → select O₁Process O₁ → select O₂Process O₂ → select O₃
Known input processedP₁ P₂ P₃, together under causal maskingO₁, selected in the prior columnO₂, selected in the prior column
Retained numerical KV readNo prior prompt cache in this exampleKV(P₁ P₂ P₃)KV(P₁ P₂ P₃ O₁)
New numerical KV writtenKV(P₁ P₂ P₃)KV(O₁)KV(O₂)
Logits used to selectFinal prompt position P₃ → O₁Processed O₁ position → O₂Processed O₂ position → O₃
Cache after selection3 positions: P₁ P₂ P₃4 positions: P₁ P₂ P₃ O₁5 positions: P₁ P₂ P₃ O₁ O₂
Selected, not yet processedO₁ has no KV yetO₂ has no KV yetO₃ has no KV yet
The cache retains processed positions, one output token behind the latest selection. Causal masking permits parallel prompt processing while preventing each position from reading future tokens. Retained KV is reused rather than recomputed.

Prompt length therefore primarily changes prefill work and the amount of state created before generation. Output length primarily changes the number of decode iterations and how long each active sequence retains state. Prefill often exposes matrix-shaped parallel work, whereas low-batch decode often performs less arithmetic per byte moved. These are tendencies, not universal bottleneck labels: batching, architecture, kernels, cache representation, hardware, and sequence lengths can move either phase into another regime. The correct diagnosis comes from profiling the intended workload.

Part II — State and progress

The KV cache

Attention separates addressing from transmitted content through keys and values. During prefill, each transformer layer computes key and value representations for the supplied positions. A KV cache retains the positions selected by the model architecture and cache policy. In an ordinary full-history cache, that means every processed position; sliding-window or chunked layers may retain only a bounded subset. During decode, the new query can attend to retained keys and combine the corresponding values without recomputing their old projections, then append state for the newly processed position. The cache stores numerical representations derived from tokens—not text, an answer cache, or durable model memory.

A cache-payload estimate

MKV=LSHKVD2B M_{KV}=L\,S\,H_{KV}\,D\,2\,B Here LL is the number of layers, SS the retained positions, HKVH_{KV} the number of key-value heads, DD each head's dimension, and BB bytes per stored element. The factor two accounts for keys and values. Multiply again by active sequences when each owns separate state. This is tensor payload, not total device allocation: block rounding, metadata, temporary activations, communication buffers, graph storage, and headroom remain separate.

The number of KV heads is architectural. Conventional multi-head attention may retain a key and value head for every query head. Grouped-query attention shares each key-value pair among a group of query heads, while multi-query attention uses one key and one value head for all query heads. That can reduce cache storage and bandwidth, but changing the head arrangement changes the model architecture; it is not a lossless allocator setting applied after deployment.

Keep the memory ledger separated

CategoryLifetimeWhy it matters
Model weightsUsually residentMust fit before request state; precision affects bytes and supported arithmetic
KV stateRequest or reusable-prefix lifetimeGrows with retained positions and active sequences
Activations and workspaceTransient peaksCan reduce the cache budget even though allocations are temporary
Runtime and graph storageEngine-dependentMay be reserved separately from weights and KV payload
Free or fragmented capacityChanges over timeDetermines whether another request or block can be admitted

PagedAttention, introduced by Woosuk Kwon and colleagues in a September 2023 preprint, organizes KV state in fixed-size noncontiguous blocks allocated as needed. This reduces reservation waste and fragmentation and permits compatible sharing. Prefix caching extends reuse across requests, but only for exactly compatible preceding state. A practical cache identity can include parent-block identity, exact token IDs, adapter identity, multimodal hashes, and an isolation salt. Similar meaning or an identical suffix is insufficient. Reuse saves prefill work; it does not accelerate the new output tokens. In a documented vLLM implementation, cache blocks carry reference counts: releasing one request decreases ownership, but a block referenced elsewhere cannot be overwritten. A zero-reference cached block may remain reusable until eviction. Other engines may use different ownership and eviction contracts.

Conceptual reconstruction of documented vLLM block ownership. Table entries reference allocations rather than moving tokens. Reuse requires compatible exact tokens, preceding state and engine identifiers; it is not semantic matching. Zero-reference cached content can remain until eviction. Weights and KV are selected allocations, not the complete memory budget.

Latency has boundaries

“Latency” is incomplete without a start event, end event, and observation location. Queue time ends when execution starts. Prefill duration covers prompt processing at the engine. Server time to first token reaches the server's first token event, while a client-observed time to first token (TTFT) commonly ends when the client receives the first nonempty content response. Network, proxy, decoding, and buffering can separate those events. Observability's elapsed-time framework develops this boundary discipline for complete systems.

Progress and completion metrics

MetricTypical observationImportant qualification
Queue timeAdmission or arrival to engine startRequires a defined admission boundary
TTFTRequest send to first nonempty content receivedIncludes client-visible path; server TTFT may differ
ITLIntervals between successive responses or chunksA chunk can contain multiple tokens
TPOTPost-first-token generation time divided across later output tokensSome tools label a related average as ITL
Request latencyRequest start to final content responseDoes not necessarily include later cleanup
Output-token throughputGenerated tokens divided by benchmark durationTokenizer, completion accounting, and workload must match

A generated token, a decoded text fragment, a transport chunk, and a rendered UI update are different events. A streamer may buffer token IDs until they form printable text, and transport infrastructure may combine fragments. Incremental delivery can make an interface responsive before the full request completes, but it need not reduce model execution time. A delivered prefix also does not prove eventual successful completion.

One request, several latency intervals

Example timings

Server work, client visibility, completion, and cleanup use different start and end events.

Client request lifetime0100 msDuration 100 ms
Queue residence018 msDuration 18 msWithin Client request lifetime
Prefill1843 msDuration 25 msWithin Client request lifetime
First-content transit4351 msDuration 8 msWithin Client request lifetime
Decode execution4394 msDuration 51 msWithin Client request lifetime
Incremental delivery51100 msDuration 49 msWithin Client request lifetime
Deferred cleanup94108 msDuration 14 ms
Example milliseconds for one request; arrival coincides with client send at 0. First selection is at 43ms, while client TTFT ends at first nonempty content at 51ms. Decode (43–94) overlaps delivery (51–100). Cleanup (94–108) overlaps final delivery and finishes after client completion. Do not sum overlapping spans.
Read the diagram as text
  • Client request lifetime. Send through final client content. 0 to 100 ms; duration 100 ms.
  • Queue residence. Arrival until engine work begins. 0 to 18 ms; duration 18 ms. Parent: Client request lifetime.
  • Prefill. Prompt processing before first token selection. 18 to 43 ms; duration 25 ms. Parent: Client request lifetime.
  • First-content transit. Server selection and delivery to first nonempty client content. 43 to 51 ms; duration 8 ms. Parent: Client request lifetime.
  • Decode execution. Repeated generation after the first selection. 43 to 94 ms; duration 51 ms. Parent: Client request lifetime.
  • Incremental delivery. Decoded fragments transported while generation continues. 51 to 100 ms; duration 49 ms. Parent: Client request lifetime.
  • Deferred cleanup. Resource ownership is released after terminal state permits it. 94 to 108 ms; duration 14 ms.

Report distributions rather than only means. The 99th percentile is the value below which 99 percent of the specified observations fall; it is not an average. Partitioning by prompt length, output length, and request class often explains more than one aggregate percentile. Do not add independently computed p99 values for queue, prefill, network, and decode and call the sum an end-to-end p99: those percentiles may come from different requests.

Part III — Sharing a server

Continuous batching

A batch executes work from several requests together. Larger parallel operations can improve hardware use and amortize launch, scheduling, and weight-access overhead. But waiting to form the batch adds latency, and every active sequence consumes state. The useful batch is therefore constrained by the application's response budget and memory—not simply by the engine's configured maximum. Clipper, published at NSDI in March 2017 by a Berkeley team, adapted per-model batch limits to prediction-latency objectives. Its grouped ordinary prediction calls amortized overhead; it did not schedule autoregressive tokens.

Three batching policies

PolicyAdmission pointCharacteristic tradeoff
Fixed batchBefore the batch startsSimple, but unequal completion lengths can leave lanes idle
Dynamic batchAfter a short formation windowCan increase batch size by purchasing extra waiting time
Continuous or iteration-level batchBetween generation iterationsCompleted requests leave and new requests enter while others continue

Orca, published at OSDI in July 2022 by Seoul National University and FriendliAI researchers, returned scheduling control after each transformer iteration. Completed requests could leave and new work enter. Continuous batching is especially useful because generated outputs have unequal and initially unknown lengths. When one request ends, the scheduler can replace it without waiting for every other sequence in the batch. This reduces idle lanes, but it does not eliminate interference: new prefills compete with ongoing decodes, larger active sets require more KV state, and each request's token cadence can slow even as total device token throughput rises. Distinguish the configured sequence limit, the currently active sequences, and the prompt or decode tokens actually scheduled in an iteration.

Scheduling and admission

Admission control and scheduling solve different problems. Admission limits how much work can enter the bounded service; the scheduler chooses which admitted work runs next. If offered work persistently exceeds service capacity, rearranging the queue cannot make every objective feasible. The service must reject, defer, shed, degrade, or add capacity.

Allocating delay

A long prefill can delay token production for existing requests. Conversely, always prioritizing decode can make new prompt-heavy requests wait indefinitely for their first token. Chunked prefill divides a long prompt into bounded pieces that the scheduler can interleave with decode. Smaller chunks reduce individual stalls but introduce more scheduling boundaries, fixed overhead, and repeated reads of state from earlier prompt chunks. The best token budget is workload- and hardware-dependent.

Smaller prompt chunks divide delay—and add work

A and B are already decoding at time 0 and need 5 and 2 more steps. At 2ms, C arrives with a 12-token prompt and D with a 2-token prompt. Each new request produces one token at prefill completion, then needs 2 decode steps. Three active slots; D replaces B at the next iteration boundary. Memory is sufficient.

QuantityUnchunked (12)Selected (4)
C arrival → first selection10ms15.2ms
Largest A/B engine selection gap9ms5ms
Finish all work23ms26.2ms
Iterations / overhead5 / 5ms7 / 7ms
Prompt tokens / decode steps14 / 1114 / 11
Earlier prompt positions reread012
Budget 4: C first-selection delay 15.2ms; maximum continuing-request gap 5ms; finish at 26.2ms.
Fixed teaching workload and cost model

One iteration costs 1ms scheduling overhead + 0.5ms per prompt token + 1ms per decode step + 0.1ms per earlier prompt position read when continuing a prefill. Prompt requests share the selected prompt budget in arrival order (C before D for their tied arrival); every active decoding request gets one step. The total batch-token limit is fixed at 15. Admission and completion changes occur only between iterations. Prior A/B prefill is outside this window. No transport costs, memory pressure or failures are modeled.

Unchunked baseline

IterationTime (ms)ABCD
103D1D1
2312D1D1 · doneP12
31216D1D1P2
41620D1D1 · doneD1
52023D1 · doneD1 · done

Prompt budget 4 / iteration

IterationTime (ms)ABCD
103D1D1
238D1D1 · doneP4
3812.4D1P4Waiting
412.417.2D1P4Waiting
517.221.2D1 · doneD1P2
621.224.2D1 · doneD1
724.226.2D1 · done

P = prompt tokens processed; D1 = one decode step; done = leaves before the next iteration. Gaps are engine selections, not measured client ITL.

These timings follow a fixed teaching model, not measured hardware. Smaller chunks shorten individual interruptions to ongoing decodes, but repeated prompt-state reads and more scheduling boundaries can delay the new request and increase total modeled work.

Policy dimensions

DecisionBenefit soughtFailure to test
First-come-first-servedSimple orderingA long request blocks short later work
Priority classesProtect important trafficLower classes starve
Aging or SLO-relative urgencyBound starvation across classesSustained overload still violates objectives
PreemptionLet urgent work run soonerRetained KV uses memory; swapping or recomputation costs work
CancellationStop unwanted lifecycle workPropagation and resource release may be delayed
Backpressure or admission limitsBound queued and active workRejection or deferral becomes caller-visible

Prefix-aware routing creates another tension. Sending a request to a worker with reusable state can avoid prefill, but routing only by cache match can overload that worker and turn saved computation into queueing. A useful policy considers both compatible reusable state and present load. In large deployments, separating prefill and decode workers can reduce phase interference, but transferring KV state adds communication whose cost depends on its size, placement, and bandwidth.

Part IV — Selecting and delivering output

Sampling, stopping, and streaming

Each decode step begins with logits. Greedy decoding chooses a highest-scoring token. Sampling converts processed scores into a probability distribution and draws from it. Temperature changes concentration; lower values emphasize larger logits while higher values flatten the distribution. Top-k keeps a fixed number of high-probability candidates. Top-p, or nucleus sampling, keeps the smallest high-probability set whose cumulative mass reaches a threshold, then renormalizes. These settings alter token selection, not whether the answer is true.

Selection is not system determinism

Enabled controls also have an implementation order. One documented Transformers version applies temperature, then top-k, then top-p before softmax and sampling; custom processors or other engines may differ. Greedy execution instead takes an argmax. A random seed constrains random-number generation, but portable reproducibility can additionally require the same engine version, hardware, scheduling behavior, and supported batch-invariant execution. Temperature zero does not validate reasoning or guarantee identical outputs across changed environments.

Ways generation ends

After selecting a token, the server appends it and checks termination. An end-of-sequence token is model-visible. A stop string is matched against decoded text and may require holding back a suffix so the stop marker is not leaked. A maximum-output limit ends generation because a budget was exhausted, not because the task necessarily completed. Structured or machine-consumed responses must also handle refusal and incomplete output rather than parsing every partial prefix as a finished record.

Streaming exposes completed fragments while generation continues. It can reduce perceived waiting without changing the number of model steps. Backpressure at the transport layer prevents an unbounded application buffer, but pausing a network writer does not automatically pause accelerator generation; that requires explicit propagation into the serving scheduler.

Speculative decoding

Ordinary autoregressive generation pays for one serial target-model step per advancement. Speculative decoding uses a cheaper draft process to propose several future tokens, then asks the target model to score their conditional distributions together. The target—not the draft—determines what is committed. This can exchange extra arithmetic for fewer serial target invocations, which is useful when target execution has spare parallel capacity but repeated state or weight access dominates elapsed time. Google's Fast Inference from Transformers via Speculative Decoding appeared as a November 2022 preprint and at ICML 2023. Its analysis separates accepted advancement from draft cost and wasted verification work.

Accept, reject, correct

In distribution-preserving speculative sampling, proposals are examined left to right. Proposal xix_i, drawn from draft distribution qiq_i, is accepted with probability min(1,pi(xi)/qi(xi))\min(1,p_i(x_i)/q_i(x_i)), where pip_i is the target distribution for that position. The accepted prefix is retained. At the first rejection, that token and later proposals are discarded; a replacement is drawn from the normalized positive part of piqip_i-q_i. If every proposal passes, the target supplies an additional token. This procedure preserves the target sampling distribution within numerical precision; it does not guarantee identical samples or correct answers.

Unused proposals must not leak into output or persistent target state. In Transformers v4.50.0, assisted generation supplies only the valid continuation to the streamer and crops target KV to the total committed sequence length minus one. The last selected token has not yet been processed; after a rejection, this can be the replacement token. Logical cropping need not release allocator reservations immediately. Useful advancement must justify both draft and verification cost.

Commit only the accepted prefix and its correction

At each position, accept xᵢ with probability min(1, pᵢ(xᵢ)/qᵢ(xᵢ)). Examine proposals left to right and stop at the first rejection.

Main branchPosition 1Position 2Position 3Position 4
Draft proposalsx₁ from q₁x₂ from q₂x₃ from q₃x₄ from q₄
Target conditional scoringp₁(· | prefix)p₂(· | prefix,x₁)p₃(· | prefix,x₁,x₂)p₄(· | prefix,x₁,x₂,x₃)
Acceptance✓ Accept x₁✓ Accept x₂× Reject x₃— Not tested; discard x₄
Committed continuationx₁x₂r: replacementNone
Valid tokens supplied to streamerx₁x₂rNone
Retained new target KVKV(x₁)KV(x₂)No KV(r) yet; drop KV(x₃)Drop KV(x₄)

Replacement r ∼ normalize(max(p₃ − q₃, 0)), not an ordinary draw from p₃.

If all four proposals pass: commit x₁, x₂, x₃, x₄, t, with t sampled from the target distribution after x₁–x₄. Supply those five tokens to the streamer. Retain target KV through x₄; newly selected t has no KV yet.
The sampling algorithm preserves the target distribution; it does not verify truth or reproduce identical seeded samples. The KV row follows Transformers v4.50.0: retain the processed committed prefix, excluding the newly selected last token. Supplying valid tokens to a streamer does not guarantee immediate client delivery or allocator reclamation.

Conditions governing benefit

Tune speculative decoding for the deployed target, draft process, request content, and concurrency regime. Sweep draft length and related settings across relevant batch sizes, then compare elapsed time and accepted advancement—not acceptance rate alone. A configuration that helps one workload can lose its benefit when drafting or verification competes with other requests.

Part V — Development and capacity

Serving developments

A serving design combines choices with different effects. Batch formation controls which work runs together; iteration scheduling controls when membership changes; state organization controls what occupies memory. No single setting resolves all three constraints.

Saved computation can become additional waiting. A larger batch or a useful prefix-cache hit matters only if the complete request still meets its delivery objective.

More retained state can avoid repeated work while reducing room for other sequences. Recomputation can therefore remain useful for short contexts or severe memory pressure.

Speculation changes how many tokens advance per target invocation. It still competes for arithmetic, memory and scheduling time with other requests, so a single-request benefit need not survive concurrent load.

Evaluate the combined policy under a matching workload and completion contract. Preserve the distinction between engine work, client-visible progress and safe resource reuse when interpreting a change.

Precision and resources

Numerical precision is a serving resource choice applied separately to weights, activations, and KV state. Lower-bit weight storage can reduce resident model bytes, but storage precision, computation precision, and device placement are independent. Some methods preserve higher precision for outliers; offloaded weights may use a wider format. Halving weight bytes therefore does not halve total serving memory or latency.

Cache precision

KV quantization targets a different allocation. KIVI, a February 2024 preprint later accepted at ICML 2024, used asymmetric two-bit quantization with a full-precision recent window. Its reported single-A100 experiment showed how reduced KV storage could permit larger batches and greater throughput, while quality varied by model, task, bit width, group size, and residual-window length. Fewer stored bytes can also add conversion overhead, so capacity gains do not independently establish latency gains.

Realized speed requires compatible arithmetic and kernels. In PyTorch's reported 2023 GPT-fast experiment, compilation and a static KV cache first exposed weight-loading bandwidth as the next constraint; supported int8 weight storage then improved the reported batch-one generation rate further. The point is bottleneck migration, not the historical numbers: changing coordination can expose bandwidth, and changing bytes can expose another limit. The numerical mechanisms of calibration, scales, outliers, and quantization-aware training belong in Quantization.

A comparison ledger

FieldWhy it must be reported
Weight format and bytesShows resident-model change
KV format and bytes per retained positionShows request-state change
Activation and workspace peakPrevents hidden capacity changes
Supported hardware and kernelsEstablishes whether lower precision accelerates execution
Latency and sustainable capacityMeasures operational consequence
Quality and completion behaviorDetects altered outputs rather than assuming equivalence

The capacity envelope

Capacity is an operating region, not a hardware label. Resident weights and runtime allocations consume memory before requests arrive. Each prompt adds prefill work and initial KV state. Each generated token adds another decode iteration and usually another retained position. Concurrency can improve reuse and batching while increasing contention and state. Arrival rate adds queueing when offered work approaches what the complete service can finish.

A consistency relation

L=λW L=\lambda W Little's Law relates the long-run average number of requests in a consistently bounded system, LL, to arrival rate λ\lambda and average residence time WW. If residence includes queueing and execution, occupancy must count requests across that same boundary. The relation is an accounting check under stability and finite averages; it neither predicts p99 latency nor rescues an overloaded queue.

Near saturation, completed throughput may flatten while queue residence and tail latency rise. Output tokens per second, requests per second, per-request token pace, and concurrent sequences therefore cannot substitute for one another. Prompt-heavy work emphasizes first-token delay and prompt processing; generation-heavy work spends more iterations retaining state; interactive service constrains onset and cadence; offline work can accept waiting to maximize completed volume.

Workload objectives

WorkloadPrimary concernCommon constraint to test
Interactive chatTTFT and output cadenceBatch formation, prompt interference, network delivery
Long generationCompletion time and state residencyDecode service rate and KV growth
Prompt-heavy processingFirst-token latency and prefill capacityPrompt length, chunking, and prefix reuse
Offline batchCompleted volume and total job durationLargest efficient batch under memory limits
Streaming voiceUseful response onset and concurrent streamsEntire audio pipeline, not text token rate alone

More memory can raise the number or length of active sequences without increasing a compute-limited token service rate. Conversely, faster arithmetic may leave capacity unchanged when KV storage or memory bandwidth is limiting. Admission policy must therefore reserve against both state and work. During severe overload, explicit rejection or a clearly exposed degraded mode is safer than silently accepting requests that cannot meet their contract.

Choose capacity within both latency objectives

Completed throughput (requests/s)06120714Offered requests / secondL2: 2; stable; qualifiesL4: 4; stable; qualifiesL6: 6; stable; qualifiesL8: 8; stable; excludedL10: 9; unstable; excludedL12: 11; errored; excludedp99 client TTFT (ms)080016000714Offered requests / secondL2: 80; stable; qualifiesL4: 140; stable; qualifiesL6: 260; stable; qualifiesL8: 520; stable; excludedL10: 1000; unstable; excludedL12: 1400; errored; excludedp95 request TPOT (ms/token)0501000714Offered requests / secondL2: 12; stable; qualifiesL4: 20; stable; qualifiesL6: 32; stable; qualifiesL8: 48; stable; excludedL10: 68; unstable; excludedL12: 90; errored; excluded

Filled circle: qualifies; larger circle: selected. Empty circle: misses an objective. Cross: invalid run. Dashed: chosen objective. L14 has unavailable measurements and is not plotted.

L6 selected: 6 completed requests/s at offered rate 6/s.
Offered /sSuccessful / 60sCompleted /sp99 TTFTp95 TPOTRun status / errorsDecision
2120280ms12ms/tokenstable / 0Qualifies
42404140ms20ms/tokenstable / 0Qualifies
63606260ms32ms/tokenstable / 0Selected
84808520ms48ms/tokenstable / 0Misses objective
1054091000ms68ms/tokenunstable / 0Invalid run
12660111400ms90ms/tokenerrored / 60Invalid run
14UnavailableUnavailableUnavailableUnavailableincomplete / unknownInvalid run
Dataset and measurement contract

Fictional sweep of one unchanged configuration and workload: 128-token prompts, 32-token outputs, periodic independent arrivals. Discard 30s warmup, then observe 60s. Throughput counts successful final-content completions inside that window divided by 60s. Every counted output passes the fixed task-quality check; errors are separate. p99 TTFT is over completed requests, from client send to first nonempty content. For each completed request, TPOT = (final-content time − first-content time) / 31; p95 is taken across those per-request averages. Valid runs require complete logs, zero errors and no positive queue-length trend over the final 30s. L10 is unstable, L12 has 60 errors, L14 has incomplete logs. Tied throughput selects the lower offered rate, then lexical run ID.

This fictional load sweep selects among fixed workload-specific operating points. Adjusting objectives changes qualification, never the measurements. Marginal latency percentiles cannot determine compliant requests per second or real hardware capacity.

Part VI — Measurement and decisions

Benchmark the workload

MLPerf Inference, introduced by Reddi and collaborators in a November 2019 preprint and presented at ISCA 2020, distinguished independently arriving server traffic under tail-latency limits from offline bulk throughput, with required output-quality targets. A serving benchmark is defined by its workload and execution contract, not just a model and accelerator. Record the exact model revision, tokenizer, chat template and complete serialization; hardware and topology; engine and runtime versions; weight and KV formats; scheduler, batch-token limits, and cache policy; sampling and stopping controls; prompt and output distributions; warmup and readiness; arrival process or concurrency; duration; observation boundaries; errors; completion accounting; and quality checks. Use completed-work timing and sweep the important workload range.

Open-loop and closed-loop load

Load modelIssuance ruleQuestion answeredFailure to expose
Open loopArrivals occur independently of prior completionsCan the service sustain an offered arrival rate under latency constraints?Delayed issuance and unfinished work must remain visible
Closed loopA client issues new work after earlier work completes while holding concurrencyWhat throughput and latency occur with this many active clients?A saturated load generator can silently cap offered demand

Separate unloaded single-request latency, bulk throughput, and the load sweep between them. Fixed input and output lengths can isolate execution behavior but do not represent production unless the real distribution is similarly fixed. Continuing beyond natural stop tokens controls length for a benchmark while changing ordinary completion behavior; disclose it. Likewise, raw single-batch engine throughput is not a serving result with in-flight batching, queueing, and transport.

The client and network are part of an endpoint measurement. Record client location, connection behavior, request-generation capacity, target and achieved arrival rates, and incomplete work. A benchmark client that cannot feed the server can make a fast deployment appear slow; a distant or buffered transport can dominate caller-visible TTFT even when model execution is fast. Match output length, completion status, and quality so shorter, refused, or failed responses are not counted as optimizations.

Locate the bottleneck

Diagnosis begins with a symptom conditioned on workload. Align queue depth, request lengths, batch composition, KV occupancy, preemptions, prefill and decode timing, accelerator activity, host gaps, transfers, client observations, cancellations, errors, and completion outcomes. A high utilization percentage does not identify whether compute units, memory bandwidth, host coordination, or another resource limits useful work.

Controlled sweeps

Change one variableObservationSupported hypothesis to investigate
Increase prompt lengthTTFT and prefill time rise; TPOT stablePrompt processing is consequential
Increase output lengthCompletion and KV residency riseDecode duration or cache growth matters
Increase offered rateQueue rises; completed throughput flattensService is near sustainable capacity
Increase active sequencesAggregate throughput rises but TPOT worsensBatching helps throughput while adding interference
Reduce cache budgetPreemption or admission failures increaseKV capacity constrains concurrency
Change precisionBytes fall but latency does notKernel support or another bottleneck dominates
Change speculative settingsAcceptance rises without elapsed-time gainDraft or verification overhead dominates

Expect bottleneck migration: relieving one constraint can make another resource determine useful work. Reducing resident weight bytes may permit more active sequences until KV capacity, scheduling, compute, or host coordination dominates. An external cache tier can add capacity yet stall accelerators if its reads and writes cannot keep pace. State what changed, what remained fixed, which resource signal moved, and whether the completion and quality contract still held.

Warm execution is not startup

Cold starts form another path. New capacity may require resource acquisition, container startup, transfer of model weights through host memory into accelerator memory, compilation or graph capture, and warmup before readiness. A system can have excellent warm-request latency yet fail to absorb a burst because replicas become useful too slowly. Measure startup stages separately from steady-state inference and test actual scaling events rather than inferring them from loaded-instance throughput.

Routing and reasoning budgets

Three adjacent responsibilities change the workload in different ways. A model-routing or gateway policy chooses a model or provider, escalation path, and failure fallback. A reasoning and test-time-compute policy chooses how many samples, search steps, verifications, or retries to request in pursuit of a better solution. Inference serving executes and measures every invocation those policies create.

Responsibility boundary

ResponsibilityDecisionOutputEvaluate by
RoutingWhere should this invocation run?Selected model, provider, or fallbackPolicy quality, compatibility, reliability, and total cost
Reasoning policyHow much solution work should be requested?Samples, search, verification, and stopping decisionsTask quality under a stated compute and latency budget
Inference servingHow should each invocation execute?Tokens, stream events, completion disposition, and resource usageLatency, throughput, capacity, correctness, and operational reliability

The boundaries compose but should not be collapsed. Re-querying a smaller model may be preferable to one larger-model call for a particular quality target, yet those repeated calls still consume requests, tokens, cache, and concurrency. Moving a predictable re-query into a router can remove client round trips and expose scheduling opportunities, but the quality gain belongs to the reasoning policy and the execution gain belongs to serving. Evaluate the resulting combined workload at matched task quality rather than describing additional computation as free.

Open questions

  1. Can generative-serving systems expose provider-neutral, observable state transitions for cancellation and resource reuse? A useful contract would let conformance tests distinguish a terminal request from accelerator work or allocations that remain in flight.

  2. How should schedulers optimize jointly for TTFT, token cadence, fairness, energy, and completed task quality under changing request distributions? Present policies usually prioritize only a subset, while sustained overload can make the objectives mutually infeasible. Progress would require workload-replay studies with explicit admission and degradation semantics, not only average throughput gains.

  3. When does KV compression improve end-to-end capacity after accounting for conversion work, quality changes, allocator behavior, and the batch sizes it enables? Results vary across models, tasks, formats, and recent-window policies. Progress would be reproducible, matched-quality load sweeps that report payload bytes, actual allocations, preemption, TTFT, TPOT, and completed throughput.

  4. Can speculative decoding remain beneficial under high continuous-batch pressure, where draft work and additional state compete with unrelated requests? Single-request acceptance rates do not answer this fleet-level question. Progress would connect accepted advancement to queueing, memory, fairness, and goodput across real prompt and output distributions.

  5. What bounded reproducibility contract is practical across engine upgrades, kernel changes, hardware revisions, and different batch compositions? Seeds control only part of execution, while exact outputs may not be necessary for every application. Progress would define useful levels—from distributional equivalence to stable state transitions—and publish the conditions each engine can enforce.

Follow the curated reading path through the speakers and demonstrations behind this entry.

Explore more talks

The rest of the library, beyond the curated path. Cited talks support this entry; reviewed transcripts were processed in full. Metadata candidates have not been reviewed as sources or verified as topic members.

152 matching talks

TalkSpeakerEventYear
Stephen Hood, Justine TunneyAI Engineer World's Fair 20242024
Ishan AnandAI Engineer World's Fair 20242024
Charles FryeAI Engineer Summit 20232023
Ishan AnandAI Engineer World's Fair 20252025
Daniel HanAI Engineer World's Fair 20242024
Kevin HouAI Engineer World's Fair 20242024
AI Engineering 101

Transcript reviewed

Noah HeinAI Engineer Summit 20232023
Aman KhanAI Engineer World's Fair 20252025
Sarah ChiengAI Engineer Europe 20262026
Mozhgan Kabiri ChimehAI Engineer Europe 20262026
Natalie SerrinoAI Engineer Code 20252025
Philip Kiely, Pankaj GuptaAI Engineer World's Fair 20242024
Allen PikeAI Engineer World's Fair 20262026
Jerry LiuAI Engineer Summit 20232023
Erik MeijerAI Engineer World's Fair 20262026
Elizabeth Fuentes LeoneAI Engineer World's Fair 20262026
Nupur SharmaAI Engineer Europe 20262026
Ben BurtenshawAI Engineer Europe 20262026
Compression at the Edge

Transcript reviewed

Chris Alexiuk, Daniel Han, Asma Beevi, Merve Noyan, Parth SareenAI Engineer World's Fair 20262026
Dylan PatelAI Engineer World's Fair 20242024
Nathan LambertAI Engineer World's Fair 20252025
Zhou YuAI Engineer Summit 20252025
Aakanksha ChowdheryAI Engineer World's Fair 20252025
Vivek MuppallaAI Engineer World's Fair 20262026
Alex CheemaAI Engineer Europe 20262026
Rémi LoufAI Engineer World's Fair 20242024
Luis Romero-SevillaAI Engineer World's Fair 20262026
Sai Krishna RallabandiAI Engineer World's Fair 20262026
Val Bercovici, Callan FoxAI Engineer Code 20252025
Tisha Chawla, Susheem KoulAI Engineer World's Fair 20262026
Julián Duque, Anush DSouzaAI Engineer World's Fair 20252025
Cassidy HardinAI Engineer Europe 20262026
Philipp KrennAI Engineer World's Fair 20252025
Amir HaghighatAI Engineer World's Fair 20252025
Lin Qiao, Dmytro (Dima) DzhulgakovAI Engineer World's Fair 20242024
Dan Fu, Olive SongAI Engineer World's Fair 20262026
Rishabh BhargavaAI Engineer Europe 20262026
Keegan McCallumAI Engineer World's Fair 20252025
Samuel HumeauAI Engineer Europe 20262026
Filip MakraduliAI Engineer World's Fair 20252025
Walden, Carter, Tanay, Alex Atallah, NavAI Engineer World's Fair 20262026
Sahil Yadav, Hariharan GanesanAI Engineer World's Fair 20252025
Dmytro (Dima) DzhulgakovAI Engineer World's Fair 20242024
Daniel Kim, Daria SobolevaAI Engineer World's Fair 20252025
Steve KorshakovAI Engineer World's Fair 20262026
Daniel HanAI Engineer World's Fair 20252025
Neil Dwyer, Jack DwyerAI Engineer World's Fair 20252025
Arjun Desai, Rohit TalluriAI Engineer World's Fair 20252025
Daniel HanAI Engineer World's Fair 20262026
Arek BoruckiAI Engineer World's Fair 20262026
Joseph NelsonAI Engineer Summit 20232023
Hamed Firooz, Maziar SanjabiAI Engineer World's Fair 20252025
Shelby HeineckeAI Engineer World's Fair 20242024
A Song of Types and Agents

Metadata candidate

Roberto StagiAI Engineer World's Fair 20262026
Sharmila Chokalingam, ShubhiAI Engineer World's Fair 20242024
Will Hang, Cathy ZhouAI Engineer Code 20252025
Kevin HouAI Engineer Summit 20252025
AGI: The Path Forward

Metadata candidate

Eiso Kant, Jason WarnerAI Engineer Code 20252025
Charles FryeAI Engineer Summit 20232023
Vibhor KumarAI Engineer World's Fair 20242024
Grace IsfordAI Engineer Summit 20252025
Sunny MadraAI Engineer World's Fair 20242024
Samuel DentonAI Engineer World's Fair 20262026
Varun Badrinath Krishna, Petro Junior Milan, Rachelle MatternAI Engineer World's Fair 20242024
Raj NavakotiAI Engineer Europe 20262026
Soumya Gupta, Jai ChopraAI Engineer World's Fair 20262026
Building Cursor Composer

Metadata candidate

Lee RobinsonAI Engineer Code 20252025
Eno ReyesAI Engineer World's Fair 20242024
Dan MasonAI Engineer World's Fair 20252025
Codex, Behind the Harness

Metadata candidate

Dominik KundelAI Engineer World's Fair 20262026
Jedrick Kosinski, ComfyAnonymousAI Engineer World's Fair 20252025
Yusuf OlokobaAI Engineer Code 20252025
Santosh RadhaAI Engineer World's Fair 20242024
Rhythm Garg, Linden LiAI Engineer Code 20252025
Ending AI Slop

Metadata candidate

Thais Castello BrancoAI Engineer World's Fair 20262026
Sayash KapoorAI Engineer Summit 20252025
Maxime LabonneAI Engineer Europe 20262026
Maxime LabonneAI Engineer World's Fair 20242024
Emma Ning, Tsavo KnottAI Engineer World's Fair 20252025
Omri Bruchim, Tomer AstAI Engineer World's Fair 20262026
Rachel Lee Nabors (RL Nabors)AI Engineer World's Fair 20262026
Alex AtallahAI Engineer World's Fair 20252025
Mike BursellAI Engineer World's Fair 20252025
Mithun HunsurAI Engineer Summit 20232023
Vasant KearneyAI Engineer World's Fair 20262026
How Deep Research Works

Metadata candidate

Mukund Sridhar, Aarush SelvanAI Engineer Summit 20252025
Vinoo GaneshAI Engineer World's Fair 20262026
Kwindla Hultman KramerAI Engineer World's Fair 20242024
Paul GilbertAI Engineer Summit 20252025
Kyle CorbittAI Engineer World's Fair 20252025
Hypermode Launch

Metadata candidate

Kevin Van GundyAI Engineer World's Fair 20242024
Nicolas SchlaepferAI Engineer World's Fair 20242024
Jake NationsAI Engineer Code 20252025
Gabriel Jorge MenezesAI Engineer World's Fair 20262026
AI Engineer Summit 20252025
Stefano FiorucciAI Engineer Europe 20262026
Rachelle Mattern, Petro Milan, Varun KrishnaAI Engineer World's Fair 20242024
Sally Ann O'MalleyAI Engineer Europe 20262026
Carter Abdallah, Vincent Weisser, Lucas Atkins, Chris AlexiukAI Engineer World's Fair 20262026
Joe FiotiAI Engineer World's Fair 20252025
Kelvin MaAI Engineer World's Fair 20252025
Matthias LoiblAI Engineer World's Fair 20252025
Pietro ZulloAI Engineer World's Fair 20262026
Liad Yosef, Ido SalomonAI Engineer Europe 20262026
Stefania DrugaAI Engineer World's Fair 20262026
Will BrownAI Engineer World's Fair 20262026
Alvaro MoralesAI Engineer World's Fair 20252025
Cedric VidalAI Engineer World's Fair 20242024
Ahmed MenshawyAI Engineer World's Fair 20242024
Frank CoyleAI Engineer World's Fair 20262026
Saoud RizwanAI Engineer World's Fair 20262026
Lech KalinowskiAI Engineer World's Fair 20262026
OpenLLMetry is all you need

Metadata candidate

Nir GazitAI Engineer Summit 20252025
Christopher HarrisonAI Engineer World's Fair 20252025
Yuval Belfer, Niv GranotAI Engineer World's Fair 20252025
Tengyu MaAI Engineer World's Fair 20252025
Idan GazitAI Engineer World's Fair 20262026
Adrien GrondinAI Engineer Europe 20262026
Scaling Compute on Context

Metadata candidate

Jack MorrisAI Engineer World's Fair 20262026
Alessandro CappelliAI Engineer Europe 20262026
Scaling to Long Horizons

Metadata candidate

Ross Taylor, Chengxi TaylorAI Engineer World's Fair 20262026
Merve NoyanAI Engineer Europe 20262026
Sarah GuoAI Engineer World's Fair 20252025
Nader Khalil, Alex Cheema, Matthew Berman, Ahmad Osman, Joseph NelsonAI Engineer World's Fair 20262026
Thiyagarajan MaruthavananAI Engineer World's Fair 20262026
Taylor Jordan SmithAI Engineer World's Fair 20252025
Rob CheungAI Engineer World's Fair 20242024
Devansh TandonAI Engineer World's Fair 20252025
Patrick DeboisAI Engineer World's Fair 20252025
Darius EmraniAI Engineer World's Fair 20252025
Travis FrisingerAI Engineer World's Fair 20252025
Beyang LiuAI Engineer World's Fair 20252025
Travis Bartley, Myungjong Kim, Byungjoong, JaehanAI Engineer World's Fair 20252025
Justin SchroederAI Engineer World's Fair 20262026
Kyle CorbittAI Engineer World's Fair 20242024
Dylan PatelAI Engineer World's Fair 20252025
Stefania DrugaAI Engineer World's Fair 20242024
Gorkem YurtsevenAI Engineer World's Fair 20252025
Jonathan MortensenAI Engineer World's Fair 20252025
Maxime Rivest, Isaac MillerAI Engineer World's Fair 20262026
Thinking Deeper in Gemini

Metadata candidate

Jack RaeAI Engineer World's Fair 20252025
Sangwu LeeAI Engineer World's Fair 20262026
Eric AllamAI Engineer World's Fair 20252025
Chris LattnerAI Engineer World's Fair 20242024
Hassan El MghariAI Engineer World's Fair 20252025
Matt DaileyAI Engineer World's Fair 20262026
Charles FryeAI Engineer World's Fair 20252025
Benjamin CowenAI Engineer Europe 20262026
Cormac BrickAI Engineer World's Fair 20262026
Philipp SchmidAI Engineer Europe 20262026
Ziv IlanAI Engineer Europe 20262026
Ramana Siddanth EmaniAI Engineer World's Fair 20262026

References

Coverage and source review
Processed transcripts
46 processed in full · 5 in the curated path
Automated source review
Passed
Metadata candidates
111 unreviewed; not verified topic membership
Corpus version
1bd8e407b26a07b33815594e1b2db5f41827119a2b3cb6fbf240f9fc571fc767

Automated review checks source support; it is not publication approval.

A synthesis of selected conference talks and technical references. Citations link to the source material; they do not imply that every talk on this subject is included.

  1. Chat templates — Transformers

    Chat roles and message contents are serialized into a token sequence using a model-specific template. Control tokens can mark message boundaries and speaker roles; even models derived from the same base can require different formats. A generation prompt marks the start of a new assistant response, while continuing a final message serves a different purpose. Templates already include necessary special tokens, so adding them again during a second tokenization step can duplicate boundaries and harm behavior. A chat API abstraction does not exempt the input from the underlying sequence format.

  2. vLLM scheduler: admission, preemption and abort cleanup

    The scheduler bounds running requests and scheduled tokens; waiting work is admitted only while those budgets and cache allocation permit. Cache pressure can preempt a running request back to waiting for later recomputation. finish_requests handles external completion signals such as client-disconnect aborts: it removes requests from running/waiting queues, marks their terminal status and initiates cleanup. Resource release can be delayed for remote KV transfers or an in-flight GPU step that may still write blocks. Cancellation is therefore a lifecycle transition, not proof of instantaneous resource reclamation.

  3. Metrics design — vLLM

    Serving telemetry distinguishes queue time, prefill, decode, time to first token, inter-token latency and end-to-end latency. Event boundaries and observation location matter: client network time differs from engine intervals. A successful finish reason does not establish task correctness. Request lengths, waiting/running requests and KV usage help explain a latency change.

  4. The Rise of Open Models in the Enterprise

    An open model, inference engine, and GPUs do not by themselves constitute production inference.

  5. Language Models are Unsupervised Multitask Learners

    A language model factorizes a sequence probability into conditional next-token probabilities: p(s1,...,sn) = product over i of p(si | s1,...,s(i-1)). Each factor is conditioned on the already chosen prefix; choosing a different token changes subsequent conditionals. Multiplying factors evaluates a complete path, so selecting the largest immediate factor need not select the most probable complete sequence. Tasks and input can themselves be represented as prefix symbols, allowing continuation without changing parameters. GPT-2 follows GPT with architecture modifications including normalization placement.

  6. Improving Language Understanding by Generative Pre-Training

    The original GPT uses a decoder-only Transformer: token and position embeddings pass through repeated masked self-attention and position-wise feed-forward blocks, followed by a vocabulary projection and softmax. The mask restricts a position to earlier context instead of attending to future tokens. Unlike the original encoder-decoder translation Transformer, this language model does not require a separate source encoder and encoder-decoder attention path. Training optimizes prediction of successive tokens; inference applies the learned parameters to the supplied sequence.

  7. Caching — Transformers v4.50.0

    The documented generation loop first passes the complete prepared prompt into the model and selects a token from the last position's logits. The next iteration passes only that selected token, together with retained KV state, an extended attention mask and an incremented cache position. Thus the first output selection follows prompt processing; processing that selected token produces the next output selection. Cache positions identify processed sequence positions and must remain consistent when reusing a prefilled cache.

  8. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    The illustrated inference loop has a prefill stage for the prompt followed by incremental decoding, with different computation shapes.

  9. Compute & System Design for Next Generation Frontier Models

    Prompt processing and token generation stress different resources: prefill is compute-intensive, while iterative decode is memory-bandwidth-intensive.

  10. GPU Performance Background User's Guide — NVIDIA

    GPU execution uses parallel processing units and a memory hierarchy. A simple performance model compares time to move the required bytes with time to perform the required arithmetic; with sufficient overlap, the slower term dominates. Arithmetic intensity is operations per byte accessed. Comparing it with the hardware's compute-to-bandwidth ratio helps identify a possible compute or memory bottleneck. But small workloads, insufficient parallelism, extra memory reads, and launch latency can invalidate the estimate. Changing batch size can change reuse and intensity, so model size and peak arithmetic throughput alone cannot predict request latency.

  11. Attention Pooling by Similarity — Dive into Deep Learning

    Attention compares a query with keys to obtain similarity scores. Normalized scores weight the associated values; summing those weighted values gives the query-dependent output. Keys determine addressing weights, while values supply the combined content. Equation 11.2.2 explicitly separates query, keys, and values. This explains why retaining both keys and values supports subsequent attention computations.

  12. Cache strategies — Transformers

    KV caches retain attention keys and values instead of recomputing past token projections at each generation step. Dynamic caches grow; static caches reserve a maximum shape, enabling compilation at a potential space/computation cost. Offloading trades accelerator memory for transfers to/from CPU. KV quantization reduces storage precision but may worsen latency when short contexts already fit. Sliding-window attention can cap cache growth in affected layers.

  13. Transformers: cache allocation versus retained history

    KV caches retain attention keys and values beyond model weights. DynamicCache grows as tokens arrive; StaticCache preallocates a maximum capacity, masking unused positions and potentially wasting memory and attention work on short sequences. Sliding-window or chunked layers stop growing at their retained-history limits even when the configured sequence capacity is larger. Offloading transfers most layer caches through CPU memory; quantized caches reduce precision but can increase latency for short contexts. Operational inference: allocated slots are a storage decision, not evidence that the model supports that many sequence positions. For ordinary full-history static caching, reserve sufficient slots for prompt plus intended output while independently enforcing the model's supported context limit. Windowed cache capacity must instead follow the architecture's retention rules.

  14. Mastering LLM Techniques: Inference Optimization — NVIDIA

    For the illustrated conventional multi-head cache, storage per retained token is twice the layer count times the cached head dimensions times bytes per value; the factor two represents keys and values. Total storage also scales with retained sequence positions and batch size. The published Llama 2 7B example uses 32 layers, width 4096, 4096 positions and two-byte values: 2,147,483,648 bytes, or 2 GiB, for one sequence's KV tensors. Model weights occupy a separate allocation.

  15. vLLM memory profiling: allocations and transient peaks

    vLLM distinguishes memory outside its instance, PyTorch-controlled allocations inside it, and its allocations outside PyTorch. The profiling example separates model weights, transient activation tensors, NCCL memory and attention-backend buffers. Snapshots record current and peak framework allocations and device free memory; reserved framework memory differs from live allocated tensors. Non-KV demand includes persistent consumption and headroom for transient peaks, rather than weight bytes alone. Workspace and communication buffers can therefore reduce cache capacity even when the weights fit.

  16. GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints

    Grouped-query attention divides query heads into groups, each sharing one key head and one value head. Multi-query attention uses one such group; conventional multi-head attention has separate key and value heads for every query head. Consequently, cache storage follows the number of KV heads, not necessarily the number of query heads. Google's GQA paper, published at EMNLP 2023, investigated this intermediate design to reduce cache capacity and bandwidth requirements while avoiding some quality losses associated with collapsing every query head onto a single KV pair.

  17. vLLM GPU worker: profiling available KV capacity

    The GPU worker profiles a model forward pass and, when configured, estimates CUDA-graph memory separately. Its available KV-cache budget subtracts profiled non-KV consumption and the applied graph estimate from requested memory. Later warmup compares actual graph-pool use with its estimate and reserves additional headroom in suggested allocations. This connects weights, activations, runtime buffers and graph storage to the space left for request state. An explicit cache-byte override skips normal capacity inference and requires a suitable value.

  18. Automatic prefix caching — vLLM

    A repeated shared token prefix can reuse stored KV state and skip computation for that prefix. Stable initial context favors reuse; unrelated prefixes cannot share those computations merely because their meaning is similar. The benefit is in prefill, not generating new decode tokens, so long outputs may limit the fraction of request latency saved.

  19. Automatic Prefix Caching — vLLM v0.14.1

    vLLM identifies reusable full KV blocks using the parent block's hash, exact tokens in the current block and additional identifiers such as LoRA adapter IDs, multimodal input hashes and cache salts. Including preceding-block identity prevents an identical suffix from being mistaken for equivalent context. Image placeholders alone are insufficient: image content contributes a separate hash. An optional salt enters the first block's identity, restricting reuse to requests with the same salt.

  20. vLLM block pool: reference counts and reusable cache blocks

    Cache blocks carry reference counts. Reusing a cached prefix increments the count and removes a zero-reference block from the free queue. Releasing request-owned blocks decrements counts; only zero-reference, non-null blocks enter reusable queues. A block still referenced by another request is therefore not made available for overwrite merely because one request finishes. Cached zero-reference blocks may remain available for prefix reuse until eviction; releasing ownership is distinct from immediately erasing cached contents.

  21. Efficient Memory Management for Large Language Model Serving with PagedAttention

    PagedAttention divides per-request key-value state into fixed-size blocks that need not occupy contiguous memory. Blocks are allocated as needed, reducing reserved space and fragmentation, and can be shared where sequences reuse the same attention state. This is storage organization for KV tensors, not a semantic response cache. The paper also separates parallel processing of known prompt tokens from sequential generation of new tokens: each new choice conditions subsequent predictions, while cached earlier keys and values avoid recomputation. Iteration-level scheduling lets completed requests leave and new requests join between decode steps.

  22. AIPerf Metrics Reference

    AIPerf measures TTFT from request start to the first nonempty content response. Its metric named ITL is a per-request average: (request latency minus TTFT)/(output sequence length minus one), requiring at least two output tokens. It separately measures inter-chunk arrival gaps. The displayed request-latency formula ends at the last content response, so it does not independently establish a later terminal-event timestamp. Goodput counts requests satisfying configured SLOs per benchmark second; successful requests and errors have separate counters.

  23. GenAI-Perf: latency and throughput measurement

    GenAI-Perf defines TTFT as first-response receipt minus request-send time, and request latency as final-response receipt minus send time. Its inter-token latency divides the interval between successive responses by the latter response's generated-token count. Output-token throughput is total generated tokens divided by benchmark duration; request throughput is final responses divided by duration. A p99 latency is the 99th percentile of the specified latency observations, not an average. The tool supports concurrency, request rate, warmup count, measurement intervals, and input/output-length controls. Reproducible comparisons must report those settings and the workload/tokenizer.

  24. Utilities for Generation: TextStreamer and TextIteratorStreamer

    Transformers streamers receive generated token IDs and decode them for delivery. TextStreamer buffers until text forms complete words; end() flushes remaining cached text. TextIteratorStreamer instead puts printable text in a queue for a downstream consumer, with a configurable queue timeout for separately threaded generation. Thus a generation step, decoded text fragment and consumer observation are distinct events; one delivered fragment need not equal one token. Incremental delivery can expose a prefix before generation finishes.

  25. Module ngx_http_proxy_module — nginx

    With response buffering enabled, nginx reads upstream responses into memory buffers and can spill excess data to temporary files. With buffering disabled, it passes data onward as it receives it instead of attempting to read the whole response. An upstream X-Accel-Buffering header can control this behavior unless configuration ignores that header. A streaming model endpoint therefore has a separate proxy-delivery policy between generated output and the client.

  26. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    Measure first-token latency, inter-token latency, and completion latency under load, with request length and token position as explanatory variables.

  27. Batchers — NVIDIA Triton Inference Server

    Triton's dynamic batcher can briefly delay dispatch so additional requests join a batch. It dispatches when a suitable batch forms or the configured formation delay expires. The documentation explicitly treats increased batch size or delay as possible throughput gains purchased with additional latency. Separate queue policies configure maximum queue size and timeout actions, including rejection or deferral. Priority levels let higher-priority requests bypass lower-priority ones.

  28. AI Engineering 201: Inference

    Interactive services should choose batching and caching around their actual bottleneck and latency budget; throughput-only jobs can favor larger batches.

  29. Clipper: A Low-Latency Online Prediction Serving System

    Published at NSDI in March 2017, Berkeley's Clipper addressed the mismatch between interactive prediction requests and frameworks optimized for batch execution. Its batching layer grouped incoming queries to amortize RPC and framework overhead and expose data-parallel work. Separate queues adapted their maximum batch sizes to each model container's latency profile. The implemented controller increased batch size until batch evaluation exceeded the latency objective, then reduced it. This made the latency-throughput tradeoff an explicit serving decision before modern autoregressive LLM scheduling.

  30. Continuous batching — Transformers

    Continuous batching schedules generation work at iteration granularity, allowing completed requests to leave and new requests to enter without waiting for every sequence in a fixed batch to finish. This makes variable sequence lengths important to serving utilization. Scheduling still has to respect available memory and latency constraints.

  31. Orca: A Distributed Serving System for Transformer-Based Generative Models

    Orca, published at OSDI in July 2022 by researchers from Seoul National University and FriendliAI, addressed generative requests requiring different numbers of model iterations. The systems it examined retained fixed batch membership until the whole batch finished, wasting work on completed sequences and delaying new arrivals. Orca returned control to the scheduler after each iteration so it could recognize completion and select a new request set. Its published unequal-length example makes the idle-work problem concrete. Batching also allowed requests to reuse model parameters fetched from device memory.

  32. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    In-flight batching admits replacement requests without waiting for the entire active batch to finish.

  33. Compute & System Design for Next Generation Frontier Models

    Continuous batching admits new requests while existing requests are still generating, helping a shared inference service maintain economical batch sizes.

  34. Google SRE: Handling Overload

    Admission controls and per-customer quotas limit resource consumption so one workload does not exhaust shared capacity. Resource usage can be a better capacity signal than requests per second because requests vary in cost. Graceful degradation reduces work by returning less complete results or using cheaper, potentially stale cached data. Client-side throttling can prevent rejected requests from consuming backend resources. Under extreme overload, even degraded computation may be impossible and explicit errors are necessary.

  35. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving

    DistServe frames serving capacity around request rate subject to both TTFT and TPOT objectives and an explicit attainment target. Its 13B-model experiment compares decode-only batches with batches containing one additional prefill job: prompt work delays continuing generation, with stronger interference for longer prompts. The paper distinguishes execution time from latency that also includes queueing. Chunking prompt work reduces long decode stalls but can add repeated KV reads and prompt-processing overhead.

  36. Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve

    Sarathi-Serve's July 2024 paper studied how prompt work interrupts ongoing generation. Its linear-layer measurements showed that adding tokens initially changed execution time little in a bandwidth-limited regime, then increased time after computation became limiting. Chunked prefills used that available compute within bounded batches. Smaller chunks reduced decode interference but increased repeated reads of earlier chunks' KV state and fixed execution overhead. Evaluation used conversation and summarization length traces with generated Poisson arrivals, separate latency targets, and a queue-delay limit when determining sustainable load.

  37. Optimization and tuning — vLLM

    Prefill processes prompt tokens; decode generates continuations incrementally. Chunked prefill splits long prompt processing so a scheduler can mix it with decode work. In the documented scheduler, decode is prioritized and remaining token budget admits prefill chunks. Smaller batch-token budgets can improve inter-token latency, while larger ones can improve time to first token and throughput. Insufficient KV space can force preemption and recomputation.

  38. Fast Distributed Inference Serving for Large Language Models

    FastServe explores preemption between output-token iterations to reduce head-of-line blocking, where an earlier long request delays later work. Because output length is unknown, it uses multiple priority queues and measured execution characteristics rather than assuming exact remaining duration. Jobs that consume their allotted service move downward; sufficiently delayed jobs are promoted to mitigate starvation. Preemption leaves pending requests' KV state to manage: retaining it consumes accelerator memory, recomputing it costs work, and moving it to host memory costs transfers. FastServe overlaps anticipated transfers with other requests' execution.

  39. Dream Machine: Scaling to 1m users in 4 days — Keegan McCallum, Luma AI

    Use product-defined service-level objectives to age jobs, then rank urgency by the fraction of each job's SLO already consumed.

  40. Hacking the Inference Pareto Frontier

    Route using both reusable prefix state and current worker load; maximizing KV match alone can increase queueing.

  41. DistServe: Disaggregating Prefill and Decoding for Goodput-optimized Large Language Model Serving

    DistServe assigns prefill and decoding to separate instances, each maintaining model weights. Prefill produces the first token and transfers KV state to the decoding instance. This separates phase optimization but introduces communication whose overhead depends on state size, bandwidth and placement.

  42. Generation — Transformers

    Generation settings control how next-token scores become a sequence. Greedy decoding chooses a highest-scoring next token, while sampling draws from a probability distribution. Temperature modifies that distribution; top-k retains a fixed number of highest-probability tokens, while top-p retains the smallest high-probability set whose cumulative mass reaches a threshold. These controls affect token selection rather than verifying the meaning of the answer. Output limits count generated tokens separately from prompt tokens, and stop strings or end-of-sequence behavior define other completion boundaries.

  43. The Curious Case of Neural Text Degeneration

    Holtzman, Buys, Du, Forbes, and Choi introduced nucleus sampling in an April 2019 preprint, published at ICLR 2020, to address repetition from likelihood-maximizing decoding and incoherence from unrestricted sampling in tested open-ended generation. At each step, top-p selects the smallest highest-probability token set whose cumulative mass reaches p, renormalizes probabilities within that set, and samples one token; the set size changes with the distribution.

  44. Hugging Face: autoregressive decoding and temperature sampling

    Autoregressive sequence probability factors as P(y|x)=product_t P(y_t|x,y_<t). Greedy decoding selects the highest-probability next token; sampling draws a token from the distribution. Temperature rescales logits: p_i(T)=exp(z_i/T)/sum_j exp(z_j/T), for T>0. Lower temperature concentrates probability on high-scoring tokens; higher temperature flattens it. As T approaches zero, sampling concentrates on maximizers, matching greedy choice when the maximum is unique. Top-k and top-p additionally restrict and renormalize candidate probabilities. Different random draws can change a token and therefore every subsequent conditional distribution, even with the same prompt and weights. Generation sampling chooses output tokens; telemetry sampling chooses which execution records to retain.

  45. Transformers v4.50.0 GenerationMixin implementation

    The default processor construction applies enabled temperature, top-k and top-p controls in that order, only when sampling is enabled. The generation loop then applies softmax to processed scores and samples; its greedy branch instead takes argmax. Thus these controls form an ordered transformation of the candidate distribution rather than interchangeable settings.

  46. Reproducibility — vLLM

    vLLM does not guarantee reproducible outputs by default. Its documentation distinguishes controlling random-number generators with a seed from controlling scheduling effects. Offline execution can use deterministic scheduling or supported batch-invariant execution; online execution requires batch invariance for the documented reproducibility path. Even with these controls, the stated reproducibility boundary requires the same hardware and vLLM version.

  47. Your Agent Failed in Prod. Good Luck Reproducing It.

    A deterministic token-selection rule does not guarantee stable model outputs or correct reasoning.

  48. vLLM incremental detokenizer implementation

    When stop strings must be excluded from streamed text, vLLM's detokenizer withholds a suffix whose length is the longest stop string minus one character. It checks incrementally decoded text for stops and truncates returned text when a match requires it. On completion, the ordinary holdback is removed. The implementation can retain a terminating token in output token IDs while excluding it from text reconstruction. Generated-token accounting and delivered text therefore need not describe identical content.

  49. Structured model outputs: supported contracts and incomplete responses

    The API distinguishes structured response formats from function calling. Structured Outputs supports a subset of JSON Schema, and unsupported schemas can be rejected. Applications must inspect completion status and handle refusals or output-token exhaustion rather than blindly treating every response as a completed record. The guide also states that schema-conforming outputs can contain mistakes. Streaming lets consumers process generated structure incrementally but does not make a partial prefix an authorized or semantically validated action.

  50. Backpressuring in Streams — Node.js

    Backpressure coordinates a producer with a slower consumer so queued output does not grow without control. In Node.js streams, a writable stream returning false signals that the producer should stop writing until a drain event. Piping connects these signals to pause and resume the readable source. Ignoring the signal permits additional buffering, increasing memory demand and garbage-collection work.

  51. Fast Inference from Transformers via Speculative Decoding

    Google's speculative-decoding work appeared as a November 2022 preprint and at ICML 2023. It sought acceleration without retraining the target or changing its output distribution, using spare computation when bandwidth limited execution. Its sampling argument treats temperature, top-k, nucleus and greedy policies as adjusted distributions; correction must use those intended distributions. The performance analysis separates accepted output from draft cost and wasted verification work. More arithmetic can still reduce elapsed time by reducing serial target executions and repeated weight or cache reads.

  52. Accelerating Large Language Model Decoding with Speculative Sampling

    A draft model proposes a short token sequence; the target scores its conditional distributions in parallel. Accept proposals left to right with probability min(1, target probability / draft probability). Keep the accepted prefix. At the first rejection discard that proposal and later draft tokens, and sample a replacement from the normalized positive part of target minus draft probabilities. If every proposal passes, sample an additional target token. Repeat from the emitted prefix. This recovers the target distribution within numerical precision; it does not guarantee identical samples. Draft overhead, rejected work and verification cost determine acceleration.

  53. Transformers v4.50.0 assisted-generation implementation

    Assisted generation appends and streams only the valid continuation after checking proposals. It then crops target KV state to the committed sequence length minus one, discarding state belonging to unused proposals. Greedy matching and stochastic speculative sampling follow distinct selection branches. Proposed tokens therefore are not all delivered output.

  54. Introduction to LLM serving with SGLang

    Benchmark combinations of drafting steps, top K and draft-token count across relevant batch sizes, then choose using measured speed and acceptance.

  55. How do I benchmark an LLM engine? — Modal

    Modal's published benchmark methodology first probes single-request latency and bulk throughput, then sweeps independent request-arrival rates between those operating points while collecting latency. Bulk completion throughput is not treated as an interactive latency result. The methodology specifies model, quantization and input/output lengths. It also discloses continuing generation beyond stop tokens to control output length, explicitly recognizing that this differs from ordinary use. Its natural-language workload is not interchangeable with code because content can affect speculative acceptance.

  56. Bitsandbytes — Transformers

    Weight quantization replaces some ordinary linear layers with lower-bit representations and supporting arithmetic to reduce model storage. The documented 8-bit method retains higher precision for sensitive outlier computations; 4-bit storage can use a different compute dtype. Not every module must be quantized, and the documented CPU offload path stores offloaded weights in float32. Storage precision, computation precision, device placement, and total serving memory are separate choices. Dequantizing into a wider dtype does not necessarily recover information lost during quantization.

  57. KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cache

    Liu et al.'s February 2024 preprint, later accepted at ICML 2024, treated KV precision as a serving-capacity choice. KIVI quantizes keys per channel and values per token while retaining a full-precision recent window. In the paper's single-A100 Llama-2-7B experiment, lower KV storage enabled larger batches and higher throughput, while task evaluations showed that quality effects varied by model, task, bit width, group size, and residual-window length.

  58. Accelerating Generative AI with PyTorch II: GPT, Fast

    PyTorch's November 2023 report describes a batch-size-one, 7B-model optimization experiment on an A100 with 80 GB memory and a 330 W power limit. Its initial trace showed host overhead leaving gaps between GPU operations. Compilation with a static KV cache increased reported generation throughput from 25.5 to 107 tokens per second; the authors then identified weight-loading bandwidth as the dominant constraint. Adding supported int8 weight storage increased the reported rate to 157.4 tokens per second. This is a concrete example of one intervention exposing a different bottleneck.

  59. A Proof for the Queuing Formula: L = λW — John D. C. Little

    Little's 1961 paper supplied a general proof for a queueing relation previously justified heuristically or for more restricted queues. It connects mean occupancy, arrival rate and mean residence time without requiring a particular service distribution or first-come-first-served order. Its argument relates the area under the occupancy curve to accumulated residence times, accounting for items crossing observation boundaries. This explains why the relation concerns consistent long-run accounting rather than an LLM-specific performance law.

  60. Notes on Little's Law — Karl Sigman

    Little's Law relates the long-run average number of items in a system to arrival rate multiplied by average residence time: L = lambda W. Sigman's sample-path formulation defines residence from entry to departure and states conditions requiring finite limiting arrival rate and average residence time. The chosen system can include waiting and service together or only one region. Consequently, concurrency, arrival rate and latency must refer to matching boundaries; average active execution cannot be substituted for all requests when residence time includes queueing.

  61. High-performance LLM inference — Modal

    Modal distinguishes bulk work such as database backfills, where individual results are not awaited interactively, from chatbot requests with a waiting user. Bulk work emphasizes completed volume and overall job duration; interactive work emphasizes response latency. Bursty workflows can combine both requirements. Starting a new serving replica introduces a separate latency path: resource acquisition, machine and container startup, loading model weights, and possible compilation or graph capture. These costs differ from executing requests on an already initialized replica.

  62. From model weights to API endpoint with TensorRT-LLM

    Measure streaming responsiveness separately from aggregate GPU throughput, then choose trade-offs for the application.

  63. Optimizing inference for voice models in production

    Once generation sustains real-time playback, prioritize startup latency and concurrency rather than maximizing tokens per second.

  64. Model Configuration — NVIDIA Triton Inference Server

    Some inference backends defer initialization until their first requests, making those requests slower despite the model already being loaded. Triton's ModelWarmup configuration runs specified inference requests against each model instance before exposing it as ready. Readiness therefore can include successful warmup rather than merely locating or loading the model. Warmup behavior varies by backend and adds time to making an updated model available.

  65. MLPerf Inference Benchmark

    Reddi and 46 coauthors presented MLPerf Inference as a cross-organization benchmarking method in a November 2019 preprint and at ISCA 2020. Its initial suite separated server traffic, where independent Poisson arrivals were scored by sustainable queries per second under a tail-latency bound, from offline work, where all inputs were available and throughput was measured without a latency constraint. It also required model-quality targets, showing that performance comparisons need a workload scenario, latency contract, and acceptable output behavior.

  66. MLPerf LoadGen: independent arrivals and explicit overload termination

    The Server scheduler derives each arrival from test-start time plus a precomputed offset, rather than waiting for the preceding response. It retains that scheduled time even if issuance is late. In contrast, the SingleStream scheduler waits for prior completion before issuing another query. When a configured outstanding-query threshold is exceeded, the Server controller logs an error and ends early rather than silently treating reduced offered load as successful service. Optional coalescing combines overdue queries but retains scheduling accounting.

  67. MLPerf LoadGen: arrival distribution and completion latency

    LoadGen's Server scenario draws exponentially distributed interarrival times, representing a Poisson arrival process at a chosen rate. Each query records its scheduled timestamp separately from actual issuance. Completion latency is measured from scheduled arrival to completion, while trace fields distinguish issue delay from issue-to-done time. Delayed issuance therefore remains visible instead of disappearing when latency starts only after a slow generator finally sends the request. Completion counters also track outstanding work.

  68. From model weights to API endpoint with TensorRT-LLM

    Raw single-batch throughput and serving performance with in-flight batching are different benchmark targets.

  69. From model weights to API endpoint with TensorRT-LLM

    Endpoint measurements include network effects, and the load generator itself can become a bottleneck.

  70. Context Platform Engineering to Reduce Token Anxiety — Val Bercovici and Callan Fox, WEKA

    A useful token-storage tier needs sufficient capacity plus fast writes and reads; capacity alone cannot prevent GPU stalls.

  71. AI Engineering 201: Inference

    Loading model weights into accelerator memory can turn a memory-transfer constraint into a cold-start latency problem.

  72. Hacking the Inference Pareto Frontier

    The speaker reports that repeated reconsideration by a smaller model can approach a larger model's quality while retaining a cost advantage.

  73. A Taxonomy for Next-Generation Reasoning Models

    The proposed taxonomy separates skills, calibration, strategy, and abstraction so that training work can target distinct capability gaps.

  74. Hacking the Inference Pareto Frontier

    Moving repeated calls into the router and exposing repetition to the scheduler can reduce workflow latency beyond disaggregation alone.

  75. From model weights to API endpoint with TensorRT-LLM

    Batch-size effects can have sharp latency changes and eventually encounter GPU-memory limits.

  76. Mastering LLM Inference Optimization: From Theory to Cost-Effective Deployment

    Measure the joint distribution of input and output lengths instead of sizing from a single benchmark pattern or advertised context limit.