Abstract: Similarity caching allows requests for an item to be served by a similar item. Applications include recommendation systems, multimedia retrieval, and machine learning. Recently, many similarity caching policies have been proposed, like SIM-LRU and RND-LRU, but the performance analysis of their hit rate is still wanting. In this paper, we show how to extend the popular time-to-live approximation in classic caching to similarity caching. In particular, we propose a method to estimate the hit rate of the similarity caching policy RND-LRU. Our method, the RND-TTL approximation, introduces the RND-TTL cache model and then tunes its parameters in such a way to mimic the behavior of RND-LRU. The parameter tuning involves solving a fixed point system of equations for which we provide an algorithm for numerical resolution and sufficient conditions for its convergence. Our approach for approximating the hit rate of RND-LRU is evaluated on both synthetic and real world traces.
Introduction: The Challenge of Similarity Caching
In traditional caching, a request is a "hit" only if the exact item is stored. Similarity caching shifts this paradigm: a request for item $A$ can be satisfied by a "similar enough" item $B$. This is essential for modern applications like content-based image retrieval, recommendation engines, and AI inference, where finding a close match is often faster and "good enough" compared to fetching the perfect result from a distant server.
The primary challenge lies in performance analysis. In classic caching, items are treated as independent. In similarity caching, items are strongly coupled: one item in the cache can serve requests for hundreds of its neighbors. This coupling makes calculating the "hit rate" mathematically daunting. Existing models for classic Least Recently Used (LRU) policies fail because they don't account for these "approximate hits" or the complex ways neighbors interact to keep each other in the cache.
The RND-TTL Approximation
The authors introduce the RND-TTL approximation, which builds upon "Che’s approximation" (or TTL approximation) commonly used in classic networking. The goal is to model the behavior of the RND-LRU policy.
The RND-TTL approach involves several key steps:
- The RND-TTL Model: A theoretical cache is proposed where every item $n$ has a timer ($T$). If the timer hits zero, the item is evicted.
- Decoupling through Parameters: To handle the "coupling" problem, each item is assigned an insertion rate ($\lambda_n^i$) and a refresh rate ($\lambda_n^r$). These parameters represent how often an item is pushed into the cache or kept alive by requests for itself or its neighbors.
- Fixed-Point Iteration: Finding the right parameters requires solving a system of $3N+1$ equations (where $N$ is the number of items). The authors provide a parameterized iterative algorithm to find the "occupancy probability" (the fraction of time an item spends in the cache).
- Convergence Analysis: Mathematical proofs for the existence of a solution and sufficient conditions for convergence ensure the tool is reliable for practical use.
Experimental Setup
The model was evaluated using two distinct datasets:
- Synthetic Traces: A catalog of 10,000 items arranged on a 2D grid. Popularity followed a Zipf-like distribution (skewness parameter $\alpha$), and similarity was defined by Euclidean distance.
- Amazon Trace: A real-world dataset of ~10,000 products. Items were mapped into a 100-dimensional vector space (embeddings) where Euclidean distance represents product similarity. Requests were generated based on actual Amazon review patterns.
Core Insights
- The "Chessboard" Effect: In similarity caching, the cache often develops a "regular pattern" (like a chessboard) where specific items stay in the cache to "cover" their neighbors, rather than storing every popular item.
- Similarity as a Life-Extender: In classic LRU, an item is only refreshed when it is requested. In similarity caching, an item's life in the cache is extended whenever a request for a neighbor results in an approximate hit. This significantly boosts the "characteristic time" an item stays in the cache.
- Beyond Naive Aggregation: Simple models that just sum neighbor request rates ("LRU-agg") are inaccurate because they ignore how the presence of one neighbor affects the insertion probability of others.
Performance Evaluation
- Superior Accuracy: The RND-TTL model consistently outperformed baselines. While standard LRU models significantly underestimated the hit rate, the authors' model tracked empirical results closely across various cache capacities.
- Efficiency: The iterative algorithm typically converges in fewer than 50 iterations, even for large catalogs, making it a viable tool for real-time system design.
- Predictive Power: The model correctly predicted that similarity caching provides a massive performance boost—in some synthetic cases, doubling the hit rate compared to exact caching for the same cache size.
Conclusion and Future Directions
While highly accurate, the model tends to slightly underestimate the hit rate due to assumptions of perfect symmetry in occupancy that don't fully capture local clusters in real-world traces. Future work aims to provide more rigorous analytical proofs of accuracy and extend the framework to even more complex similarity policies beyond RND-LRU.
Summary updated