Researchers from Snap Inc. and Utrecht University have developed a Transformer-based framework for General-Purpose Behavioral Log-based User Modeling (G-BLUM) specifically for instant messaging (IM) platforms. By training on low-level event logs—such as swipes and clicks—rather than sensitive content, their model creates versatile user representations that excel at predicting account safety, engagement, and churn, often using as few as 128 recent actions.
The Challenge of User Modeling in Instant Messaging
User modeling typically relies on task-specific models or sensitive data like private messages and GPS locations. While general-purpose models have succeeded in e-commerce and search, IM apps present unique challenges. Unlike intent-driven search sessions, IM usage is sustained and dynamic, spanning a variety of "fuzzy" intentions from casual chatting to media consumption. Furthermore, IM sequences are naturally long and ever-growing. This research tests whether privacy-friendly behavioral logs can produce high-quality representations in the complex environment of an app like Snapchat.
Methodology
The G-BLUM framework utilizes a customized Transformer-based architecture (12 layers, 768 hidden size) with two primary training objectives:
- Masked Behavior Prediction (MBP): Similar to BERT, the model learns to predict a "masked" user action based on the surrounding context.
- User Contrastive Learning (UCL): This is the "secret sauce" for personalization. The model is trained to ensure that different behavior sequences from the same user result in similar representations, while sequences from different users remain distinct.
To handle long sequences, the researchers employed ALiBi (Attention with Linear Biases). Unlike standard positional encodings, ALiBi allows the model to extrapolate and process behavioral histories much longer than those seen during training without performance degradation.
Experimental Setup and Datasets
The study utilized a massive real-world dataset from Snapchat, consisting of a random sample of approximately 766,000 active U.S. users and 577 unique behavior types (e.g., "sending a chat," "viewing a story"). The model was evaluated on three novel downstream tasks:
- Reported Account Prediction: Identifying users likely to be reported for malicious behavior.
- Ad View Time Prediction: Predicting engagement with advertisements.
- Account Self-deletion Prediction: Identifying users at risk of churning.
Key Results and Analysis
The model consistently outperformed traditional baselines like TF-IDF and standard BERT/GPT-2 implementations across all tasks.
- User Retrieval: The model achieved a Mean Reciprocal Rank (MRR) exceeding 0.90, scaling effectively with sequence length.
- Safety and Churn: G-BLUM showed high predictive power, achieving AUC scores approaching 0.90 for both reported accounts and self-deletions up to a week in advance.
- Efficiency: Sequences as short as 128 events ($2^7$) were sufficient to generate effective representations, suggesting that G-BLUM can replace methods requiring months of historical data.
The Power of Contrastive Learning
A critical insight from the ablation study was the role of User Contrastive Learning (UCL). While MBP helps the model understand actions, UCL is what allows it to distinguish between individual users.
As shown in the table above, the "Ours" model (G-BLUM) maintains a significantly higher difference between within-user and between-user similarity (0.4050) compared to baselines, validating the effectiveness of the contrastive approach in creating distinct user identities.
Limitations and Future Work
Predicting ad view time remained the most challenging area, likely because engagement depends on external factors like ad creative content and user cognitive state. Future work may explore incorporating explicit temporal metadata (e.g., time-of-day) and testing the transferability of these behavioral vocabularies across different IM platforms like WhatsApp or Telegram.
Summary updated