Skip to content

The Mooncake trace: a proven hit-rate ceiling

Lookups on the test slice of our excerpt of the public Mooncake trace, one block per hundredth

  • The ceiling for a demand cache that starts empty on this trace slice, from a proved bound: 19.645%
  • Least-recently-used caching, simulated at 1,693 blocks: 5.497%
  • First lookups of a block, which such a cache must miss
The result

On a test slice of our excerpt of a public trace of real AI requests, no cache that starts empty and fetches only on request can beat a proven hit-rate ceiling

What it does not claim

It bounds demand policies only. It is a property of this trace, not of any cache product, and a different workload has a different ceiling. No deployed cache was measured. The bound itself is textbook: it is the compulsory miss described in the lecture cited below.

The limits, in the lab’s words:

A ceiling on DEMAND policies only — prefetching escapes it, and the certificate proves that rather than assuming it.

Excerpts, word for word from the published file, where the full text can be read.

The Mooncake trace is a public record of requests to Mooncake, a production model-serving system; the lab works from an excerpt of it kept with its code, and sets part of that excerpt aside as a test slice. A demand cache is one that fetches a block only when a lookup asks for it. The lab proved a ceiling on the share of cache-block lookups that any demand cache starting empty can serve from memory on that test slice. It then simulated the offline ideal, Belady's policy, and least-recently-used caching to show where each lands.

What it shows

In this model: a demand cache, one that fetches a block only when a lookup asks for it, starts empty and serves the test slice of the lab's excerpt of the Mooncake trace. A reference is one lookup of one cached block; a request usually makes many of them. Lean is a proof checker: a statement proved in it has been checked by a program, not only by people.

Why the first lookup must miss

A demand cache fetches a block only when a request asks for it. The first request for any block must miss, because nothing can be in the cache before it is ever asked for. So on any trace, the share of hits can never exceed the share of references that are repeats.

The lab proved this in Lean for every trace and every demand policy, then computed the ceiling for the test slice of the Mooncake trace, the part kept apart from the rest for evaluation. The lab's claim, quoted below, gives the ceiling and the counts behind it.

Two policies, simulated

The claim reports two of the simulated policies, each run from a cold start:

  • Belady's policy is the offline ideal, as the textbook chapter cited below explains. It evicts the block that will be needed furthest in the future. That gives the fewest misses, but it needs knowledge of the future, so only a simulator can run it.
  • Least recently used (LRU) evicts the block that was used longest ago; it needs no knowledge of the future.

A cold start means each cache begins empty. The claim reports both at two cache sizes. Belady reaches the ceiling only at the larger size; LRU stays far below it at both.

Why it matters, and to whom

For teams that build or run serving engines with a shared prompt cache, the ceiling separates two questions. How much better could any demand policy do on this trace? And how much is lost to the policy in use? At the larger cache size, where the offline ideal reaches the ceiling, the gap between LRU and the ceiling is the most a better demand policy could win. At the smaller size even the offline ideal stays below it; the claim gives both.

Above the ceiling

No demand cache that starts empty can go above the ceiling; the lab also proved that a prefetching policy can beat such a ceiling. The Mooncake paper reports reuse over its whole trace; this ceiling is for the test slice of the lab's excerpt, counted from an empty cache, so the two are not the same measure.

Why now

Providers now sell prompt caching to their customers, and some explain how it works, as in one provider's prompt-caching guide. Cached-token pricing makes the hit rate matter to what customers pay. A ceiling computed from the traffic itself tells a buyer which hit rates a demand cache that starts empty cannot reach on that traffic, before any cache is built. A cache that starts warm, or one that prefetches, can go higher, so the ceiling does not bound those. The theorem holds for every trace, so it can be evaluated on a buyer's own traffic, which has its own ceiling.

How it was checked

The ceiling is a Lean theorem evaluated on the trace. The policy figures are simulations, and the limits say so. The claim reports each cache size separately.

Re-derived separately: one excerpt, two slices

A separate study by the lab recomputed these tables cell by cell, from the same excerpt of the trace, with code of its own. It found two ceilings, not one, because two of the lab's earlier result files count over two different slices of the excerpt. Over all 2000 requests of the excerpt, the ceiling is 0.28906. Over the test slice, the last 800 requests, it is 0.19645: the ceiling on this page.

A figure read against the wrong slice

