{
  "schema_version": "1.0.0",
  "record_id": "dn-next42-20261205-q15",
  "record_version": "1.0.0",
  "title": "The memory budget behind a long AI conversation",
  "canonical_url": "https://decentralised.news/ai-kv-cache-context-concurrency-memory-budget-2027",
  "evidence_type": "documentary_analysis_with_synthetic_worked_example",
  "source_review_date": "2026-12-05",
  "last_verified_utc": null,
  "observation_window": null,
  "methodology_url": "https://decentralised.news/ai-kv-cache-context-concurrency-memory-budget-2027",
  "methodology_version": "1.0.0",
  "input_schema": {
    "columns": [
      "scenario",
      "layers",
      "kv_heads",
      "head_dimension",
      "bytes_per_component",
      "context_tokens",
      "sessions",
      "cache_bytes_per_session",
      "total_cache_gib",
      "synthetic"
    ],
    "rows_file": "https://decentralised.news/data/dn-next42-20261205/v1/q15.csv"
  },
  "units": {
    "definition": "Units are named in the CSV columns, manuscript and calculation labels. Do not combine quantities without resolving their dimensions."
  },
  "sources": [
    {
      "id": 1,
      "title": "Efficient Memory Management for Large Language Model Serving with PagedAttention",
      "url": "https://arxiv.org/abs/2309.06180",
      "reviewDate": "2026-12-05",
      "supports": "The paper identifies dynamically growing KV-cache memory and fragmentation as constraints on serving; no experimental speedup is imported.",
      "evidenceType": "Research paper abstract"
    },
    {
      "id": 2,
      "title": "vLLM: Optimization and tuning",
      "url": "https://docs.vllm.ai/en/latest/configuration/optimization/",
      "reviewDate": "2026-12-05",
      "supports": "KV-cache allocation competes with other device memory; insufficient cache can cause preemption and recomputation.",
      "evidenceType": "Official implementation documentation"
    },
    {
      "id": 3,
      "title": "Hugging Face Transformers: KV cache strategies",
      "url": "https://huggingface.co/docs/transformers/en/kv_cache",
      "reviewDate": "2026-12-05",
      "supports": "Dynamic caches grow with sequence length; sliding-window layers, offloading and quantized caches change memory tradeoffs.",
      "evidenceType": "Official implementation documentation"
    }
  ],
  "calculations": [
    {
      "label": "Cache bytes per retained token",
      "expression": "2*32*8*128*2",
      "expected": 131072
    },
    {
      "label": "Short session GiB",
      "expression": "131072*8192/(1024**3)",
      "expected": 1
    },
    {
      "label": "Long session GiB",
      "expression": "131072*32768/(1024**3)",
      "expected": 4
    },
    {
      "label": "Cache budget GiB",
      "expression": "64-24-8-8",
      "expected": 24
    },
    {
      "label": "Long session memory ceiling",
      "expression": "int(24/4)",
      "expected": 6
    },
    {
      "label": "Mixed cohort GiB",
      "expression": "4*4+8*1",
      "expected": 24
    }
  ],
  "example": {
    "synthetic": true,
    "description": "Synthetic full-attention logical KV-cache allocations. The two mixed component rows belong to one cohort; bytes exclude implementation overhead and the capacity result is not a throughput measurement.",
    "rows": [
      [
        "short",
        32,
        8,
        128,
        2,
        8192,
        24,
        1073741824,
        24,
        true
      ],
      [
        "long",
        32,
        8,
        128,
        2,
        32768,
        6,
        4294967296,
        24,
        true
      ],
      [
        "mixed_long_component",
        32,
        8,
        128,
        2,
        32768,
        4,
        4294967296,
        16,
        true
      ],
      [
        "mixed_short_component",
        32,
        8,
        128,
        2,
        8192,
        8,
        1073741824,
        8,
        true
      ]
    ]
  },
  "limitations": [
    "Examples use declared invented inputs, not observed fills, customer outcomes, provider rankings or predictive backtests.",
    "Source-review date is not a measurement time, publication date of the source or assurance that terms will remain current.",
    "Documentation does not establish individual access, legal eligibility, service reliability or investment suitability."
  ],
  "falsification_or_recheck_triggers": [
    "Changed governing document or applicable software version.",
    "Evidence of different account, product, timing, unit or legal-entity scope.",
    "An arithmetic error or reproducible counterexample to the stated mechanism."
  ],
  "rights": {
    "original_DN_analysis": "Cite Decentralised News, the canonical URL and record version when reusing this worked example.",
    "third_party_sources": "Third-party material remains subject to its original terms. Linking does not grant redistribution rights."
  },
  "commercial_disclosure": "This article includes a link to DN’s own separately scoped research service. No provider purchase is required to use the example.",
  "corrections": []
}
