M9-038M9: Senior ML & AI System DesignRecSys, Ads & Search ArchitectureHard
⚡Flashcard Drill➔Mastery:
Design a Cross-Encoder-to-Student Distillation Pipeline for Sub-20ms Ranking
🎯 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
📐 Mathematical Definition
⚡ One-Sentence Core Answer
Distill heavy Cross-Encoder / LLM listwise teachers into sub-20ms Bi-Encoder or ColBERT late-interaction students via MarginMSE, dynamic hard negatives, and TensorRT INT8 serving.
📌 Key Takeaways
- •L1 Compute Bottleneck: full Query-Document cross-attention over 100 candidates takes 150-400ms, busting 20ms ranking SLAs
- •L2 Ranking-Aware Losses: distill teacher score margins via MarginMSE and listwise KL-divergence rather than binary cross-entropy
- •L2 Iterative Hard-Negative Mining: score student false-positive retrievals with the teacher asynchronously to eliminate blind spots
- •L3 Late-Interaction & TRT: serve pre-computed ColBERT token vectors via fast MaxSim or a 4-layer quantized TensorRT student under 20ms
📐 Mathematical Derivations
Listwise distillation minimizes , transferring relative ranking dark knowledge across all candidates.
🏭 Production Trade-offs
1) Bi-Encoder students hit <5ms but miss fine lexical alignment; ColBERT hits ~12ms with 10x token storage; 2) Keep a tiny 4-layer cross-encoder only on Top-20 if precision demands it.
⚠️ Common Interview Pitfalls
- ✕Distilling solely on easy random negatives, leaving the student blind on near-miss hard candidates
- ✕Benchmarking latency at batch=1 instead of realistic concurrent production queue depths
🎯 Interviewer Follow-up Inquiries
- ?How do you recalibrate distilled student logits when upstream stage probabilities feed downstream auction eCPM?
- ?How do you synthesize high-coverage listwise teacher labels cost-effectively from a 70B LLM reranker?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
📚