ThumbtackAndrew MorssProblem & solution
Building a Transformer-Based Category Recommender at Thumbtack
Summary
Thumbtack developed a transformer-based category recommender to personalize email and push notification suggestions across roughly 500 home service categories. Because user activity is sparse while contextual signals like location and climate are rich, the architecture represents search history and context features as sequences of tokens evaluated against candidate category tokens using cross-attention. Initial training with naive cross-entropy suffered from severe popularity bias, skewing recommendations toward head categories and yielding a low tail hit rate. To resolve this issue, the team implemented adaptive mixed sampling, combining in-batch and random negative candidates and keeping only top-scoring hard negatives for cross-entropy loss computation. This method raised tail hit rate from 2.1% to 28.4%, improved overall HR@10 to 54.6%, and yielded a statistically significant 5% lift in requests per user in production A/B testing.
Context
Thumbtack needed a recommender system to surface relevant service categories out of roughly 500 options for marketing notifications. Unlike platforms with frequent user activity, home service interactions are sparse, though rich contextual signals like location and climate exist. Initial model training with naive cross-entropy suffered from severe popularity bias, where the model over-indexed on high-volume head categories and ignored long-tail categories.
Approach / What changed
The team designed a multi-token transformer embedding user search history and contextual feature buckets into tokens, scoring candidate categories through cross-attention. To support varied campaign types, tokens are randomly masked during training and runtime. To mitigate popularity bias, Thumbtack implemented adaptive mixed sampling: each batch combines positive targets, in-batch negatives, and random negatives, scores them in one pass, keeps only top-K hard negatives, and calculates cross-entropy loss.
Takeaways
Training with naive cross-entropy on skewed category distributions resulted in popularity bias that degraded tail HR@10 to 2.1%.
A multi-token transformer with cross-attention enables runtime token masking, allowing a single model to support distinct campaign themes like location-based or activity-based recommendations.
Adaptive mixed sampling combining random, in-batch, and top-K hard negatives increased tail HR@10 to 28.4% and produced a 5% lift in requests per user in an A/B test.
Source and freshness
- Source
- medium.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.