Problem
The subject line and pre-header decide whether a user opens a CRM email. Users like different styles: short and action-oriented, or long and informative with emojis. A classic A/B test gives each variant a fixed traffic share and picks one winner at the end. A test of 2-3 variants takes 4-6 weeks, 100 or more variants would take years, and the winner can be stale when it ships.
Example from the article: an Uber Eats email with the subject "Not sure what you want? Find it with Uber Eats" and the pre-header "Your food, your way", one of many combinations of subject and pre-header texts.
Solution in brief
Treat each subject-and-pre-header combination as a bandit arm and the user's features as context. Embed the variant text, shrink the embedding with PCA, and let a model predict the open probability per user and variant. Exploration comes from LinUCB for one campaign, or from SquareCB sampling on top of XGBoost scores across campaigns.
Questions this case answers
- How to pick the best of many text variants for each user when a fixed-split test is too slow and preferences differ between users
- How to add exploration to a supervised prediction model so that it works as a contextual bandit across campaigns
- How to choose the best email subject line and pre-header for each user instead of one winner for everyone?
- How to test 100 or more message variants without waiting weeks for a classic A/B test per pair?
Tools and methods
- LinUCB — linear model with a confidence bonus, one regression per variant in a campaign.
- XGBoost — predicts open probability from user and variant features across campaigns.
- SquareCB — turns XGBoost scores into sampling probabilities.
- text-embedding-ada-002 (GPT embedding model) — embeds the subject and pre-header text.
- PCA — shrinks the embedding to 128 features.
Google or a one-time email code. No password.