FPMC

FPMC (Factorizing Personalized Markov Chains) is a sequential recommendation algorithm introduced by Steffen Rendle, Christoph Freudenthaler, and Lars Schmidt-Thieme in their 2010 WWW paper “Factorizing Personalized Markov Chains for Next-Basket Recommendation”. The model combines two complementary signal sources: matrix factorization (which captures the user’s general taste from their long-term history) and Markov chains (which capture short-term sequential patterns from the most recent items). The combination is implemented through a factorized personalized transition cube — a third-order tensor with axes for users, source items, and target items, factored using a Tucker-style decomposition into three latent matrices. FPMC was the first widely-cited sequential recommender to bridge user personalization with sequence modeling, and it remained the standard sequential baseline for nearly a decade until deep methods like GRU4Rec and SASRec displaced it. The conceptual lesson — that user-personal taste and short-term sequential context are complementary signals that should be modeled together — propagated into all subsequent sequence-aware recommenders.

1. The Problem and the Conceptual Approach

The setting is next-basket prediction: a user has completed some baskets (sets of items purchased together at one shopping trip) and the recommender must predict items for the next basket. This was the original e-commerce framing of sequential recommendation, before the field broadened to include music-session, video-watch, and click-stream variants.

Two different recommendation paradigms address this task:

Personalized matrix factorization — learn user vectors that capture general preference and recommend based on long-term taste. Strength: personalization. Weakness: ignores recent activity.

Markov chain models — learn item-to-item transition probabilities P(j | i) from sequential data and recommend items most likely to follow what the user just bought. Strength: captures recent context. Weakness: not personalized — same predictions for every user given the same recent item.

FPMC combines both. The model learns a personalized transition matrix per user — a tensor T ∈ ℝ_{≥0}^{m × n × n} where T[u, i, j] = P(j ∈ next basket | i ∈ previous basket, user u). Each user has their own item-to-item transition probabilities, capturing both personal taste and sequential context.

2. The Tensor Factorization

A naive personalized transition tensor has m · n² parameters — infeasible at any meaningful scale. FPMC factorizes the tensor using a pairwise interaction model (a special case of Tucker decomposition):

ŷ_{u, i_{t-1}, j} ≈ ⟨V^{UI}_u, V^{IU}_j⟩  +  ⟨V^{IL}_{i_{t-1}}, V^{LI}_j⟩  +  ⟨V^{UL}_u, V^{LU}_{i_{t-1}}⟩

where:

  • i_{t-1} is an item from the user’s previous basket.
  • j is the candidate next item.
  • The model has six different latent matrices, capturing pairwise interactions between users (U), the to-item (I), and the last-item (L). The naming convention is V^{XY} for “the latent matrix for entity X in its interaction with Y.”
  • V^{UI} and V^{IU} capture the user-item interaction (how much user u likes item j in general — the standard MF user-item factorization).
  • V^{IL} and V^{LI} capture the last-to-next item transition (Markov chain transition probabilities, factorized).
  • V^{UL} and V^{LU} capture the user-last interaction (which last items typically appear in this user’s baskets).
  • The dot products are taken in the latent dimension k.

The third term ⟨V^{UL}_u, V^{LU}_{i_{t-1}}⟩ is constant with respect to j (the candidate next item) and so does not affect the ranking of candidates. The paper drops it for ranking-based training, leaving the prediction:

ŷ_{u, i_{t-1}, j}  =  ⟨V^{UI}_u, V^{IU}_j⟩  +  ⟨V^{IL}_{i_{t-1}}, V^{LI}_j⟩

The first term is the user’s general preference for item j; the second term is the transition score from the user’s last item to j.

For users with multiple items in their previous basket, the predictions are averaged across the items.

3. Training with BPR

FPMC is trained with Bayesian Personalized Ranking adapted to the sequential setting: for each observed (user, last-basket, next-basket) example, sample positive items j ∈ next basket and negative items j' ∉ next basket, and minimize:

L_BPR = − Σ ln σ( ŷ_{u, i_{t-1}, j} − ŷ_{u, i_{t-1}, j'} )  +  λ · regularization

The model parameters (six latent matrices) are updated by SGD on this loss.

4. When to Use FPMC

FPMC was state-of-the-art for next-basket prediction in 2010. In 2026, it is mostly used as a baseline in sequential recommendation papers; modern deep alternatives (GRU4Rec, SASRec, BERT4Rec) substantially outperform it. Use FPMC if:

  • You need a strong, simple baseline for sequential recommendation.
  • The catalog is small enough that the latent matrices fit in memory.
  • You want an interpretable model — the factorization separates user-taste, sequential-transition, and user-last-item effects clearly.

5. Strengths

  • Bridges personalization and sequence modeling. First widely-cited algorithm to do so.
  • Conceptually clean — the three-way decomposition is interpretable.
  • Works with BPR ranking loss — production-aligned objective.

6. Weaknesses

  • First-order Markov only. Cannot capture longer-range dependencies (the model conditions only on the immediately preceding basket).
  • Outdated — modern deep alternatives substantially outperform on standard benchmarks.
  • Cold start unchanged — ID-based.

7. See Also