Client Time Series Model: a Multi-Target Recommender System based on Temporally-Masked Encoders

14 Oct 2022

Problem

Stitch Fix scores every client-item pair with p(sale), the probability that a client buys an item. Each time the business grew (Mens, the UK, Freestyle), the team forked a new model, because a domain-agnostic model served the new channel worse. Maintenance exploded, and learning stayed locked inside business lines, regions and channels. The old tabular models also ignored the time dimension of client interactions.

Example from the article: a client changes the waist size from 42 to 41. Recommendations should reflect it at once, and training examples from the time of size 42 must not see 41.

Solution in brief

One embedding per client is updated by every timestamped event. Separate mappings turn it into predictions for each target. An attention-like encoder with a GRU-style gate updates the state, so one model, pipeline and endpoint replace the per-segment models.

Questions this case answers
  • How to serve many prediction targets across business lines, regions and channels with one model instead of a fork per segment
  • How to build a user representation that updates event by event and stays free of future-data leakage in training
  • How to replace many segment-specific recommendation models with one model that serves several targets?
  • How to keep a client representation current so that every new interaction changes recommendations immediately?

Tools and methods

  • Unified client embedding — a single hidden state per client, with separate mappings to each prediction domain.
  • Temporally-Masked Encoder (TME) — transformer-like encoder with one set of weights per sequence and a triangular mask.
  • Gated update (GRU-style) — carries the client hidden state between subsequences.
  • EmbeddingBag item embeddings — an item vector is the sum of its feature embeddings.
  • Updates and targets — two event types: state changes and outcomes with their own loss.
  • A/B tests — CTSM against the predecessor models in every segment before rollout.
Continue reading — it's free

Google or a one-time email code. No password.