|
| 1 | +# LHD (Learning Hit Density) |
| 2 | + |
| 3 | +## Goal |
| 4 | +Maximize value per byte by using a learned estimate of hit probability over |
| 5 | +remaining lifetime, especially when object sizes vary substantially. |
| 6 | + |
| 7 | +## Core Idea |
| 8 | +LHD estimates each object's future hit density (roughly expected future hits per |
| 9 | +byte over a horizon) from observed reuse behavior. Eviction prefers entries with |
| 10 | +the lowest estimated hit density. |
| 11 | + |
| 12 | +Compared to simple size-aware scoring, LHD adapts estimates from workload data |
| 13 | +instead of relying on fixed formulas. |
| 14 | + |
| 15 | +## Core Data Structures (Typical) |
| 16 | +- Hash index `K -> EntryMeta` |
| 17 | +- Size-aware entry metadata (`size`, age/timestamp, access stats) |
| 18 | +- Lightweight learned model/state (bucketized statistics tables) |
| 19 | +- Victim selector keyed by estimated hit density |
| 20 | + |
| 21 | +## Complexity & Overhead |
| 22 | +- Higher implementation complexity than GDS/GDSF |
| 23 | +- Additional memory for model tables and per-entry predictors |
| 24 | +- Runtime cost depends on estimator complexity (can be O(1) with table lookups) |
| 25 | + |
| 26 | +## Notes For CacheKit |
| 27 | +- High-value candidate for byte hit rate optimization and heterogeneous object sizes. |
| 28 | +- Start with coarse bucketed estimators to keep hot paths predictable. |
| 29 | +- Benchmark against `GDS`, `GDSF`, and `Hyperbolic` on mixed-size traces. |
| 30 | + |
| 31 | +## References |
| 32 | +- Beckmann et al. (2018): “LHD: Improving Cache Hit Rate by Maximizing Hit Density”. |
| 33 | +- USENIX OSDI 2018 paper and follow-up implementations. |
0 commit comments