Universal Caching

Ativ Joshi, Abhishek Sinha

TL;DR

Researchers from the Tata Institute of Fundamental Research have developed a "Universal Caching" policy that achieves sub-linear regret against any finite-state benchmark. By combining an efficient online learning algorithm (SAGE) with Lempel-Ziv incremental parsing, their policy adaptively learns complex, non-stationary file request patterns without prior knowledge of the underlying data-generating process.

What Problem Does This Paper Address?

In the world of online caching, the goal is to keep the "right" files in a small cache to maximize hits. Traditionally, the performance of these algorithms is measured using static regret, which compares the algorithm's performance to the single best fixed set of files chosen in hindsight.

However, real-world data is rarely stationary. A set of files that is popular in the morning might be ignored by the afternoon. Static regret is a weak metric because it doesn't account for these shifts. This paper tackles a much harder challenge: Universal Caching. The authors aim to design a policy that performs as well as the best Finite State Prefetcher (FSP). An FSP is a benchmark that can change its cached set based on a state machine (like LRU or FIFO). Competing against any arbitrary FSM is difficult because the number of possible states and transitions is unknown and potentially massive.

Methods

The authors propose a two-layered approach to achieve "universality":

  1. The SAGE Framework: To compete against a single-state benchmark, the authors utilize their previously developed SAGE (Symmetric-polynomial based AGnostic Expert) policy. Standard "Expert" algorithms (like HEDGE) fail in caching because there are $\binom{N}{C}$ possible cache configurations—a combinatorial explosion. SAGE circumvents this by using Elementary Symmetric Polynomials (ESP) and Fast Fourier Transforms (FFT) to compute marginal probabilities in near-linear time.
  2. Lempel-Ziv (LZ) Parsing: To handle multiple states without knowing the structure of the request sequence, the authors use an incremental parsing algorithm inspired by Lempel-Ziv ’78 (the basis for ZIP compression). They build an $N$-ary tree where each node represents a "state" or a specific history of file requests.
  3. The Hybrid Policy: Every node in this LZ tree runs its own independent instance of the SAGE algorithm. As the request sequence grows, the tree branches out, effectively increasing the "order" of the Markov model the algorithm is learning. This allows the policy to adaptively match the complexity of any Finite State Machine that might be generating the requests.

Datasets

The paper primarily evaluates the policy using synthetic file request sequences.

  • FSM-Generated Data: The authors constructed a synthetic environment where a hidden Finite State Machine with $Q$ states generates requests. This ensures the sequence has a learnable structure that a "universal" policy should eventually master.
  • Parameters: They tested configurations with library sizes ($N$) of 3 and 4, cache capacities ($C$) of 2, and sequences up to 10 million requests ($T = 10M$).

Key Insights and Ideas

  • LRU and FIFO are FSPs: A crucial observation is that popular heuristic policies like Least Recently Used (LRU) and First-In-First-Out (FIFO) are actually specific instances of Finite State Prefetchers. By proving their policy is competitive against all FSPs, they implicitly prove it can outperform or match these industry standards.
  • Markov Optimality: The authors prove that a Markov prefetcher (which looks at the last $k$ requests) is asymptotically as good as any FSP with a fixed number of states. This justifies using the LZ tree to approximate higher-order Markov chains.
  • Data-Dependent "Small-Loss" Bounds: Unlike previous works that provided "worst-case" bounds, this paper provides a "small-loss" bound. This means if the optimal offline policy has very few cache misses (i.e., the data is highly predictable), the Universal Caching policy converges to the optimal hit rate much faster.

Key Results

  • Sub-linear Regret: The authors establish a regret bound of $O(\frac{1}{\sqrt{\log T}})$, meaning that as time $T$ goes to infinity, the average hit rate of their policy converges to that of the best possible FSP.
  • Empirical Superiority: In simulations, the Universal Caching policy significantly outperformed "vanilla" SAGE (which only targets static regret).
  • Efficiency: By using FFT-based polynomial multiplication, the policy remains computationally feasible even as the library size $N$ grows, avoiding the exponential overhead usually associated with optimal online learning.

Limitations and Future Work

  • Download Costs: The current model assumes that downloading a file into the cache is "free." In many systems (like CDN or mobile edge computing), there is a significant cost associated with cache misses beyond just the hit rate. The authors suggest incorporating download costs as a future direction.
  • Dynamic Regret: While the policy competes with the best FSP in hindsight, it doesn't explicitly handle a benchmark that itself changes over time (Dynamic Regret).
  • Real-World Traces: While the synthetic results are mathematically sound, testing on real-world web traffic traces (like those from Akamai or Wikipedia) would further validate the policy's practical utility in noisy, non-idealized environments.

Summary updated

BibTeX
@inproceedings{joshi2022universal,
  author = {Ativ Joshi and Abhishek Sinha},
  title = {{Universal Caching}},
  booktitle = {ITW},
  year = {2022},
  doi = {10.1109/itw54588.2022.9965906},
}
Figure