Research notes / Cache replacement
Hyperbolic caching: priorities can cross without hits
Published / Updated / Constructed example and native code probe
An eviction ranking can become obsolete even when neither object receives another access. The comparison below changes its answer at time 12, without changing either access count.
On this page7 sections
Residence age, not last-access age
Blankstein, Sen and Freedman's hyperbolic policy scores a resident object using its access count divided by time since insertion. It evaluates randomly sampled candidates at eviction time. A hit increments the count without resetting the insertion time. [1, Figure 1]
Consider equal-size, equal-cost objects A and B. A entered at time 0 and has four accesses; B entered at time 9 and has one. A possible history is A at times 0, 1, 2 and 3, then B at 9. Both stay resident and receive no further accesses in this example. These are arbitrary elapsed-time units, not a measured production trace.
The two priorities are 4 / t and 1 / (t - 9), for t > 9. Lower priority means the less valuable candidate under this particular score.
The lower-priority object changes
| Time | A: count 4 | B: count 1 | Lower priority |
|---|---|---|---|
| 10 | 2/5 | 1 | A |
| 12 | 1/3 | 1/3 | Tie |
| 20 | 1/5 | 1/11 | B |
At time 10, A is the lower-priority candidate. At time 20, B is. A queue ordered only by scores calculated at time 10 would still put A first. Reusing that ordering without maintaining it produces the wrong comparison at time 20. This does not rule out an exact time-aware data structure; it rules out treating old keys as current keys.
To find the crossing, multiply by the positive denominators: 4(t - 9) = t, hence t = 12. More generally, counts a and b with insertion times x and y cross at (ay - bx) / (a - b) when a differs from b and the result is later than both insertions. Equal counts need separate handling; there may be no future crossing or a persistent tie.
The table is a comparison at three observation times, not three successive evictions. Removing A at time 10 would violate the assumption that both remain resident until time 20.
A sampled minimum is not the global minimum
The pinned author simulator's ordinary sampling path permits repeated draws. It also offers retained-candidate variants, which this calculation does not model. [2, Sampling.sample]
Fix 100 residents and mark the ten with lowest priority. Eight independent, uniform draws with replacement miss all ten with probability (90/100)^8. The complement is 56.953279%. This answers whether the sample contains any of those ten, not whether it contains the unique worst candidate. For the latter event, substitute one qualifying object for ten.
Eight distinct uniformly sampled residents instead give 1 - choose(90,8) / choose(100,8), exactly 219338127/375935140. Sampling without replacement and eight independent draws are different experiments. Neither probability predicts application hit rate.
When an age bucket overrides the learned score
A second implementation boundary appears in Least Hit Density (LHD). The paper uses age-conditioned predictions and a finite age horizon. Its explorers remain resident until a large age; they are not a promise of permanent retention. [3, section 3.5 and Appendix A]
The released simulator first coarsens elapsed access count by a right shift. In getHitDensity(), the last age bucket returns the lowest finite float before looking up a class score or adding the explorer bonus. This is a priority sentinel, not a negative prediction of future hits. [4, lines 142-157]
For H = MAX_AGE and fixed shift s, terminal priority starts at (H - 1) * 2^s accesses. The overflow counter starts at H * 2^s. A whole bucket therefore has terminal priority without incrementing the counter.
Native extracted-function results: H = 20,000, shift = 10, supplied class score = 50, object size = 100 bytes. Each row starts with a fresh zero counter.
| Case | Age in accesses | Rank | Counter |
|---|---|---|---|
| Before terminal bucket | 20,478,975 | 0.5 | 0 |
| Before terminal bucket, explorer | 20,478,975 | 1.5 | 0 |
| First terminal age | 20,478,976 | Lowest float | 0 |
| First terminal age, explorer | 20,478,976 | Lowest float | 0 |
| Last uncounted terminal age | 20,479,999 | Lowest float | 0 |
| First overflow age | 20,480,000 | Lowest float | 1 |
| Same over-age object, three evaluations | 20,480,000 | Lowest float | 3 |
The initial header setting gives a 1,024-access gap between 20,478,976 and 20,480,000 accesses. These are not seconds, and the simulator can adapt the shift. Three evaluations of the same over-age object increment the counter three times: it does not count unique objects, evictions or lost hits. A zero counter does not rule out terminal ranks.
Ranking also does not immediately evict every old object. The selection path samples candidates and compares ranks; equal terminal ranks can still tie. This code-path result does not show how often the boundary occurs in a workload or establish a performance defect. [5, rank() and adaptAgeCoarsening()]
The reproduction guide links the seven native results. The probe compiles two unchanged functions from a hash-checked upstream header. An integer-threshold oracle checks five shifts and both explorer states; unoptimized and optimized builds agree. Class scores are supplied, not learned. No cache trace, full simulator or RankCache benchmark runs in this experiment.
What this establishes
This is an exact teaching calculation, not a cache benchmark. It establishes a crossing and two conditional sampling probabilities. It does not rank eviction policies or reproduce the paper's Redis and Django experiments. Costs, expiration, concurrent accesses and history after eviction are outside the constructed case.
The reference rejects zero residence age; deployed software needs an explicit timestamp-resolution and zero-age policy. It reports both objects at a tie instead of inventing a tie-break. Changing time units scales both scores equally and leaves the ordering unchanged.
For a different aging mechanism, compare LRFU. For measured versus constructed evidence, see our SIEVE trace analysis. The corpus definition provides the stable entity and source links.
Reproduce the arithmetic
Download the reference calculation, tests, exact JSON results and method notes. Python's standard library suffices; no workload data or random seed is needed.
python3 -B model.py
python3 -B -m unittest discover -s . -p test_model.pyTests compare scores against integer cross-products, enumerate small sampling spaces independently and cover invalid inputs, zero draws, empty qualifying sets, complete samples, ties and time-unit changes.
Primary sources
- Blankstein, Sen and Freedman. Hyperbolic Caching: Flexible Caching for Web Applications. USENIX ATC 2017, pp. 499-511, sections 2.1 and 2.4, Figure 1. Accessed 2026-11-12.
- Author simulator: Sampling.sample, commit 884c466c311bb5b9fbdd09791d829b04032f3947. Accessed 2026-11-12.
- Beckmann, Chen and Cidon. LHD: Improving Cache Hit Rate by Maximizing Hit Density. NSDI 2018, section 3.5 and Appendix A. Accessed 2026-11-28.
- CMU-CORGI/LHD: lhd.hpp, age coarsening and terminal rank, commit 806ef466160c5e968efcc60d1e6476ab802f7f55. Accessed 2026-11-28.
- CMU-CORGI/LHD: lhd.cpp, candidate selection and age adaptation, commit 806ef466160c5e968efcc60d1e6476ab802f7f55. Accessed 2026-11-28.