Recommendation SystemsReal-time Personalization (Session-based, Contextual Bandits)Hard⏱️ ~3 min

Trade-offs: Exploration Rate, Latency, and Session Length

EXPLORATION RATE TRADEOFF

More exploration (10-20% of traffic) means faster learning about new items and changing preferences, but it shows suboptimal items to real users, reducing short term revenue. Less exploration (1-5%) protects revenue but adapts slowly. A product catalog that changes weekly needs more exploration than one that changes monthly. Start with 5-10% and adjust based on regret metrics.

LATENCY VS PERSONALIZATION DEPTH

Richer context (100+ features) improves predictions but increases inference time. A linear model with 20 features runs in 1ms. A neural network with 200 features takes 20ms. For real-time personalization with 100ms budget, you might afford one neural model or five linear models. Choose based on how much lift additional features provide.

🎯 Decision Framework: Use bandits when you need continuous learning (changing catalog, cold start). Use session models when sequences strongly predict intent (e-commerce browsing). Use both when you need sequence understanding plus exploration.

SESSION LENGTH CONSIDERATIONS

Short sessions (1-3 actions) have little signal; fall back to historical or popular. Medium sessions (4-15 actions) benefit most from real-time personalization. Long sessions (20+ actions) may indicate confused users who need help, not more personalization. Tailor strategy to session length distribution in your product.

WHEN NOT TO USE REAL-TIME PERSONALIZATION

Skip it when session intent rarely differs from historical (subscription services with stable preferences), when catalog is small (fewer than 1,000 items), or when users browse randomly without clear sequences. The infrastructure cost is only justified when conversion lift exceeds 10%.

💡 Key Takeaways
Exploration 10-20% learns fast but hurts short-term revenue; 1-5% protects revenue but adapts slowly
Linear model with 20 features: 1ms. Neural net with 200 features: 20ms. Budget accordingly.
Bandits for continuous learning, session models for sequence prediction, both for full coverage
Short sessions (1-3 actions): use historical. Medium (4-15): real-time shines. Long (20+): user might be confused
Skip real-time personalization if conversion lift is under 10% - infrastructure cost is not justified
📌 Interview Tips
1Discuss exploration rate: weekly catalog changes need 10%, monthly changes need 3%
2Walk through latency budget: 100ms allows one neural model or five linear models
3Explain when to skip: stable subscription preferences, small catalogs under 1000 items
← Back to Real-time Personalization (Session-based, Contextual Bandits) Overview