KV Cache Architecture

The KV cache is service state governing routing, isolation, reuse, and recovery—not merely a memory optimization.

Design block lifecycle, prefix reuse, tiered storage, eviction, and tenant boundaries around the workload.

§ 01

Problem definition

The operating conditions that justify KV Cache Architecture

As context and concurrency grow, cache fragmentation and eviction can bottleneck before compute.

Routing for reuse may worsen tenant isolation and tail latency.

  • Long prefixes or system prompts repeat across requests
  • Memory pressure and recomputation are material under long-context concurrency
  • Requests are mostly short and non-repeating
  • Cache keys and tenant isolation policy cannot be defined
PLATE 01

KV Cache Architecture: system plate

  1. 01

    State 1

    Trace per-request cache occupancy, prefix duplication, and lifetime distributions.

  2. 02

    State 2

    Define an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.

  3. 03

    State 3

    Measure bandwidth and recomputation break-even points across GPU, host, and remote tiers.

  4. 04

    State 4

    Validate isolation with failures including cache poisoning and cross-tenant leakage.

FEEDBACKFailed acceptance returns evidence to the first controlled stage: Prefix hit rate and recompute reduction.

A decision and validation view for KV Cache Architecture; labels describe architecture, not a measured deployment result.
  1. The workflow begins with Trace per-request cache occupancy, prefix duplication, and lifetime distributions..
  2. It reaches an acceptance decision through Prefix hit rate and recompute reduction.

§ 03

Design method

Fix the boundary and acceptance criteria before implementation.

The KV cache is service state governing routing, isolation, reuse, and recovery—not merely a memory optimization.

  1. 01

    Stage 1

    Trace per-request cache occupancy, prefix duplication, and lifetime distributions.

    Review artifact 1
  2. 02

    Stage 2

    Define an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.

    Review artifact 2
  3. 03

    Stage 3

    Measure bandwidth and recomputation break-even points across GPU, host, and remote tiers.

    Review artifact 3
  4. 04

    Stage 4

    Validate isolation with failures including cache poisoning and cross-tenant leakage.

    Review artifact 4

§ 04

Application scenarios

Hypothetical workloads make the applicability boundary concrete.

Hypothetical application scenario

Long prefixes or system prompts repeat across requests

As context and concurrency grow, cache fragmentation and eviction can bottleneck before compute.

APPROACH
Trace per-request cache occupancy, prefix duplication, and lifetime distributions.
BOUNDARY
A higher hit rate does not always mean lower end-to-end latency.
Hypothetical application scenario

Memory pressure and recomputation are material under long-context concurrency

Routing for reuse may worsen tenant isolation and tail latency.

APPROACH
Define an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.
BOUNDARY
Sensitive prefixes prioritize isolation over reuse.

§ 05

Design choices

Review gains and costs in the same table.

DecisionGainCostWatch
Long prefixes or system prompts repeat across requestsTrace per-request cache occupancy, prefix duplication, and lifetime distributions.A higher hit rate does not always mean lower end-to-end latency.Prefix hit rate and recompute reduction
Memory pressure and recomputation are material under long-context concurrencyDefine an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.Sensitive prefixes prioritize isolation over reuse.Cache occupancy, eviction, and fragmentation
PLATE 02

KV Cache Architecture: system plate

Client boundaryLong prefixes or system prompts repeat across requests
  • As context and concurrency grow, cache fragmentation and eviction can bottleneck before compute.
  • A higher hit rate does not always mean lower end-to-end latency.
PattyTrace per-request cache occupancy, prefix duplication, and lifetime distributions.
  • Define an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.
  • Prefix hit rate and recompute reduction
AcceptanceCache occupancy, eviction, and fragmentation
  • Tail latency and isolation
  • Sensitive prefixes prioritize isolation over reuse.
A decision and validation view for KV Cache Architecture; labels describe architecture, not a measured deployment result.
  1. The workflow begins with Trace per-request cache occupancy, prefix duplication, and lifetime distributions..
  2. It reaches an acceptance decision through Prefix hit rate and recompute reduction.

§ 07

Validation plan

Agree on measurement conditions before publishing a result.

MeasureMethodPass conditionCaveat
Prefix hit rate and recompute reductionTrace per-request cache occupancy, prefix duplication, and lifetime distributions.Repeated runs satisfy the acceptance threshold agreed during discoveryA higher hit rate does not always mean lower end-to-end latency.
Cache occupancy, eviction, and fragmentationDefine an explicit lifecycle for block allocation, reference, replication, eviction, and recovery.Repeated runs satisfy the acceptance threshold agreed during discovery
Tail latency and isolationMeasure bandwidth and recomputation break-even points across GPU, host, and remote tiers.Repeated runs satisfy the acceptance threshold agreed during discovery

§ 08

Constraints and failure conditions

Conditions for not applying the capability are part of the design.

Requests are mostly short and non-repeating

A higher hit rate does not always mean lower end-to-end latency.

Cache keys and tenant isolation policy cannot be defined

Sensitive prefixes prioritize isolation over reuse.

§ 10

Durable deliverables

Artifacts remain with the operating organization after the engagement.

KV Cache Architecture decision record
The KV cache is service state governing routing, isolation, reuse, and recovery—not merely a memory optimization.Client-owned · Patty-reviewed
Validation harness and acceptance criteria
Prefix hit rate and recompute reduction · Cache occupancy, eviction, and fragmentation · Tail latency and isolationJointly maintained
Operations and recovery runbook
A higher hit rate does not always mean lower end-to-end latency. · Sensitive prefixes prioritize isolation over reuse.Operating-team owned

§ 11

Terminology

Use shared terms with explicit operating meaning.

KV Cache Architecture
Design block lifecycle, prefix reuse, tiered storage, eviction, and tenant boundaries around the workload.
Acceptance criterion
Prefix hit rate and recompute reduction
Operating boundary
A higher hit rate does not always mean lower end-to-end latency.

REFERENCES

References and primary material

  1. PagedAttention

    Primary material for the method and terminology.

  2. vLLM Automatic Prefix Caching

    Primary material for the method and terminology.

Begin by determining whether KV Cache Architecture is the justified next step.

We define scope and validation against representative work, data and infrastructure boundaries, and explicit failure conditions.

Request a technical review