AI systems and hardware planning · AI infrastructure

LLM KV cache memory estimate

Estimate key-value cache storage for a transformer workload from batch size, sequence length, layers, hidden size, and bytes per value.

Published · R0

Method and scope

KV bytes ≈ batch × sequence length × 2 × layers × hidden size × bytes per value.

Use llm kv cache memory estimate for educational calculation or a clearly scoped arithmetic estimate. Intended for Learners, General educational use.

Inputs
  • Batch size — 1
  • Sequence length — 1
  • Transformer layers — 1
  • Key/value hidden size — 1
  • Bytes per cached value — 1
SOURCE AND LIMITS

Assumptions: The architecture stores one key and one value vector per layer, token, and batch item. Hidden size represents the relevant key/value width and the same precision is used throughout.

Limitations: Grouped-query, multi-query, sliding-window, quantized, and hybrid architectures can use materially different memory.

Method version 1.0.0 · Unit registry and result provenance are shown after calculation. This tool is limited to the documented scope.
← Back to formula calculators
SAVED ON THIS DEVICE

Calculation history

History stays in this browser profile. Avoid saving sensitive information on a shared device.

ORIGINAL SAVED RESULT

Calculation

AuraCalc note