# CACHEFORGE: LLM-Guided End-to-End Generative Cache Replacement Policy for Performance and Hardware Efficiency

DevFeed: [CACHEFORGE: LLM-Guided End-to-End Generative Cache Replacement Policy for Performance and Hardware Efficiency](<https://devfeed.tech/articles/cacheforge-llm-guided-end-to-end-generative-cache-replacement-policy-for-performance-and-hardware-efficiency-128150.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.07668>)

Author: Kaushal Mhapsekar, Bita Aslrousta, Brijesh Kumar Bhayana, Paula Contreras, Azam Ghanbari, Ethan Goodman, Anna Andriiko, Samira Mirbagher Ajorpaz

Published: 2026-11-11T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [CPU Cache](<https://devfeed.tech/topics/cpu-cache.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cache](<https://devfeed.tech/tags/cache.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-ar](<https://devfeed.tech/tags/cs-ar.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [generative](<https://devfeed.tech/tags/generative.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [ipc](<https://devfeed.tech/tags/ipc.md>), [language-model](<https://devfeed.tech/tags/language-model.md>), [large-language-model](<https://devfeed.tech/tags/large-language-model.md>), [llm](<https://devfeed.tech/tags/llm.md>), [memory](<https://devfeed.tech/tags/memory.md>), [mutation](<https://devfeed.tech/tags/mutation.md>), [performance](<https://devfeed.tech/tags/performance.md>), [policy](<https://devfeed.tech/tags/policy.md>), [prefetching](<https://devfeed.tech/tags/prefetching.md>), [replacement](<https://devfeed.tech/tags/replacement.md>), [reward](<https://devfeed.tech/tags/reward.md>), [scheduling](<https://devfeed.tech/tags/scheduling.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [spec](<https://devfeed.tech/tags/spec.md>), [temperature](<https://devfeed.tech/tags/temperature.md>)

## AI overview

CACHEFORGE uses an LLM-guided hardware-aware loop to generate and evolve cache replacement policies: it proposes C++ logic, evaluates it in the trace-based CRC-2 ChampSim simulator, and applies reward shaping, structural checks, mutation, temperature scheduling, and policy crossover to enforce feasibility and explore alternatives. Across SPEC CPU2006, the abstract reports total hit-rate gains over CRC-2 baselines ranging from 5.73% over LRU to 27.36% over MPPPB. On memory-intensive workloads, it reports IPC gains ranging from 2.71% over Hawkeye to 10.15% over LRU. These results are reported for the stated benchmarks and comparisons.

## Source excerpt

arXiv:2610.07668v2 Announce Type: replace-cross Abstract: Modern cache replacement designs saturate because they operate within fixed representational structures, hand-crafted and heuristic based feature-engineered predictors, or offline imitation models that cannot generate new decision logic on their own. At the same time, replacement is shaped by the causal interaction of prefetching, thrashing, spatial locality, and access-type behavior, producing an enormous design space that is difficult to traverse manually. Prior approaches typically rely on heuristics, parameter tuning, or imitation of an offline optimal policy, capturing correlations rather than synthesizing new mechanisms. As a result, their performance gains often plateau and they overfit under dynamic workload conditions. CACHEFORGE is the first framework to evolve cache-replacement policies end-to-end by embedding a large language model inside a governed hardware-aware loop. In each iteration, the LLM proposes new C++ replacement logic, the policy is evaluated under a trace-based CRC-2 ChampSim simulator, and the framework enforces feasibility through reward shaping, structural checks, dynamic mutation, temperature scheduling, and cross-policy crossover. This closed-loop generation-evolution loop specifically designed for cache replacement policy enables the discovery of compact policies that satisfy hardware constraints while exploring algorithmic transformations beyond fixed predictor structures. Across SPEC CPU2006, CACHEFORGE outperforms all CRC-2 baselines. It improves the total hit rate by 27.36%, 19.69%, 13.72%, 13.15%, 11.83%, and 5.73% over MPPPB, ReD, Hawk-eye, SHiP++, LIME, and LRU, respectively. On memory-intensive workloads, it increases IPC by 10.15%, 7.89%, 6.34%, 3.64%, 3.12%, and 2.71% over LRU, MPPPB, LIME, ReD, SHiP++, and Hawkeye.