{
  "slug": "learned-bloom-filter",
  "term": "Learned Bloom filter",
  "aliases": [
    "Sandwiched learned Bloom filter"
  ],
  "definition": "A learned Bloom filter combines a membership classifier with a backup filter containing stored keys that the classifier rejects.",
  "note": "The classifier's positive answer is a candidate, not an exact lookup. Every stored key rejected at the chosen threshold must enter the backup filter; this supplies the no-false-negative property for the represented set, not classifier accuracy alone. The original SIGMOD design evaluates absent queries from a held-out workload. [learned-index]\n\nLet a be the classifier-positive fraction of absent queries and b the backup-positive fraction conditional on classifier rejection. Total FPR is a + (1-a)b. The denominator contains absent queries only. A changed query distribution can change a without changing the stored keys. [learned-model]\n\nA sandwiched design first checks a Bloom filter holding all stored keys, then the classifier and backup. Its exact probability decomposition is p0 times [a0 + (1-a0)b0], where a0 and b0 are conditional on reaching their stages. Using unconditioned rates instead needs a justified model of the hash construction and query selection. [hesela-example]\n\nMemory comparisons include the learned model and every filter. Replacing a model or threshold can change which stored keys need backup coverage; revalidate that coverage before publishing the replacement. [learned-index] The sandwiched design trades extra hash work for early rejection; its theoretical space optimum is not a universal throughput result. [learned-model]",
  "status": "research",
  "advantages": [],
  "limitations": [
    {
      "text": "A held-out false-positive rate is not a distribution-free guarantee for later queries.",
      "citationIds": [
        "learned-model"
      ]
    }
  ],
  "related": [
    "bloom-filter",
    "sstable",
    "proteus-range-filter"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-10",
  "citations": [
    {
      "id": "learned-index",
      "title": "Kraska, Beutel, Chi, Dean and Polyzotis. The Case for Learned Index Structures. SIGMOD 2018, section 5.1. DOI: 10.1145/3183713.3196909.",
      "url": "https://www.cl.cam.ac.uk/~ey204/teaching/ACS/R244_2018_2019/papers/Kraska_SIGMOD_2018.pdf",
      "accessed": "2026-11-10"
    },
    {
      "id": "learned-model",
      "title": "Mitzenmacher. A Model for Learned Bloom Filters and Optimizing by Sandwiching. NeurIPS 2018, sections 3-5.",
      "url": "https://proceedings.neurips.cc/paper_files/paper/2018/file/0f49c89d1e7298bb9930789c8ed59d48-Paper.pdf",
      "accessed": "2026-11-10"
    },
    {
      "id": "hesela-example",
      "title": "Hesela: exact hypothetical learned-filter probabilities and conditional-stage counterexample; not a trained-model benchmark.",
      "url": "https://hesela.dev/research/learned-bloom/README.md",
      "accessed": "2026-11-10"
    }
  ],
  "provenance": [
    "Primary-source synthesis and an exact rational probability example; no model training, device measurement or paper benchmark replication."
  ]
}
