Cross-Attention Between User History and Candidate

Reported in interviews at TikTok

Problem statement

How would you make a video ranker attend to the parts of a user's history relevant to each candidate? The ranker scores many videos using embedded watch history, recency, candidate details and request context. The team wants candidate and history features to interact through cross-attention before the final scoring network, while keeping serving fast.

Define candidate attention, explain the failed reverse design and identify computations that can be shared.

Show hint

Ask which entity is asking the question "what in the user's past matters?" and which entity is being searched.

Relevant roles: ML Engineer, Applied Scientist and Research Scientist.

Related free problems