Skip to main content
QUICK REVIEW

[Paper Review] An Imitation Learning Approach for Cache Replacement

Evan Liu, Milad Hashemi|arXiv (Cornell University)|Jun 29, 2020
Data Stream Mining TechniquesComputer Science5 citations
TL;DR

This paper proposes Parrot, an imitation learning approach that trains a cache replacement policy to mimic Belady's optimal oracle policy using only past access patterns. By leveraging supervised imitation learning with a neural network, Parrot achieves 20% lower miss rates than state-of-the-art heuristics on SPEC CPU workloads and 61% higher cache hit rates on a large-scale web search benchmark, demonstrating significant performance gains over traditional policies like LRU.

ABSTRACT

Program execution speed critically depends on increasing cache hits, as cache hits are orders of magnitude faster than misses. To increase cache hits, we focus on the problem of cache replacement: choosing which cache line to evict upon inserting a new line. This is challenging because it requires planning far ahead and currently there is no known practical solution. As a result, current replacement policies typically resort to heuristics designed for specific common access patterns, which fail on more diverse and complex access patterns. In contrast, we propose an imitation learning approach to automatically learn cache access patterns by leveraging Belady's, an oracle policy that computes the optimal eviction decision given the future cache accesses. While directly applying Belady's is infeasible since the future is unknown, we train a policy conditioned only on past accesses that accurately approximates Belady's even on diverse and complex access patterns, and call this approach Parrot. When evaluated on 13 of the most memory-intensive SPEC applications, Parrot increases cache miss rates by 20% over the current state of the art. In addition, on a large-scale web search benchmark, Parrot increases cache hit rates by 61% over a conventional LRU policy. We release a Gym environment to facilitate research in this area, as data is plentiful, and further advancements can have significant real-world impact.

Motivation & Objective

  • To address the challenge of designing effective cache replacement policies for diverse and complex memory access patterns, where traditional heuristics like LRU fail.
  • To explore whether imitation learning can be used to train a policy that approximates Belady’s optimal replacement policy, which requires future access knowledge.
  • To develop a generalizable, end-to-end learned replacement policy that outperforms existing heuristic-based approaches.
  • To release a Gym environment to enable reproducible research in cache replacement and facilitate future work in systems ML.

Proposed method

  • The method frames cache replacement as an imitation learning problem, where the model learns to mimic Belady’s optimal policy using only past access sequences as input.
  • A deep neural network is trained to predict the optimal eviction decision based on historical access patterns, directly imitating the oracle policy without requiring future knowledge.
  • The approach uses supervised learning with demonstrations from Belady’s algorithm, which is computed using full future access traces during training.
  • The model is trained end-to-end on real-world workloads, including SPEC CPU benchmarks and a large-scale web search trace.
  • Additional supervised tasks are introduced to improve generalization and performance beyond standard imitation learning.
  • The framework is extended to support hierarchical caching and is released as a Gym environment for broader research use.

Experimental results

Research questions

  • RQ1Can an imitation learning approach effectively approximate Belady’s optimal cache replacement policy using only past access information?
  • RQ2Can a learned policy generalize across diverse and complex memory access patterns better than heuristic-based policies?
  • RQ3How does end-to-end imitation learning compare to prior approaches that use binary classification of cache lines (e.g., cache-friendly vs. cache-averse)?
  • RQ4What performance gains can be achieved in real-world workloads, such as SPEC CPU applications and web search systems?
  • RQ5How can the practical deployment challenges of learned replacement policies—such as latency and memory overhead—be mitigated?

Key findings

  • Parrot reduces cache miss rates by 20% compared to the current state-of-the-art replacement policy on 13 memory-intensive SPEC CPU applications.
  • On a large-scale web search benchmark, Parrot increases cache hit rates by 61% over the conventional LRU policy.
  • The proposed imitation learning framework enables a policy to approximate Belady’s optimal behavior even without access to future data, outperforming prior methods that rely on intermediate heuristics.
  • The method generalizes well across diverse programs with different access patterns, as shown by ablation studies demonstrating varying behavior across workloads.
  • The release of a Gym environment for cache replacement enables reproducible research and supports future work in hierarchical caching and reinforcement learning.
  • The results suggest that end-to-end imitation learning is a promising path for learning effective cache replacement policies with significant real-world impact.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.