ML-Powered Search & RankingReal-time Search PersonalizationMedium⏱️ ~3 min

Dual Horizon Profiles: Short Term vs Long Term Personalization

Core Concept
Dual horizon profiles maintain two separate user representations: a long-term profile capturing stable preferences (updated daily/weekly), and a short-term profile capturing current session intent (updated with every interaction).

Long-Term Profile: Who The User Is

The long-term profile captures stable preferences: preferred categories, price sensitivity, brand affinities, typical browsing times. Built from months of interaction history, updated in batch (daily or weekly). Stored as a dense vector (embedding) of 128-512 dimensions or as explicit feature values (avg_price_clicked: 45, top_categories: [electronics, books]). Changes slowly: a user who's browsed electronics for 6 months doesn't become a fashion shopper after one dress click.

Short-Term Profile: What The User Wants Now

The short-term profile captures current session intent: last 5-20 clicked items, current query history, time spent on recent pages. Updated in real-time with sub-second latency. Stored in fast key-value stores for immediate retrieval. Volatile: resets at session end or decays within hours. A user shopping for a gift behaves differently than when shopping for themselves. Short-term captures this temporary context that long-term would average away.

Blending Strategy

Combine both profiles into a final personalization score: score = α × long_term_score + (1-α) × short_term_score. The blend weight α typically starts at 0.7 (favor long-term) and shifts toward short-term as session length increases. After 10+ interactions, short-term gets more weight (α=0.4) because current intent is clearer. Cold-start sessions with no clicks rely entirely on long-term (α=1.0).

When Single Horizon Fails

Long-term only: Misses intent shifts. User always buys running shoes, today searching for hiking boots. Long-term keeps pushing running shoes. Short-term only: Loses stable preferences. User clicks one cheap item, suddenly sees only budget options despite usually preferring premium. Dual horizon balances both: respects long-term while adapting to short-term signals.

💡 Key Takeaways
Long-term profile captures stable preferences from months of history; updated daily/weekly as embeddings or explicit features
Short-term profile captures current session intent from last 5-20 interactions; updated in real-time, resets at session end
Blending formula: score = α × long_term + (1-α) × short_term, where α shifts based on session length
Cold-start sessions (no clicks yet) use α=1.0 (all long-term); after 10+ interactions, shift to α=0.4
Single horizon fails: long-term misses intent shifts, short-term loses stable preferences
📌 Interview Tips
1Give the formula: score = α × long_term + (1-α) × short_term with α shifting from 0.7 to 0.4 as session grows
2Explain failure modes: long-term only keeps pushing running shoes when user wants hiking boots
3Mention profile storage: long-term as 128-512 dim embedding, short-term in fast key-value store
← Back to Real-time Search Personalization Overview
Dual Horizon Profiles: Short Term vs Long Term Personalization | Real-time Search Personalization - System Overflow