Two-Tower User Embeddings for Low-Latency Session Recommendations
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Online systems face inefficiencies in identifying candidate items for recommendation due to high latency when evaluating numerous items, leading to user retention issues.
Innovation Solution
A two-tower model is employed, comprising an item tower and a user tower, with the user tower having a long-term and short-term sub-tower, to compute user embeddings efficiently, allowing for low-latency item recommendations by combining long-term and short-term embeddings.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If the online system evaluates each item to determine whether it should be recommended to the user, then the recommendation accuracy is improved, but the user experiences high latency
Solution Approach 1:
The user representation is segmented into two distinct components: a long-term embedding that captures stable user preferences and a short-term session embedding that captures dynamic session context. This segmentation allows the system to pre-compute the long-term component offline, reducing online evaluation time while maintaining comprehensive user profiling for accurate recommendations.
Solution Approach 2:
The long-term user embedding is pre-computed offline using historical data and stored for reuse. This preliminary action eliminates the need to re-process historical user data during each recommendation session, significantly reducing online latency while preserving the ability to make accurate recommendations based on comprehensive user profiles.
2Quantity of substance
If the online system evaluates thousands of items for recommendation, then the coverage of recommended items is improved, but the computational resources required increase
Solution Approach 1:
The evaluation process is segmented into offline pre-computation of long-term embeddings and online computation of short-term session embeddings. This segmentation allows comprehensive evaluation of thousands of items against pre-computed user profiles without requiring full re-evaluation of all user data for each item, significantly reducing computational resource consumption while maintaining broad item coverage.
Solution Approach 2:
The long-term user embedding serves as a compressed representation or copy of extensive historical user data. Instead of accessing and processing the full historical dataset during online evaluation, the system uses this pre-computed embedding copy, which captures essential user preferences in a compact form, enabling efficient evaluation of numerous candidate items.
3Measurement precision
If the user tower uses comprehensive input features for embedding computation, then the user profile accuracy is improved, but the computation time increases
Solution Approach 1:
The input features are segmented into two categories: contextually constant features (demographics, historical preferences) that are processed offline to create long-term embeddings, and contextually dynamic features (session context, current interactions) that are processed online to create short-term embeddings. This segmentation enables comprehensive feature utilization for accurate user profiling while minimizing online computation time by limiting real-time processing to only the dynamic features.
Solution Approach 2:
The processing of comprehensive user features is performed preliminarily offline to generate long-term embeddings. This preliminary computation of extensive user profiles using all available historical data eliminates the need for repeated processing during online sessions, maintaining high user profile accuracy while reducing online computation time to only the necessary short-term session feature processing.
Data Source
AI summary
An online system accesses a two-tower model trained to identify candidate items for presentation to users, in which the model includes an item tower trained to compute item embeddings and a user tower trained to compute user embeddings. The user tower includes a long-term sub-tower trained to compute long-term embeddings for users and a short-term sub-tower trained to compute short-term embeddings for users. The model is trained based on item data associated with items, user data associated with users, and session data associated with user sessions. The system uses the item tower to compute an item embedding for each of multiple candidate items. The system also uses the long-term sub-tower to compute a long-term embedding for a user. The system then receives session data associated with a current session of the user and uses the short-term sub-tower to compute a short-term embedding for the user based on this session data.


