M9-042M9: Senior ML & AI System DesignRisk, Pricing & Large-Scale RetrievalHard
⚡Flashcard Drill➔Mastery:

Design a Hybrid SPLADE + Dense Vector Retrieval Engine with Selectivity-Aware Pre-Filtering

🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
Next: M9-043 →
📐 Mathematical Definition
Scorehybrid=α⋅s^dense(q,d)+(1−α)⋅s^SPLADE(q,d),selectivity ρ∈(0,1]\text{Score}_{\text{hybrid}} = \alpha \cdot \hat{s}_{\text{dense}}(q, d) + (1-\alpha) \cdot \hat{s}_{\text{SPLADE}}(q, d),\quad \text{selectivity } \rho \in (0,1]
⚡ One-Sentence Core Answer
Pair learned sparse expansion (SPLADE) with dense embeddings, and dynamically switch between exact pre-filter scans and inline HNSW traversal based on filter selectivity.

📌 Key Takeaways

  • •
    L1 Sparse-Dense Synergy: SPLADE preserves exact SKU/acronym recall plus learned term expansion where dense embeddings blur specifics
  • •
    L2 Unified Hybrid Index: co-locate Dense HNSW and Sparse inverted postings in Qdrant/Vespa for single-pass scoring
  • •
    L2 Selectivity Cliff: below ~1% filter selectivity, standard HNSW pre-filtering fractures graph connectivity and drops recall sharply
  • •
    L3 Cost-Based Query Planner: estimate filter cardinality via histograms—run inline HNSW above ~5% selectivity and exact SIMD scan over bitmap IDs below ~1%

📐 Mathematical Derivations

SPLADE computes term weights via wj=max⁡i∈dlog⁡(1+ReLU(Wvocabhi)j)w_j = \max_{i \in d}\log(1+\text{ReLU}(W_{\text{vocab}}h_i)_j) regularized by LFLOPs\mathcal{L}_{\text{FLOPs}} to keep inverted posting lists sparse.

🏭 Production Trade-offs

1) RRF avoids fragile score normalization across sparse/dense distributions, whereas calibrated convex weights outperform when tuned on golden pairs; 2) Prune SPLADE weights to Top-128 non-zeros.
⚠️ Common Interview Pitfalls
  • ✕
    Running unguided HNSW pre-filtering on tight 0.2% tenant/date slices where graph traversal stalls
  • ✕
    Training SPLADE without FLOPs sparsity regularization, bloating inverted posting lists with stop-words
🎯 Interviewer Follow-up Inquiries
  • ?
    How does ACORN two-hop predicate-aware graph traversal bridge the 1%-5% selectivity gap cleanly?
  • ?
    How do you adapt SPLADE lexical expansion when supporting mixed CJK and English enterprise corpora?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

← PreviousM9-041: Design a Speculative Decoding + Automatic Prefix Cache Serving Benchmark & Engine📋 Back to BankNext →M9-043: Design a Sub-25ms Parallel Guardrail & Streaming Output Safety Pipeline