{
  "slug": "lfu-replacement",
  "term": "Least frequently used replacement",
  "aliases": [
    "LFU",
    "least frequently used"
  ],
  "definition": "Least frequently used replacement selects a resident entry with the lowest tracked access count, with behavior also determined by counting scope and tie-breaking.",
  "note": "The LFU name alone does not specify count lifetime, aging or how equal counts are ordered. In the pinned standalone implementation, insertion starts the count at one, hits increment it, and a tie evicts the most recently used candidate. [lfu-code]\n\nThe LeCaR expert in the same repository instead breaks equal-frequency ties by block identifier and can recover a previous count from eviction history. These choices can change eviction sequences even when both implementations are called LFU. [lecar-code]\n\nThe CACHEUS paper describes random tie-breaking for classic LFU. That description and the linked standalone implementation are different baseline specifications; neither should silently substitute for the other. [cacheus-paper] [lfu-code]",
  "status": "research",
  "advantages": [],
  "limitations": [],
  "related": [
    "lecar",
    "cacheus",
    "lru-replacement",
    "tinylfu",
    "lrfu",
    "ghost-cache-entry"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-14",
  "citations": [
    {
      "id": "lfu-code",
      "title": "Standalone LFU author implementation: count lifetime and tie-breaking; commit 1eec63ce166502be33ddd1f35bc041ed73a24f4d.",
      "url": "https://github.com/sylab/cacheus/blob/1eec63ce166502be33ddd1f35bc041ed73a24f4d/code/algs/lfu.py",
      "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": "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": "hesela",
      "title": "Hesela: expert feedback and LFU baseline identity.",
      "url": "https://hesela.com/analyses/sieve-cache-eviction-traces/#expert-feedback",
      "accessed": "2026-11-14"
    }
  ],
  "provenance": [
    "Primary-paper and pinned-source comparison, not execution of either baseline. The difference does not establish which implementation produced the historical published results."
  ]
}
