When a shopper lingers on a product page, the delay can mean interest or confusion, and a fixed rule cannot tell which. Purchases, the outcome a store cares about most, happen in only a small fraction of sessions. Models that predict them get very few positive examples to learn from, and they usually treat each past click as a yes/no event, discarding how long the shopper stayed. This note proposes a small sequence model that does two jobs at once. At every step it predicts how long the shopper should stay on the next item, given everything seen so far in the session. It then measures how surprising the actual stay was, and passes that surprise to a second job: flagging, as early as possible, the rare sessions that will end in a purchase.
The core idea in two sentences: dwell time only means something relative to what was expected, and for anonymous shoppers the only usable baseline is the session itself. So we learn that baseline from the dense dwell signal and spend it on the sparse purchase signal. The dense task gives the rare-event detector a calibrated, cold-start-safe reading of each dwell. The rare purchase labels, read backwards, tell us when a long stay meant satisfaction and when it meant friction.
Core Claim
Existing ways of making dwell time meaningful normalize it against a reference that anonymous sessions do not have. CPRS (User Modeling with Click Preference and Reading Satisfaction for News Recommendation) divides reading speed by the user's historical mean, so it fails on new or guest users. TRUST (TRUST: Item-Calibrated Interval Evidence for Temporal Session-Based Recommendation) scores intervals against item-level distributions, but it ignores the trajectory around the dwell. It also assumes deviation means unreliability, when deviation could be either deep interest or struggle. The Hassan et al. study of developer search logs (An Empirical Study of Software Exceptions in the Field using Search Logs) is the motivating evidence that long dwell often signals failed searching rather than success.
We claim that a causal sequence model can supply the missing reference: a model that only looks backwards in time, trained to predict each next dwell. The standardized gap between observed and predicted dwell is a better input for rare purchase detection than raw dwell, log dwell, or item-percentile dwell. We further claim the advantage should grow as purchases become rarer, because the dwell task trains the shared encoder on every step of every session while the purchase head sees only a handful of positives.
Concretely, at step $t$ a shared encoder produces a state $h_t$ from events $1..t$. A dwell head outputs the mean $\mu_t$ and spread $\sigma_t$ of a log-normal distribution over the upcoming dwell $\tau_{t}$. Log-normal is the form JUMP (JUMP: a Jointly Predictor for User Click and Dwell Time) found fits log dwell well, and like JUMP we use a survival likelihood for the right-censored final event. The surprise is
$$z_t = \frac{\log \tau_t - \mu_t}{\sigma_t},$$
which is fed back as an input feature at step $t+1$. A purchase head reads $h_t$ and outputs $p_t$, the probability that the session ends in a purchase. Training minimizes
$$\mathcal{L} = \sum_t \ell_{\text{surv}}(\tau_t;\mu_t,\sigma_t,c_t) + \lambda \sum_t w_{y}\,\ell_{\text{BCE}}(p_t, y),$$
where $c_t$ marks censoring, $y$ is the session's purchase label, $w_y$ upweights positives, and $\lambda$ balances the two tasks.
What Is Different From Prior Work
The closest prior work pairs dwell time with clicks, not with rare outcomes. JUMP jointly predicts the next click and log-normal dwell with recurrent highway units, using a fixed loss weighting. It evaluates next-click recall and dwell error, not conversion. ORCA (ORCA: Mitigating Over-Reliance for Multi-Task Dwell Time Prediction with Causal Decoupling) shows that click-plus-dwell multi-task models in mixture-of-experts architectures take a shortcut through the click signal and collapse dwell predictions into extreme values. Click reweighting at WeChat (Reweighting Clicks with Dwell Time in Recommendation) hand-engineers thresholds and a saturating sigmoid on per-instance features, without modeling the session.
All three use dwell to clean up click labels. We instead use dwell prediction as an instrument: the model's own expectation becomes the normalizer, and a rare downstream outcome is the target. On the rare-event side, P3STop (Click-aware purchase prediction with push at the top) shows that loss design matters for rare purchases and that clicked-but-not-bought items carry information. It treats clicks as binary, though, so it ignores dwell entirely. We borrow its lesson about loss design and add the duration channel it leaves out.
ORCA's finding acts as a constraint on our design rather than support for it. If the dwell head collapses toward extremes, the surprise $z_t$ becomes uninformative. We therefore monitor the calibration of the dwell head directly, using the probability integral transform of observed dwells, rather than trusting the joint loss.
Research Program
The encoder is a stack of dilated causal convolutions: one-dimensional filters that see only past steps and skip progressively more steps per layer, so the history they cover grows exponentially with depth. This is the design Franceschi et al. (Unsupervised Scalable Representation Learning for Multivariate Time Series) showed scales to very long series. We run it over event index rather than wall-clock time. The irregular gap and the previous surprise enter as per-event inputs alongside the item embedding, which sidesteps the even-spacing assumption that the survey by Benidis et al. (Deep Learning for Time Series Forecasting: Tutorial and Literature Survey) flags.
We choose convolutions for a practical reason, not as the scientific claim. Strict causality makes per-step early-warning predictions leak-free by construction. Training is also parallel across steps, so we can afford many runs in the positive-subsampling sweeps below. The architecture is held fixed across most comparisons, and a recurrent version is run once to confirm that conclusions do not depend on it.
Idle-tab outliers are handled in two ways. Dwell is clipped at a high quantile before taking logs, and a heavy-tailed alternative to the log-normal is tried in one ablation.
The program has three parts.
- Purchase detection. We build the joint model and the surprise feature, and test whether surprise beats simpler dwell encodings for rare purchase detection.
- Rarity sweep. We subsample purchasing sessions in the training set to make positives progressively rarer, and track how each method degrades.
- What long dwell means. We read the trained model backwards. Conditioning on large positive surprises, we ask whether the conversion probability rises or falls depending on what follows: a quick jump to an unrelated category versus a revisit or a related item. A sign flip there would be direct evidence that the model has separated satisfaction from friction without any user profile.
Baselines
The naive reference point is a cost-weighted purchase classifier over the same causal convolutional encoder that sees item identities and gaps but no dwell-derived features. It fixes how much signal clicks alone carry. Any dwell method must beat it to justify itself.
The strongest simple competitor is the same single-task encoder given dwell directly, as log dwell and as a TRUST-style item-percentile rank computed on training data. Each is trained with the same weighted cross-entropy and, separately, with a focal loss. This is the real threat. If a well-tuned network can learn its own normalization from raw log dwell, our auxiliary task is redundant.
The strongest published rare-purchase method is P3STop. On RecSys 2015 it reports an 11.35% relative improvement in Recall@10 and a 6.75% relative improvement in NDCG@10 over implicit-feedback baselines. The file gives only these relative gains, so there is no absolute number to quote. For session-level purchase detection with precision-recall metrics, no reported result found on Lacuna for YOOCHOOSE or DIGINETICA. All baselines will therefore be rerun under our protocol. We also adapt P3STop's top-push loss as an alternative purchase-head loss on our encoder, so that loss design and dwell modeling are separated.
For the multi-task side, we compare joint training against a two-stage pipeline. In the pipeline, the dwell model is trained alone, frozen, and its surprises are fed to a separately trained purchase model. We also compare against joint training with RotoGrad (RotoGrad: Gradient Homogenization in Multi-Task Learning), which rescales and rotates task gradients so a gradient-heavy task cannot dominate the shared layers. A recurrent encoder (GRU) with the same heads checks the architecture choice.
The key ablation removes $z_t$ as an input while keeping the auxiliary dwell loss. This tests whether gains come from the surprise feature itself or merely from extra supervision of the shared layers.
Fairness rules apply to every comparison:
- All methods use identical session splits.
- Purchase events are excluded from inputs.
- Each method gets the same number of hyperparameter trials, with its class weight or focal parameter tuned on validation precision-recall area.
- Results are averaged over at least five seeds.
Beating the strongest baseline means a higher area under the precision-recall curve and a higher recall at a fixed low false-alarm rate. The improvement must exceed the seed spread, and it must hold or widen in the rarer subsampled regimes.
Why not just…?
Why not just feed log dwell into a cost-sensitive classifier? This may genuinely work as well, and the experiment is designed to find out. The argument against it is that the right reference for a dwell depends on item and trajectory jointly. The purchase head sees too few positives to learn that dependency, while the dwell head learns it from every step. If raw log dwell matches surprise at every rarity level, we will report that the auxiliary task is unnecessary and the contribution reduces to the analysis of what long dwell means.
Why not just normalize dwell per item, as TRUST does? Item calibration ignores what the shopper did before and after, and the friction-versus-interest question is exactly about that context. The item-percentile baseline measures how much the session context adds beyond the item. If the gap is negligible, the item reference is sufficient and simpler.
Why not just use a better rare-event loss and ignore dwell? P3STop shows loss design yields real gains on RecSys 2015 purchases. We test loss and dwell modeling factorially on the same encoder, so the two effects can be measured separately rather than conflated.
Why not train the dwell model separately and skip joint learning? The two-stage pipeline is cheaper and immune to the shortcut collapse ORCA documents. If it matches joint training, we will prefer it. Joint training should help only if purchase gradients reshape the shared encoder in useful ways, and RotoGrad tells us whether gradient conflict is what limits the joint model.
Proposed Experiments
We use YOOCHOOSE (RecSys Challenge 2015), whose click logs carry timestamps and separate buy records. Sessions are truncated at the first buy to prevent leakage, and the final event's dwell is treated as censored. We use DIGINETICA (CIKM Cup 2016) as the second dataset, which includes dwell and transactional logs. Base purchase rates are computed from the data rather than assumed.
Metrics are as follows:
- Session-level detection: area under the precision-recall curve, and recall at false-alarm rates of 1% and 0.1%.
- Early detection: the fraction of eventual buyers flagged by step $k$.
- Dwell head sanity check: dwell error on DIGINETICA against JUMP's reported dwell MAE of 180.6 on CIKM16, plus a calibration histogram of the dwell head.
The decisive checks are three.
- Surprise versus raw dwell. Surprise-fed joint training must beat the raw-log-dwell single-task baseline at equal tuning budget.
- Rarity sweep. Training positives are subsampled to 10% and 1% of the original buying sessions. The method's advantage should widen as positives shrink. If it stays flat or narrows, the dense-supervision argument is wrong.
- Sign flip. Among high-surprise dwells, conversion rates should differ in sign depending on whether the next action is a bounce or a related revisit. Cold-start credibility is checked by restricting evaluation to sessions shorter than five events.
A positive result on all three would establish session-calibrated dwell surprise as a usable, profile-free signal for rare outcomes. A negative result on the first two would cleanly show that raw dwell is enough.
References
- User Modeling with Click Preference and Reading Satisfaction for News Recommendation
- TRUST: Item-Calibrated Interval Evidence for Temporal Session-Based Recommendation
- An Empirical Study of Software Exceptions in the Field using Search Logs
- JUMP: a Jointly Predictor for User Click and Dwell Time
- ORCA: Mitigating Over-Reliance for Multi-Task Dwell Time Prediction with Causal Decoupling
- Reweighting Clicks with Dwell Time in Recommendation
- Click-aware purchase prediction with push at the top
- Unsupervised Scalable Representation Learning for Multivariate Time Series
- Deep Learning for Time Series Forecasting: Tutorial and Literature Survey
- RotoGrad: Gradient Homogenization in Multi-Task Learning