Can I Buy Your KV Cache?
Abstract: Right now, across the world, AI agents are repeating the same absurd act: to read one document, they each recompute it from scratch. Every agent re-runs prefill, the most compute-intensive step a large model takes, over identical text, only to rebuild a key-value (KV) cache identical to the one the agent before it just built. The same answer, computed a million times. We make a proposal that is almost offensively simple: compute it once. Let a publisher precompute a document's KV cache, and let every other agent buy the right to load it and skip prefill. It works, and it is token-exact: loading a precomputed KV and continuing matches prefilling from scratch (24/24 greedy tokens, and at the logits level), with no accuracy cost. On Qwen3-4B, reuse is 9-50x cheaper in compute than prefill, and the gap widens with length (prefill's attention scales with L2), so a single reuse already pays it back. Then the part that matters: where the KV lives. Shipping it fails, because KV is nearly incompressible, so per-load egress costs more than the prefill it saves. Hosting it provider-side, exactly as production prompt-caching works, removes egress entirely. The size of the prize is set by our measured compute saving: serving one hot 3774-token document to 80M agents costs ~$1.5M to re-prefill but only ~$0.03M of reuse compute (49.7x less). The 0.1x cache-read tariff APIs charge passes a 10x discount to users while sitting inside this measured envelope, so the 10x is a floor that the measured ~50x compute saving clears, and the gap to the physical ~50x is provider margin: millions of dollars per popular document. We frame the resulting agent-native prefill CDN and leave lossless KV compression and a cross-party payment layer as the open problems.
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Explain it Like I'm 14
What is this paper about?
This paper asks a simple question: if lots of AI programs keep reading the same public document, why do they all redo the most expensive step from scratch each time? The authors propose a fix: compute that heavy step once, save the result as a “KV cache,” and let everyone else load it instead of recomputing it. They show this works exactly (no accuracy loss) and can be much cheaper and faster. They then explain when and how to make this practical at large scale.
What questions does it try to answer?
The paper focuses on a few easy-to-understand questions:
- Can an AI safely reuse a precomputed “memory” of a document (the KV cache) and get the exact same answers as if it read the document itself?
- How much computing power (and money) does reuse save compared with redoing the work each time?
- How does the saving grow as more people reuse the same document?
- Where should this saved “memory” live so that reuse is actually cheaper in real life: shipped to every user or hosted by the model provider?
- What breaks if we try to shrink the saved file with compression?
How did the researchers test their idea?
First, some plain-language meanings of the key terms:
- Prefill: When a LLM reads a long input, it does a big, upfront calculation to prepare its internal “notes.” This is the most expensive part.
- KV cache: Think of it as those internal notes the model keeps for each position in the text. Keys (K) and values (V) are like organized bookmarks and summaries that help the model pay attention to the right words later.
- Decode: After making those notes, the model writes its answer one token (small chunk of text) at a time, using the notes to guide it.
- Shared prefix: Everyone starts from the same exact document text before adding their own question or continuation.
What they did:
- Exactness check: They saved the KV cache for a document using one model (Qwen3-4B). Then, instead of rereading the document, they loaded that KV cache and continued generating an answer. They compared the output to what you’d get if you prefixed (reread) the document from scratch. Result: the outputs matched token-for-token under greedy decoding, meaning reuse didn’t change the answer.
- Cost measurement: They measured how long prefill takes versus how long “reuse plus one decoding step” takes for documents of different lengths (about 255 to 3774 tokens). This shows the speedup (and cost saving).
- Scaling model: They wrote a simple formula to show how the average cost per user falls as more people reuse the same KV cache. If loading is much cheaper than recomputing, you start saving almost immediately.
- Storage and shipping: They estimated what happens if you try to send the KV file over the internet (egress) versus hosting it on the provider’s servers, like a content delivery network (CDN) but for precomputed model notes (a “prefill CDN”).
- Compression test: They tried shrinking the KV file with int8 quantization (a common compression trick). It made the file smaller but broke the exact match with the original outputs, which matters for reproducibility.
What did they find, and why is it important?
Here are the main takeaways:
- Reuse is exact for shared prefixes: Loading a saved KV cache and continuing the answer produces the same tokens as reading the document from scratch (under greedy decoding). So you save compute without sacrificing correctness.
- Big speedups, bigger for longer texts: Reusing the KV cache was about 9–50 times cheaper in compute than prefilling, and the advantage grows with length. That’s because prefill grows roughly with the square of the document length () due to attention, while loading and continuing grows much more slowly.
- Break-even is basically immediate: Since loading is so cheap, even the second read already saves you time and money.
- Shipping the KV is usually a bad idea; hosting it is good: The KV cache is large (hundreds of megabytes for a few thousand tokens) and hard to compress without losing exactness. Sending it to every user over the internet can cost more than just recomputing. But hosting it on the provider’s servers (like today’s prompt caching) removes that transfer cost and makes the economics work.
- Real-world dollars look compelling: For a popular 3774‑token document served to 80 million agents, recomputing from scratch costs about $1.5M in compute. Hosting and reusing costs about$0.03M in compute, roughly 50× less. Even if an API charges users 10× less for cache reads than for full inputs, providers still keep a healthy margin, and users get cheaper, faster responses.
- Compression is tricky: Simple int8 compression halves the file size but breaks exact token matching. This suggests you need smarter, selective compression if you want both small size and exact reproducibility.
Why it matters: Today, AI systems waste massive compute repeating the same work. This approach turns popular documents into reusable “compute artifacts,” cutting cost and speeding up responses—especially valuable for long texts and millions of readers.
What could this change in the real world?
The idea points to a new layer in the AI ecosystem: a “prefill CDN.”
- Publishers of popular documents could upload precomputed KV caches.
- AI agents could pay a small fee to load the KV and skip the expensive prefill.
- Users get faster, cheaper answers; providers make money by hosting the caches.
- It fits naturally wherever many people or agents read the same content: manuals, knowledge-base articles, reports, regulations, and more.
Open challenges the paper highlights:
- Lossless or smart compression to shrink KV size without breaking exactness.
- Standards and payments across different parties (provenance, versioning when models change, and secure access).
- Extending beyond single-document prefixes to sets of retrieved chunks (which needs careful partial recomputation).
- Applying this to multimodal content (like long videos), where prefill is even more expensive.
In short, the paper shows a simple but powerful change—reuse what’s already been computed—can make AI systems much more efficient, paving the way for cheaper, faster, and more scalable AI services.
Knowledge Gaps
Knowledge gaps, limitations, and open questions
Below is a single, consolidated list of what the paper leaves missing, uncertain, or unexplored, phrased as concrete, actionable gaps for future work.
- Cross-device and large-model validation: Reproduce compute ratios and exactness on server-grade GPUs (A100/H100), diverse backends (CUDA, ROCm), and larger models (e.g., 7B–70B), including the long-context regime the paper excluded due to on-device memory pressure.
- End-to-end serving costs: Quantify real-world overheads omitted from experiments—disk/SSD read, CPU→GPU/PCIe transfer, cache deserialization, allocator/fragmentation effects, and cache-management overhead—on throughput, latency (TTFT/TBT), and cost under multi-tenancy.
- Memory residency and eviction: Determine how many hot KVs can realistically reside on GPU/CPU/flash, design eviction/prefetch policies, and measure hit rates and performance under realistic multi-document request distributions.
- Batching and scheduler interplay: Study how precomputed KV reuse interacts with batching, prefix trees (RadixAttention), and throughput-oriented schedulers; identify when reuse helps or hurts overall system throughput.
- Continuation length sensitivity: Measure speedups as a function of continuation length M (beyond the best-case M=1 reported), including typical agent workloads with dozens to hundreds of output tokens.
- Determinism and decoding modes: Test token/logit equivalence under sampling, temperature/Top‑p, beam search, logit biases, and fused kernels; assess how small non-determinisms affect reproducibility claims across hardware/backends.
- Standardized artifact format: Specify a portable, versioned KV format and metadata that includes tokenizer version, positional encoding (RoPE base/scaling/interpolation), attention variant (GQA/MQA/MLA), layer/head dims, framework/kernel versions, and exact position-id scheme.
- Provenance and attestation: Provide cryptographic signatures and content-addressable IDs linking the artifact to a specific model version and tokenized byte sequence; include integrity checks to prevent mismatched or tampered artifacts.
- Invalidation and model upgrades: Define policies and mechanisms for cache invalidation on model updates (minor vs major), compatibility matrices, and automated migration/rebuild strategies with cost modeling.
- Tokenization and canonicalization: Ensure token-identical prefixes across parties via canonical byte normalization, tokenizer pinning, and hashing; handle differences in chat templates, whitespace, and newline normalization that break exactness.
- Lossless compression reality check: Empirically characterize true lossless compressibility of KV across lengths/layers (e.g., zstd/LZ4, per-layer delta coding, run-length/entropy coding), rather than assuming near-incompressibility.
- Argmax-invariant lossy compression: Develop selective/mixed-precision or non-uniform schemes that provably preserve argmax logits (or top‑k margins) to retain token-equivalent outputs while shrinking artifacts.
- Storage- and network-aware benchmarks: Measure end-to-end performance when KVs are fetched from CPU RAM, NVMe, computational storage, or over RDMA/IPC within a datacenter; determine when provider-side hosting remains net beneficial.
- Shipping viability sensitivity: Reassess “shipping fails” under varied egress contracts, regions, peering, edge/colocation scenarios, and compression; identify regimes where shipping can be competitive.
- Fusion under a prefill CDN: Integrate CacheBlend/Cache-Craft/CacheClip-style selective recomputation beneath the artifact layer; quantify the quality–cost trade-off for retrieval sets vs single-document prefixes.
- Selective caching policy: Learn length×popularity thresholds from traces, estimate hit/miss rates, and quantify net savings; incorporate TTLs, prewarming, and eviction economics.
- Payment and metering layer: Design a cross-party micropayment system with per-load metering, fraud prevention (replay/resharing), revocation, refunds on cache misses, and revenue sharing between publishers and hosts.
- Security and privacy for hosted/private KVs: Implement encryption-at-rest/in-transit, access control, rate limiting, and audit logs; assess whether KVs leak anything beyond the text in practice (e.g., side channels, metadata).
- Adversarial/malicious artifacts: Define verification routines (metadata, shapes, positional ranges, checksums) to prevent malformed KVs (e.g., position-id shifts or mask abuse) from triggering divergence or evading safety filters.
- Safety/guardrail interaction: Determine how provider-level moderation, safety prompting, and tool-use hooks interact with precomputed prefixes; ensure reuse does not bypass safety layers embedded in standard prompts.
- Multi-turn/session KVs: Explore storing and reusing rolling conversation caches (not just static document prefixes) and define when/what to publish, including privacy and update semantics.
- Speculative/assisted decoding: Evaluate how precomputed KVs interact with speculative decoding, draft models, KV parallelism, and assisted generation pipelines.
- Multimodal/video extensions: Characterize KV size, exactness, and reuse economics for long video/audio/multimodal contexts and models with cross-modal attention.
- Legal/IP considerations: Clarify rights to publish/sell KVs for copyrighted content, derivative-work implications tied to model licenses, and obligations when models/content change.
- Provider margin realism: Validate the claimed margin envelope using production-grade kernels, contention, and memory constraints; reconcile theoretical compute ratios with real cost accounting (power, cooling, amortization).
- Discovery and CDN architecture: Specify indexing, search, and routing for KV artifacts (naming, catalogs, SLAs), handling cache misses with fallback-to-prefill, and content distribution across edge/regions.
Practical Applications
Immediate Applications
Below are concrete, deployable uses that leverage exact, prefix KV reuse and provider-side hosting to cut prefill cost and latency without accuracy loss.
- Sector: Software/Cloud (Inference providers)
- Application: “Cache-read” SKU for public documents
- What: Host precomputed KV artifacts for hot public corpora (e.g., Wikipedia pages, SEC filings, RFCs, popular APIs docs) inside the provider’s datacenter and expose a cache-read billing tier.
- Tools/Workflows: KV registry indexed by (document hash, model id, dtype, length); API route to “load-KV-then-decode”; automated invalidation on model upgrade.
- Assumptions/Dependencies: Exactness requires same model and dtype; deterministic kernels not strictly required for greedy token identity but help in audit; provider-side hosting to avoid egress; document popularity to amortize storage.
- Sector: Enterprise IT/Knowledge management
- Application: Internal “prefill CDN” for handbooks, SOPs, product manuals
- What: For standardized, org-wide models, precompute KVs for long, frequently accessed internal PDFs and Confluence pages; all assistants/agents load KV instead of re-prefilling.
- Tools/Workflows: CI job that re-builds KV artifacts on doc change; access control tied to identity provider; KV-backed RAG router that checks KV hit before prefill.
- Assumptions/Dependencies: Single standardized model-version across teams; legal/privacy approval; storage quotas; hosted in same cluster to remove egress.
- Sector: Customer Support
- Application: KV-backed support bots for product manuals and FAQs
- What: Precompute KVs for top-read manuals per model-version; drastically reduce time-to-first-token and per-ticket cost.
- Tools/Workflows: Popularity-based selective caching; SLA-aware fallback to prefill on KV miss; dashboard for cache hit rate and savings.
- Assumptions/Dependencies: Shared prefixes (single doc) use case; frequent reuse; provider-hosted KV; retraining/migration plan on model upgrade.
- Sector: Finance
- Application: Earnings calls and regulatory filings at scale
- What: Precompute KVs for 10-K/10-Qs, earning call transcripts; analysis agents traverse filings with cache reads.
- Tools/Workflows: Filing-ingest pipeline that computes KV upon arrival; symbol/date indexing; compliance logging for auditability.
- Assumptions/Dependencies: Exact reuse only for full-prefix reads; heavy read volume; standardized model; hosted KV to avoid egress costs.
- Sector: Education
- Application: Course platforms with KV-ready textbooks/syllabi
- What: MOOCs and LMS vendors host KVs for course materials; tutoring agents skip prefill for student questions referencing assigned readings.
- Tools/Workflows: “Publish KV” step in content authoring; KV manifest pinned to model-version; instructor dashboard for cache utilization.
- Assumptions/Dependencies: Rights to host content; stable model for a term; provider-local serving.
- Sector: Academia/Publishing
- Application: Reproducible LLM “reading” of papers
- What: Journals/arXiv host KVs for papers alongside PDFs to enable exact, auditable continuations and faster literature agents.
- Tools/Workflows: DOI-to-KV mapping; provenance metadata (model id, dtype, date); artifact signing.
- Assumptions/Dependencies: Model/version lock; hosted serving within participating providers; acceptance of model-bound artifacts.
- Sector: Government/Policy
- Application: Open-law KV hosting for statutes, regulations, guidance
- What: Government portals publish provider-hosted KVs for legal corpora so citizen agents can query with minimal cost/latency.
- Tools/Workflows: Neutral “KV mirrors” at major clouds; versioned KV on statute updates; public procurement for cache-read tariffs.
- Assumptions/Dependencies: Public domain texts; multi-provider hosting MOUs; model standard(s) designated for civic use.
- Sector: Developer Tools
- Application: Code assistants for large repos
- What: Precompute KVs for top files or docs (e.g., CONTRIBUTING.md, API specs) inside org inference clusters; agents reuse during code review and search.
- Tools/Workflows: GitHub Action to regenerate KVs on commit; mapping from repo SHA to KV id; LSP plugin that requests cache-read for matching files.
- Assumptions/Dependencies: Shared model across dev tools; document stability; in-cluster hosting.
- Sector: Daily Life (Local/self-hosted LLMs)
- Application: Personal KV store for ebooks and long PDFs
- What: Users running a fixed local model precompute KVs for books/manuals and reuse for interactive reading/summarization.
- Tools/Workflows: Desktop tool to “Pin KV” per document and model; local index; RoPE position alignment checks.
- Assumptions/Dependencies: Single local model and precision; disk space for artifacts; exactness only for the same file bytes.
Long-Term Applications
These require further research, standardization, or productization (e.g., compression, fusion, payment rails, cross-party marketplaces).
- Sector: Software/Cloud
- Application: Full “prefill CDN” marketplace across publishers and agents
- What: A cross-party platform where content publishers upload/host KVs; agents pay per load over an agent-payment rail; providers price between reuse cost and prefill alternative.
- Tools/Workflows: KV artifact standard (format, metadata, signatures), payment/invoicing API, cache invalidation on model/version change, provenance/audit trails.
- Assumptions/Dependencies: Industry-wide standardization; anti-fraud and access control; privacy and licensing frameworks.
- Sector: RAG Systems (All verticals)
- Application: Fusion-under-artifact for multi-chunk reuse
- What: Combine saved KVs for multiple retrieved fragments with selective recomputation (e.g., CacheBlend-style) to approximate exactness while keeping most savings.
- Tools/Workflows: Scheduler deciding which tokens to recompute; policies that trade speed vs. accuracy; evaluation suites for quality-impact.
- Assumptions/Dependencies: Additional research on robust fusion methods; workload-specific quality thresholds.
- Sector: Compression/Systems
- Application: Mixed-precision, per-token KV compression with exactness guarantees where needed
- What: SpectrumKV-like schemes that store most tokens at lower precision while preserving exactness for decision-critical spans; or SIFT-like sparse recompute strategies.
- Tools/Workflows: Calibrators to assign bit-widths; audit modes that force lossless for reproducibility; storage-tiering (flash/DRAM).
- Assumptions/Dependencies: Model/kernel determinism considerations; formats that support partial losslessness; acceptance of non-exact paths for non-audit workloads.
- Sector: Multimodal/Media
- Application: KV reuse for long video/audio transcripts and multimodal contexts
- What: Precompute KVs for lectures, hearings, sports games, surveillance segments to accelerate repeated querying/summarization.
- Tools/Workflows: Segment-level KV publishing; alignment tools for multimodal position encodings; player-integrated “KV-ready” media.
- Assumptions/Dependencies: Larger artifacts; stronger need for compression; standardization of multimodal KV formats.
- Sector: Healthcare
- Application: KV-backed clinical policy and device manuals within hospitals
- What: Host lossless KVs for clinical guidelines and equipment manuals on-prem; agents assisting clinicians reuse KVs.
- Tools/Workflows: On-prem inference with PHI isolation; model/version governance; audit logging; KV access policies.
- Assumptions/Dependencies: Strict privacy/security; standardized model; procurement for compute/storage; medical compliance review.
- Sector: Robotics/Manufacturing
- Application: Shop-floor agents reading SOPs and maintenance procedures
- What: Edge servers host KVs for line-changeover instructions, equipment manuals; robot/task planners query via cache-reads.
- Tools/Workflows: Facility-local prefill CDN; deterministic kernels for reproducibility; offline KV precomputation during scheduled downtime.
- Assumptions/Dependencies: Stable documents; network availability to edge cache; model standardization inside the plant.
- Sector: Energy/Utilities
- Application: Field service assistants for power plant and grid documentation
- What: Regional caches of KVs for O&M manuals and NERC/FERC guidelines; mobile technicians’ agents reuse to reduce latency in low-connectivity scenarios (edge-hosted).
- Tools/Workflows: Offline-first KV synchronization; device-aware cache sizing; policy updates trigger KV invalidation.
- Assumptions/Dependencies: Edge hosting; update distribution; compliance oversight.
- Sector: Finance/Quant Platforms
- Application: KV-native research terminals
- What: Terminals that show “KV-ready” tags for filings/transcripts; analysis scripts call cache-read APIs; paid tier includes hosted KVs for premium research.
- Tools/Workflows: Data vendor integration; KV freshness SLAs; per-symbol cache usage analytics.
- Assumptions/Dependencies: Licensing for paid content; alignment across model versions; payment rails.
- Sector: Web/Content Ecosystem
- Application: KV-native web pages and repositories
- What: Popular web pages/repos publish KV manifests per supported model; browsers/agents negotiate cache-read with provider-side hosts (akin to CDNs for bytes).
- Tools/Workflows: HTTP header/metadata standard for KV pointers; multi-provider mirrors; integrity verification.
- Assumptions/Dependencies: Broad adoption; standard formats; governance for model-binding and version churn.
- Sector: Scientific Reproducibility
- Application: “Include the KV” as an artifact for LLM-in-the-loop studies
- What: Papers distribute KVs of long prompts/corpora used in analyses to enable exact continuation and audit.
- Tools/Workflows: Repro packaging (data + KV + model id); archival in repositories; deterministic kernel modes for verification.
- Assumptions/Dependencies: Storage funding; accepted community norms; stable model access for reviewers.
Cross-cutting assumptions and dependencies that affect feasibility
- Exactness regime:
- Requires the continuation to be a strict prefix extension; fusion across independently cached fragments needs selective recomputation.
- Model-binding is strict: same model id and precision; model upgrades invalidate KVs.
- Economics and hosting:
- Provider-side hosting is key; shipping raw KVs loses money at today’s egress prices unless lossy compression is acceptable.
- Benefits scale with document length and reuse count; selective caching policies should target long, popular documents.
- Engineering:
- Correct position id assignment and full attention masks are mandatory to avoid “shifted” failures.
- Deterministic kernels help logits-level reproducibility; greedy decoding is assumed for token-exact evaluations.
- Governance and security:
- Provenance, signing, and access control are required for cross-party use and paid/private caches.
- Privacy-sensitive sectors (healthcare, finance) require on-prem or VPC-hosted KV stores with encryption at rest and strict IAM.
- Standardization:
- A portable artifact format with metadata (model id, dtype, length, RoPE settings) and lifecycle policies (invalidation, fallback) is needed for broad ecosystem uptake.
Glossary
- Agentic workloads: Workloads driven by autonomous agents repeatedly accessing and processing content. "A defining feature of retrieval-augmented and agentic workloads is that the same content is read over and over."
- Agent-native prefill CDN: A proposed content layer that hosts precomputed KV caches for agents to load instead of recomputing, analogous to a CDN but for computation. "We frame the resulting agent-native prefill CDN and leave lossless KV compression and a cross-party payment layer as the open problems."
- Amortized per-call cost: The average cost per request when a fixed upfront cost is spread over multiple uses. "We provide a minimal, fully reproducible study of the core question: how does the amortized per-call cost of KV reuse compare to repeated prefill, and how does it scale with the number of reuses?"
- Artifact: A persisted, portable file containing a precomputed KV cache and metadata for reuse. "Compute the KV once, persist it as a portable artifact, and let downstream consumers load it and continue generating, paying a cheap load instead of a full prefill."
- Attention mask: A binary mask that defines which positions each token can attend to during decoding. "Attention mask: the mask must span the full positions so the continuation attends to the entire cached context."
- Break-even reuse count: The number of reuses at which the total cost of reuse equals the cost of recomputing from scratch. "The break-even reuse count is"
- Cache-read tariff: The pricing rate charged by APIs for reading from a hosted prompt/KV cache. "The cache-read tariff APIs charge passes a discount to users while sitting inside this measured envelope"
- Causal attention: Attention that only allows tokens to attend to previous positions, not future ones. "position depends only on (causal attention), not on any tokens that come later."
- Computational storage drives: Storage devices with compute capabilities used to offload attention and KV management. "offloading attention computation and KV management to computational storage drives for long-context inference."
- Content delivery network (CDN): A distributed system that caches and serves content to reduce latency and cost; here analogized to caching computation. "The closest familiar analogue is a content delivery network (CDN), with one twist."
- Cross-attention: Attention between tokens in different segments/chunks; missing when caches are concatenated without fusion. "naively concatenating independently-prefilled chunk caches loses the cross-attention between chunks"
- Compute-bound: A regime where computation time dominates performance rather than I/O or memory. "Prefill is compute-bound and its cost grows (super-)linearly in "
- Deterministic kernels: GPU/accelerator operations that produce the same outputs given the same inputs, enabling exact reproducibility. "Under a fixed model with deterministic kernels"
- Disaggregated serving: A serving architecture where prefill and decode run on different machines, requiring KV transfer over the network. "In disaggregated serving, prefill and decode run on different machines, so the KV cache becomes a network payload routed across the datacenter"
- Egress: Outbound data transfer from a provider’s network, typically incurring costs. "Shipping it fails, because KV is nearly incompressible, so per-load egress costs more than the prefill it saves."
- fp16: Half-precision 16-bit floating-point format used to store and compute model states. "Qwen3-4B, $36$ layers, fp16"
- Greedy decoding: A decoding strategy that selects the highest-probability token at each step. "under greedy decoding we observe a $24/24$ token match."
- Grouped-query attention: An attention mechanism variant that groups queries to improve efficiency. "grouped-query attention"
- int8 quantization: Compressing tensors to 8-bit integers to reduce size at the cost of potential accuracy changes. "int8 quantization halves it but breaks token-exact equivalence"
- KV cache: The per-layer key and value tensors stored during prefill to accelerate decoding. "key--value (KV) cache"
- Logits: The pre-softmax output scores of a model used to determine token probabilities. "matches prefilling from scratch ($24/24$ greedy tokens, and at the logits level)"
- Mixed-precision: Using different numeric precisions across tokens or tensors to balance size and accuracy. "selective / mixed-precision schemes are necessary to push size down without sacrificing reproducibility"
- Nondeterministic GPU/MPS kernels: Accelerator operations that may produce slight variations across runs due to non-associativity or scheduling. "nondeterministic GPU/MPS kernels perturb logits by a tiny amount"
- Position ids: Numerical indices assigned to tokens that drive positional encodings; must align for exact reuse. "the continuation tokens must be assigned position ids "
- Prefill: The initial forward pass over the input sequence to populate the KV cache. "Prefill runs a forward pass over all input tokens to populate the key--value (KV) cache"
- Prefix caching: Server-side reuse of KV for shared token prefixes across concurrent requests. "Prefix caching."
- RadixAttention: A prefix-tree-based attention reuse technique for shared prefixes in production systems. "RadixAttention-style prefix trees"
- Retrieval-augmented workloads: Systems that augment generation with external retrieved content repeatedly consulted. "A defining feature of retrieval-augmented and agentic workloads is that the same content is read over and over."
- RoPE: Rotary Positional Embeddings, a positional encoding method requiring aligned position ids for exact reuse. "positional encodings (e.g.\ RoPE)"
- Self-attention: Attention where tokens attend to other tokens within the same sequence, often scaling quadratically with length. "self-attention contributes a term proportional to "
- Serialization/deserialization: Converting in-memory KV tensors to/from a stored artifact without changing values. "Serialization/deserialization is value-preserving."
- Token-exact: Exact equivalence in generated tokens between reuse and from-scratch computation. "It works, and it is token-exact: loading a precomputed KV and continuing matches prefilling from scratch"
Collections
Sign up for free to add this paper to one or more collections.