Why session-based recommendations matter

Most visitors to an online store are anonymous. Signed-in shoppers with accumulated history may be
20–40% of traffic; the other 60–80% arrive without an account or for the first time. Personalized
recommendations are unavailable to them — there is no profile.

Session-based recommendations close that gap: they work from the first action, using only the
current session as a signal source.

The algorithmic stack

How session recommendation algorithms evolved:

Algorithm Basis Characteristic
Item-based KNN Co-view patterns Simple, interpretable
GRU4Rec Recurrent networks (RNN) Accounts for event order
BERT4Rec Transformer (self-attention) Understands the whole session context
NARM RNN plus attention Balances local and global context

In practice most production systems run simpler algorithms with fast inference — BERT4Rec demands
significant compute on every refresh.

How a session algorithm builds a prediction

Shopper session:
  t=0: opened the card for Nike Air Max 270
  t=1: viewed Adidas Ultraboost
  t=2: added Nike Air Max 270 to the cart

Algorithm:
  → current interest: men's sneakers, urban style, mid-to-high price band
  → the cart signal reinforces the intent to buy Nike
  → recommendations: comparable sneakers, socks, shoe care

Every new event recomputes the intent vector for the session.

Combining with a long-term profile

For signed-in shoppers the optimal architecture is hybrid:

  • Session signal (high weight): what they are looking at right now — the immediate intent
  • Long-term profile (medium weight): category preferences, purchase history
  • Popularity (low weight): the fallback when personal signals are weak

The component weights are configurable and can be A/B tested.

Tip: session recommendations are particularly effective in product page blocks — Similar items,
People also viewed — where the shopper has already declared an intent the algorithm can extend in
a specific direction.