{
  "slug": "lecar",
  "term": "LeCaR",
  "aliases": [
    "Learning Cache Replacement"
  ],
  "definition": "LeCaR is a cache replacement policy that learns a probability distribution over LRU and LFU eviction choices from remembered eviction mistakes.",
  "note": "An eviction expert is sampled using its current weight, rather than always choosing the larger weight. A miss on a remembered victim penalizes the responsible expert; the original design discounts this penalty with time spent outside the cache and uses a fixed learning rate. [lecar-paper]\n\nBoth experts describe the same resident cache, not two independently running caches. In the pinned implementation, agreement on a victim bypasses attribution history; an entry forgotten from bounded history also cannot trigger a later weight penalty. Absence of a penalty therefore does not certify a good eviction. [lecar-code]\n\nCACHEUS revisits the expert pair and adapts the learning rate to address workload-dependent weaknesses. [cacheus-paper]",
  "status": "research",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-14",
  "related": [
    "cacheus",
    "lru-replacement",
    "ghost-cache-entry",
    "adaptive-replacement-cache",
    "cache-pollution",
    "lfu-replacement"
  ],
  "citations": [
    {
      "id": "lecar-paper",
      "title": "Vietri et al. Driving Cache Replacement with ML-based LeCaR. HotStorage 2018, sections 3-4.",
      "url": "https://www.usenix.org/system/files/conference/hotstorage18/hotstorage18-paper-vietri.pdf",
      "accessed": "2026-11-14"
    },
    {
      "id": "cacheus-paper",
      "title": "Rodriguez et al. Learning Cache Replacement with CACHEUS. FAST 2021, pp. 341-354, sections 3-6.",
      "url": "https://www.usenix.org/system/files/fast21-rodriguez.pdf",
      "accessed": "2026-11-14"
    },
    {
      "id": "lecar-code",
      "title": "LeCaR author implementation: evict, addToHistory, miss and adjustWeights; commit 1eec63ce166502be33ddd1f35bc041ed73a24f4d.",
      "url": "https://github.com/sylab/cacheus/blob/1eec63ce166502be33ddd1f35bc041ed73a24f4d/code/algs/lecar.py",
      "accessed": "2026-11-14"
    },
    {
      "id": "hesela",
      "title": "Hesela: source-reviewed eviction feedback cases.",
      "url": "https://hesela.com/analyses/sieve-cache-eviction-traces/#expert-feedback",
      "accessed": "2026-11-14"
    }
  ],
  "provenance": [
    "Primary-paper and pinned-source review. No author simulator execution or reproduction of workload hit rates.",
    "The consensus-eviction detail is scoped to the linked implementation, not asserted as a line in the original LeCaR pseudocode."
  ]
}
