Growing Intent States for Drifting Recommendations

Sequential recommenders predict a user's next item from the items they touched before. They struggle most at the moments that matter: when a user pivots, for example from browsing thrillers to searching for children's films, or from commuting check-ins to weekend nightlife. Standard self-attention recommenders average over history. A replication study found that this averaging acts like a low-pass filter that smooths such pivots away (A Systematic Replicability and Comparative Study of BSARec and SASRec for Sequential Recommendation). A second problem is that the set of behaviours users exhibit changes over time, and a model with a fixed internal structure has no explicit way to notice that a new kind of behaviour has appeared.

We propose to keep a trained sequential recommender frozen and place a small, interpretable model on top of its item embeddings. This top model is a hidden Markov model (HMM): a model in which each user moves between a few unobserved "intent states," each emitting items from a region of embedding space. The number of states is not fixed. As new time blocks of data arrive, the model is refit by expectation-maximization (EM), an algorithm that alternates between inferring which state each interaction came from and re-estimating the states. A statistical test borrowed from speech recognition then decides whether a state should be split because it now covers two distinct behaviours, or pruned because it has become empty. Each user's current probability of being in each intent state is a short, drift-aware summary. It is fed, together with the frozen recommender's scores, to a gradient-boosted tree reranker over the top candidates.

Core Claim

Explicitly detecting and representing regime changes at the population level, with a structure that grows only when a statistical test says a new behaviour is real, will improve next-item accuracy specifically on pivot steps. The comparison point is both end-to-end attention models and fixed-structure latent models of equal final size. The gain on non-pivot steps should be negligible. The claim is falsifiable in a sharp way: the benefit must concentrate on pivot steps, and it must disappear when the growth mechanism is replaced by a fixed state count or when time order is shuffled.

Freezing the neural encoder is not a stylistic choice here. It is what makes growing a state space meaningful. If the embedding space were retrained each block, previously discovered states would drift out from under their parameters. The split between neural features and a statistical top layer therefore serves as the stability constraint that allows structural adaptation.

Relation to Prior Work

The mechanism for growing states comes from speech. Adaptive HMM topology for speech recognition triggers the addition of states or mixture components with chi-square similarity tests on covariances, and updates parameters by Bayesian maximum-a-posteriori estimation. On TIMIT it reports 63.7% phone accuracy, against 60.9% for a static 16-mixture HMM. Factor analyzed HMM topology for speech recognition makes the similarity test cheap by computing it in a low-dimensional factor space. Automatic topology generation of glottal source HMM grows states by successive splitting with a minimum-description-length stopping rule. We reuse these tests and stopping rules. None of these papers touches user behaviour or neural embeddings, and all adapt to a fixed speaker or voice rather than to a population whose behaviours change across calendar time.

The alternation between latent inference and structure change is supplied by structural EM. The closest example is COMMAND in Joint Discovery of Skill Prerequisite Graphs and Student Models, which alternates between inferring hidden student mastery and refining a prerequisite graph. COMMAND assumes the graph is stationary and learns it once. Our structure changes block by block, and states can be retired as well as created.

The motivation comes from the recommendation literature. Self-Attentive Sequential Recommendation (SASRec) established causal self-attention as the standard backbone. BSARec adds a frequency-domain high-pass bias to recover fine-grained shifts and beats SASRec on MovieLens-1M and Foursquare-NYC (BSARec study). BSARec is our strongest competitor because it attacks the same symptom. Its remedy is still a fixed architecture with no notion of when a shift is genuine and when it is noise. Towards Explainable Conversational Recommendation separates a long-term "global view" from a short-term "local view." It does this with hand-built concepts and a static concept graph, and does not infer or grow latent intents.

The tree reranker follows the neural-features-plus-trees line. Deep Learning for Hate Speech Detection in Tweets reports that LSTM embeddings fed to gradient-boosted trees reach 0.930 F1, against 0.753 for a character n-gram baseline. Decoupling Neural Feature Extraction from Final Classifiers shows that deep features with random forests work from 15 samples per class. Those results are on small label sets. Tree heads scale poorly to tens of thousands of items, so we restrict the trees to reranking a few hundred candidates. That is standard practice and not a contribution in itself. The contribution is the drift features the trees receive.

Research Program

We first train SASRec or BSARec on the earliest time block and freeze it. We project its item embeddings to a low-dimensional space with factor analysis, following Ting et al. The intent HMM has Gaussian emissions in that space and a transition matrix shared across users. Sharing matters because single-user trajectories are too sparse to support individual structure.

For each subsequent time block we run EM. The E-step runs forward-backward over each user's sequence. The M-step re-estimates means, covariances and transitions. After EM converges, each state $s$ is tested for a split. We fit a two-component alternative to the interactions weighted by that state's responsibilities, and accept the split when the gain in log-likelihood outweighs the description-length cost of the new parameters:

