TL;DR
Traditional web search caches struggle to retain moderately popular queries that fluctuate based on time or context. This paper introduces the Static-Topic-Dynamic (STD) cache, which adds a topic-aware layer to partition cache space according to topic popularity. By capturing topic-specific temporal patterns, STD boosts cache hit rates by up to 3.6% and closes the gap to the theoretical optimal caching strategy by over 35%.
What Problem Does This Paper Address?
Web search engines process millions of queries a second. To minimize latency, backend server workloads, and electricity costs, they rely heavily on result caching. The standard industry approach is the Static-Dynamic Cache (SDC). SDC splits cache space into two:
- A static portion populated offline with globally popular, evergreen queries (e.g., "facebook", "google").
- A dynamic portion that uses a Least Recently Used (LRU) eviction policy to catch sudden, short-term bursts of traffic.
However, SDC fails to capture a massive middle ground: moderately popular queries with periodic, topic-specific temporal locality. For example, queries about "weather forecast" spike in the morning, while "football scores" spike on weekends. These queries aren't globally popular enough to sit in the static cache permanently, and they aren't searched frequently enough within a tiny time window to survive the rapid turnover of a general dynamic LRU cache. They fall through the cracks, causing avoidable cache misses.
Methods
The authors propose the Static-Topic-Dynamic (STD) cache architecture, which introduces a third layer specifically for topic-based caching.
1. Three-Layer Architecture
The cache space is divided into three distinct components:
- Static Cache ($S$): Stores the absolute most frequent queries overall.
- Topic Cache ($T$): Subdivided into $k$ independent sections, one for each topic (e.g., banking, education, health). Space can be allocated equally or proportionally to the topic's historical popularity.
- Dynamic Cache ($D$): A standard LRU cache that handles queries with no clear topic or highly transient bursts.
2. Query Topic Distillation via LDA
Because search queries are notoriously short and ambiguous (e.g., "apple"), the authors train a Latent Dirichlet Allocation (LDA) topic model on query-document pairs. They enrich the raw query terms with the full text of the web pages users actually clicked on in the logs. A voting scheme then assigns a single dominant topic to each query based on historical click volume.
3. Cache Management Workflow
When a query arrives, the system checks the static cache first. If it misses, it identifies the query's topic and checks that specific topic's sub-cache. If it misses again (or has no topic), it falls back to the general dynamic cache.
The authors experimented with multiple configurations, finding that managing each topic's sub-cache using its own mini-SDC strategy ($STD^v_{SDC}$) yielded the highest hit rates.
Datasets
The approach was evaluated using two massive, real-world query logs:
- AOL Query Log: ~36M records from 2006, filtered down to a stream of 20M unique query-click events.
- MSN Query Log: ~14.9M records, yielding 8.8M records with clicked URLs.
- Enriched Document Collection: 1M web pages for AOL and 2.1M for MSN were crawled from the clicked URLs to provide the rich textual context needed to train the LDA model (configured to discover $k=500$ topics).
Key Insights and Ideas
- Topics Have "Longer Memories" Than Queries: The core "aha moment" is that while individual queries might seem sporadic, grouping them by topic reveals stable, predictable temporal rhythms. The average distance between misses in topic caches is much larger than in a standard LRU cache, meaning topic-based caching successfully retains items over longer, stretched-out intervals.
- Proportional Sizing Prevents Starvation: Allocating cache space dynamically based on topic popularity ($STD^v$) significantly outperforms fixed sizing ($STD^f$). It ensures dominant topics get the retention power they need without letting niche topics waste precious cache slots.
- Hybridizing the Topic Layer Wins: Treating each topic slot as a mini-SDC (Static-Dynamic Cache) rather than a pure LRU cache performs best. It allows the system to capture both the "evergreen" queries within a specific topic and sudden topical bursts simultaneously.
Key Results
- Hit Rate Boost: Across various cache sizes (64K to 1024K entries), the STD model consistently outperformed the SDC baseline. It achieved absolute hit rate increases of up to 3.6% on the AOL dataset and 2.0% on the MSN dataset.
- Closing the Gap to Perfection: Compared to Bélády’s theoretical optimal (clairvoyant) caching algorithm—which requires knowing the future—STD reduced SDC's performance gap by up to 36.51% for AOL and 31.04% for MSN.
- Synergy with Admission Policies: When paired with query admission policies (which filter out "polluting" or one-hit-wonder queries), STD maintained its edge, pushing hit rates even closer to the theoretical upper bound.
Limitations and Future Work
- Cold Start / Unclassified Queries: The system cannot assign a topic to entirely new queries or queries without historical click data. These default to the general dynamic cache, meaning the system's performance is bound by its topic classification coverage (which was 65% for AOL and 58% for MSN in testing).
- Future Directions: The authors suggest exploring short-text topic modeling techniques that don't rely as heavily on crawling clicked page content. They also plan to investigate how to integrate STD with lower-level backend caches, such as those storing inverted index posting lists.
Summary updated