At a cache of 1939 blocks, Belady's policy reaches 0.23465 over the whole excerpt. That is above the test slice's ceiling but under the whole excerpt's own, so it breaks no ceiling: a figure from one slice had been set beside the ceiling of the other. As a check on its own simulator, the study ran a second, slower implementation of Belady's policy on the first 3000 lookups, and the two counted the same number of hits, 97 and 97.

In the study's words

"8 of 8 published cells reproduced exactly; Belady 0.23465 sits under its own slice's wall of 0.28906; the test split's wall is 0.19645." Its stated limits: "no throughput claim; prefetch column empty; git_rev unknown". It makes no claim about serving speed, leaves the prefetching column of its table empty, and did not record the version of its code it ran. Its result file is published here unchanged, beside its claim and limits.

The same excerpt, against the offline ideal

The lab also set simple cache policies against Belady's offline ideal over the whole excerpt, each starting empty. At a cache of 1939 blocks, the ideal reaches a hit rate of 0.23465. Least recently used reaches 0.04837, and the lab's own lookahead policy 0.04852. The lookahead policy is 79.32 percent short of the ideal.

What the gap means

No policy that runs online can be guaranteed to reach the offline ideal, so the gap is the most a better demand policy could win on this excerpt, not something any policy delivers. The ideal here is computed by the lab's code, and its certificate records that a second, separate implementation agreed with it exactly at the capacities checked; it is not one of the lab's Lean theorems. It is one trace, one snapshot, with the trace's own block size.

In the lab's words: "On 2,000 requests of the real Mooncake FAST'25 conversation trace, 28.91% of KV blocks are reuse-eligible, and at the headline 1,939-block capacity this repository's simulated lookahead policy achieves 4.852% against a computed clairvoyant (Belady) optimum of 23.465% -- a 79.32% gap. All four policy arms are simulations over the frozen fixture; no deployed prefix cache was measured." Its certificate and claim and limits are published here.

How to reproduce

The published results file names the command that regenerates the certificate, the file of computed values the claim rests on, and the commit it was read at. Anyone with access to the lab's code, which carries its excerpt of the trace, can rerun it. The lab's code is not public yet. The proof itself is: read the Lean proof of the ceiling and its certificate, which the verifier on the home page can confirm, in your browser, are the unaltered published files. Each receipt file named on this page is listed with its hash in the site's receipt manifest, so a downloaded copy can be checked byte for byte.

Formal statement

In words: take a trace τ with N references to d distinct blocks. Every demand policy π starting from an empty cache must fetch each block at least once, so at most the remaining references can hit. This is the classical bound on compulsory misses; the lab proved it in Lean for all traces and all demand policies, then evaluated it on this trace.

The result, in the lab’s exact words

Read it with this condition: the ceiling holds for a demand cache that starts empty, on the test slice of the lab's excerpt of the trace (the quote's held-out stream); a warm or prefetching cache can go above it. Lean checked the inequality for every trace and demand policy; the two counts, and so the value, come from the lab's code. Where the quote says Belady attains the bound "only at" one capacity, that is the smallest capacity swept at which it does; it also attains it at the larger one.

On the held-out Mooncake test stream (21,069 references, 16,930 distinct) the hit rate of ANY demand policy is bounded above by 19.645%, machine-checked in Lean for all traces and all demand policies. The bound is attained by simulated Belady only at a 1,693-block capacity, where simulated LRU reaches 5.497%; at the smallest swept capacity of 423 blocks simulated Belady reaches 12.687% and simulated LRU 4.059%. Every policy number is a cold-start simulation over the held-out stream, not a deployed cache.

Quoted word for word from the lab’s published claim and limits.

Prior art

Evidence

Related results

All results from AxiomLimit · The AxiomLimit home page

How the numbers on this page are checked

Every number on this page links to the file it comes from. All published files.

  • Loadingshown only once its file has loaded in your browser
  • Not checkeda question we have not checked would say so, with no number
  • Checked, nothing founda search that found nothing would say so, with no number
  • No valuea file that holds no value for the question would say so
  • File missinga number whose file is missing or altered would be hidden
  • Unclear subjecttwo files that disagree about what a number describes would both be shown
  • Small samplea number from a small sample would carry its sample size
  • Conflicting filestwo files giving different values would both be shown
  • Not publishablea file we may not publish would be named by its fingerprint only
  • Out of datea measurement older than a week would carry its age
  • Does not applya question that does not apply to this page would say so
  • Run faileda measurement whose program failed would say so, with no number