$$ \Delta_s = \big[\log L_{\text{split}}(s) - \log L(s)\big] - \frac{\Delta p}{2}\log N_s > 0, $$

where $L$ is the likelihood of state $s$'s weighted data, $\Delta p$ is the number of added parameters, and $N_s$ is the state's effective occupancy count. The penalty term is the standard minimum-description-length / BIC cost. States whose occupancy falls below a threshold are merged into their nearest neighbour by symmetric KL divergence. This controls the parameter explosion that the speech literature flags as the main risk of growing states.

At serving time, a forward filter gives each user's current state posterior and the entropy of that posterior. These signals, plus the time since the last change in the most likely state, the backbone's score for each candidate, and each candidate's likelihood under each state, are the inputs to a LightGBM-style reranker over the backbone's top 200 candidates. The reranker is retrained each block. The backbone is not.

Baselines

The naive reference points are a popularity ranker and a frozen SASRec trained on the first block and never updated. The frozen SASRec shows how much drift costs a model that ignores it.

The strongest existing method is BSARec, run with the replication study's released protocol. It is retrained on all data up to each block with the same tuning budget, measured in GPU-hours and hyperparameter trials, that we give our full pipeline. The reported figures we must reproduce before comparing are NDCG@10 of 0.07704 on MovieLens-1M and NDCG@5 of 0.2668 on Foursquare-NYC, against 0.2334 for SASRec (BSARec study). Our temporal block-wise protocol differs from their leave-one-out split, so we report both. Beating BSARec means a statistically significant NDCG@10 gain on pivot steps in the temporal protocol, across three seeds, while staying within noise of BSARec on non-pivot steps. For Amazon Beauty, Amazon Games and Steam, there is no reported result found on Lacuna for per-dataset SASRec numbers, so we produce our own.

Two further baselines isolate the key ingredients. The first is the frozen backbone plus the same tree reranker fed only backbone scores and simple recency features. The difference between it and our full pipeline is attributable to the intent-state features. The second is a fixed-size HMM whose state count equals the final count our growing model reaches, trained by ordinary EM on all blocks. It isolates whether growth itself matters, as opposed to simply having enough states.

Why not just…?

Why not just retrain BSARec on a recent sliding window? This is the most serious threat, because window retraining handles slow population drift cheaply. It does not by itself say when an individual user has pivoted, and short windows discard long-term profile information. We treat window length as a tuned hyperparameter, within the same budget. If window-retrained BSARec matches us on pivot steps, the proposal fails on its central claim, and we will report it that way.

Why not just use a fixed number of clusters or a fixed HMM? The speech evidence favours adaptive structure: 63.7% versus 60.9% at comparable parameter scale (Adaptive HMM topology for speech recognition). That result is on acoustics, not users. The matched fixed-size HMM baseline settles the question directly, and a time-shuffled control, which should remove any advantage of growing states, checks that growth tracks genuine temporal change.

Why not just add a simple change-point feature, such as the distance of the latest item from the user's recent centroid? This could capture much of the pivot signal at almost no cost. We include it as a reranker feature in the second ablation. The HMM must add value beyond it. It could do so by predicting which new region the user is heading toward, rather than only detecting that a pivot happened. If it adds nothing, the honest conclusion is that a simple detector suffices.

Why not just learn an end-to-end switching dynamical model? Models like End-to-End Identifiable and Consistent Recurrent Switching Dynamical Systems fix the number of regimes in advance and co-train the representation. That makes it hard to add regimes without disturbing old ones. We consider this an interesting follow-up but do not claim it would fail.

Proposed Experiments

We use MovieLens-1M and Foursquare-NYC, which have published BSARec numbers, plus Amazon Beauty, Amazon Games and Steam from SASRec. Each is split chronologically into blocks, and every model is evaluated on block $t+1$ after seeing blocks up to $t$.

A test step counts as a pivot when the true next item lies in the top decile of distance from the user's last-ten-item centroid. Distance is computed with a separately trained embedding model, so the definition does not favour our own encoder. We report HR@10 and NDCG@10 overall and split by pivot and non-pivot, along with state count over blocks and serving latency per request.

The decisive checks are three. The gain over BSARec must be concentrated on pivot steps. The matched fixed-size HMM and the time-shuffled growing model must lose most of that gain. The HMM features must add value beyond the simple centroid-distance feature. As a qualitative check, we inspect whether split events coincide with identifiable catalogue or seasonal shifts, such as new movie genres entering the ratings. The design deliberately makes each ingredient removable, so a negative result will say which part of the idea was unnecessary.