Measuring What Synthetic Shopping Data Gets Wrong: Signed Purchase Dynamics with a Learned Residual

Recommender systems are increasingly trained on synthetic user histories. Generated data avoids privacy problems and can strip out logging artifacts, such as the bias toward items that happened to be shown at the top of a page. The most successful recent generator builds a graph of which items co-occur and samples random walks over it. That graph cannot tell two kinds of related items apart. Substitutes are rival items, like two phones: buying one should suppress interest in the other. Complements are items used together, like a phone and a case: buying one should raise interest in the other. A co-occurrence walk treats both as "related," so it produces synthetic histories in which people keep buying phone after phone. A recommender trained on those histories learns exactly the failure that real recommenders are criticized for.

We propose to generate synthetic purchase histories from a model with two parts. The first is a small, interpretable mechanism: after each purchase, interest in substitutes is pushed down and interest in complements is pushed up, and both effects fade with time. The second is a neural "residual" term that learns whatever real behavior the mechanism misses. Residual learning of this kind, where the known equation is kept and a network fills in the gap, is standard for physical systems. Here it has a second job. The size of the learned residual tells us how much real shopping behavior the substitute/complement story fails to explain, and we hypothesize that this quantity predicts how much real data the synthetic data can actually replace.

Core Claim

The claim has two parts. First, a generator whose dynamics carry the sign of item relations reaches a better synthetic-to-real exchange rate than an unsigned co-occurrence walk. The exchange rate is the number of synthetic histories needed to match the downstream accuracy of one real history. The same generator should also produce downstream recommenders that recommend fewer redundant substitutes right after a purchase.

Second, and more interesting, the fraction of real-log dynamics absorbed by the neural residual, rather than by the signed mechanism, should predict the synthetic data's exchange rate across product categories. The prediction is that categories dominated by substitute/complement structure, such as Cell Phones and Accessories, will show small residuals and good exchange rates. Categories driven by taste and novelty will show large residuals and poor exchange rates. If this holds, it gives practitioners a way to tell in advance, from the generator alone and before running downstream training, whether a synthetic corpus can be trusted. The absence of such a check is the real-world validation gap stressed by On the Equivalency, Substitutability, and Flexibility of Synthetic Data and by work on voting and energy markets (Learning Real-Life Approval Elections, Using Aggregation to Improve the Scheduling of Flexible Energy Offers).

How This Relates to Prior Work

Two papers supply the mechanism and define its limits.

Modeling Temporal Positive and Negative Excitation for Sequential Recommendation (SDIL) extends Hawkes processes, which are models where past events raise or lower the rate of future events. In SDIL, complements excite and substitutes inhibit, with decaying time kernels. It uses this inside a recommender, with item relations fixed from metadata. We reuse its signed kernel, but as a generator of training data, with a learned residual on top and the relation signs allowed to update.

Learning Graph ODE for Continuous-Time Sequential Recommendation (GDERec) splits preference change into smooth drift plus jumps at interactions. That is the same drift-plus-shock structure we use. However, every jump in GDERec is an unsigned attraction, which is precisely the conflation we remove.

Neural Utility Functions motivates the project. It shows that unconstrained networks almost never behave like valid utility functions. It enforces substitution structure through gradient-ratio penalties on static ratings, and it validates on planted Cobb-Douglas and CES worlds (standard textbook utility functions with a known degree of substitutability). We borrow the planted-world validation style.

Two papers on synthetic data motivate and constrain the evaluation.

Principled Synthetic Data Enables the First Scaling Laws for LLMs in Recommendation generates histories with Node2Vec walks, a random-walk method over an item co-occurrence graph. Under train-on-synthetic, test-on-real (TSTR) it reports a large gain over raw logs. It also reports two failure modes: popularity bias inherited from the graph's edge weights, and "inverse scaling" once synthetic sequences are repeated more than about 16 times. Our generator has to beat this walker on its own protocol, and its behavior under heavy repetition must also be checked.

On the Equivalency, Substitutability, and Flexibility of Synthetic Data supplies the measurement tools we transplant from video tracking: equivalency ratios and replacement curves. It also supplies the key precedent. On DanceTrack, behavioral complexity in synthetic agents mattered more than surface realism. Walking-only synthetic agents hurt tracking, while group-interaction agents raised HOTA, a standard tracking-accuracy score, from 68.8 to 73.5. Our substitute/complement mechanism is the recommender analogue of that behavioral complexity.

Two papers supply the method.

ABM-UDE shows how to embed a network inside a mechanistic rate term so that the outputs stay non-negative. It also stabilizes training across abrupt regime changes with multiple shooting (fitting short segments with continuity penalties at the joins) and an observer-style correction toward observed data. We adapt both, because shopping sequences contain abrupt shocks such as sales and new product launches.

APIC addresses a known problem with additive residuals: the residual can silently duplicate or cancel the mechanism. It does this by orthogonalizing the neural part against the symbolic part. We need the same property, because our diagnostic is meaningless if the residual absorbs dynamics the mechanism already explains.

The Generator

Each user carries a purchase intensity $\lambda_c(t)$ for each product category $c$, meaning the instantaneous rate at which they buy in that category. We work at category level so the parameters stay manageable and because horizontal cross-category relations are known to be informative (Exploiting both Vertical and Horizontal Dimensions of Feature Hierarchy for Effective Recommendation). The intensity is

$$\lambda_c(t) = \mathrm{softplus}\Big(\mu_c + \sum_{t_i < t} s_{c_i c}\,\alpha_{c_i c}\,e^{-\beta_{c_i c}(t - t_i)} + r_\theta\big(h(t), c, t\big)\Big),$$

where the symbols are as follows:

  • $\mu_c$ is a baseline rate.
  • The sum runs over the user's past purchases, at times $t_i$ in categories $c_i$.
  • $s_{c_i c} \in [-1, 1]$ is a relation sign. It is initialized from Amazon's "also viewed" links (a substitute proxy, negative sign) and "also bought" links (a complement proxy, positive sign), following the supervision used by Inferring Networks of Substitutable and Complementary Products. It is then refined on logs with a penalty for moving away from the prior.
  • $\alpha$ and $\beta$ are effect strength and decay rate.
  • $r_\theta$ is a small neural network. It reads a summary $h(t)$ of the user's history and outputs the residual.

The sum of exponential kernels is equivalent to a linear ODE that jumps at each purchase. The model is therefore a residual differential equation in exactly the sense used for physical systems, with the neural term acting as a closure. We fit it by maximum likelihood of the point process, integrating over segments in the multiple-shooting style.

To keep the residual from impersonating the mechanism, we penalize the correlation between $r_\theta$ and the mechanism's kernel features on the training data, in the spirit of APIC. We then define the residual share of each category as

$$\rho_c = \frac{\mathbb{E}\,[r_\theta^2]}{\mathbb{E}\,[m_c^2] + \mathbb{E}\,[r_\theta^2]},$$

where $m_c$ is the mechanistic pre-activation, the term inside the softplus excluding $r_\theta$. With the correlation penalty in place, $\rho_c$ is approximately the fraction of intensity variation that the mechanism leaves unexplained.

Once a category is sampled, the specific item is drawn from the item's catalog neighborhood. To avoid inheriting popularity bias, we use flattened popularity weights, which directly addresses the popularity weakness noted for the Node2Vec walker.

Research Program

The work proceeds in three stages.

Stage 1: planted world. We build a toy shopping world in which agents maximize CES utilities with known substitution elasticities and known complement pairs. We add an unmodeled novelty-seeking drift of controllable strength. This tests whether the fitted signs recover the true relations, and whether $\rho_c$ rises monotonically with the strength of the planted drift. Without this calibration, the diagnostic claim is untestable.

Stage 2: real data and the key measurements. We fit the generator on Amazon Cell Phones and Accessories, Beauty, and Toys and Games, the three SDIL categories, using review timestamps as purchase events. We add one taste-driven category from the same catalog, such as Music as used by GDERec, as a deliberate high-residual contrast. For every generator, we train SASRec, a standard self-attention next-item recommender, on synthetic data only and on mixtures of synthetic and real data, and we test on held-out real sequences. We measure three things:

  • Equivalency ratio: synthetic sequences needed to match the accuracy of $n$ real sequences.
  • Replacement curve: accuracy as a growing fraction of real data is swapped for synthetic data.
  • Redundancy rate: the fraction of top-10 recommendations made within a short window after a purchase that are substitutes of the purchased item, stratified by elapsed time.

Stage 3: scale check. We repeat the TSTR comparison against the Node2Vec walker on MerRec, a 1.2-billion-interaction e-commerce dataset, including the repetition sweep that exposed inverse scaling in Principled Synthetic Data Enables the First Scaling Laws for LLMs in Recommendation.

Baselines

The naive reference is SASRec trained on real logs only. It anchors the equivalency ratio and replacement curves, and it is the model every synthetic corpus must eventually help.

The strongest existing generator is the Node2Vec co-occurrence walker of Principled Synthetic Data Enables the First Scaling Laws for LLMs in Recommendation, reimplemented with its published walk settings. That paper reports a +130% improvement in Recall@100 for SASRec trained on its synthetic data versus raw logs, on its own data. No absolute Recall@100 value, and no result on the Amazon categories, was found on Lacuna, so we will re-establish its numbers under our splits before comparing. It is the right competitor because it is the only recommender-specific synthetic pipeline with a TSTR result.

For a fair comparison, every generator produces the same number of synthetic events from the same training users. The downstream SASRec keeps a fixed architecture, and every configuration receives the same hyperparameter-search budget, which is 20 trials selected on real validation data. Beating the walker means two things at once: a lower equivalency ratio with non-overlapping bootstrap intervals in at least three of the four categories, and a lower redundancy rate.

The strongest existing recommender that uses signed dynamics is SDIL itself, trained on real data. Against its strongest baseline on Cell Phones it reports a 10.45% relative MRR gain; no absolute MRR is given in the file. SDIL is not a generator. It tells us whether synthetic data from a signed-dynamics generator, mixed with real data, lets plain SASRec approach a purpose-built signed-dynamics model. Matching SDIL's MRR on Cell Phones with plain SASRec on a mixed corpus would count as a strong result.

Two ablations isolate the key ingredients. The first drops the residual, which gives a pure signed Hawkes generator. The second keeps everything but forces all signs positive, which gives an unsigned Hawkes generator with a residual. The first ablation isolates what the neural residual contributes; the second isolates what the sign contributes.

Why not just…?

Why not just use SDIL's signed Hawkes process as the generator, with no neural residual? This is the most serious alternative, and it is plausible that it matches our generator on Cell Phones, where substitute/complement structure dominates. We treat it as the first ablation and accept either outcome. If it matches everywhere, the residual adds no accuracy, but we still learn that sign alone drives synthetic quality. The residual share $\rho_c$ remains useful as the reliability check, because it can only be computed from a model that has a residual. The generator claim fails only if the mechanism-only version matches and $\rho_c$ fails to predict the equivalency ratios across categories. That combination would mean the residual is doing no work at all.

Why not just patch the Node2Vec walker with typed edges, blocking substitute steps after a purchase? This is cheap and captures the sign. It has no clock, however. Real inhibition is strongest right after a purchase and fades, as SDIL's decaying kernels encode, and replacement purchases are legitimate later on. We include the typed walker as an extra baseline and compare redundancy rates stratified by elapsed time. The typed walker should over-suppress long-gap repurchases and under-suppress nothing. If it matches our generator in every time stratum, the continuous-time machinery is unnecessary, and we will say so.

Why not just train a transformer on real logs and sample synthetic histories from it? A black-box generator reproduces whatever the logs contain, including the exposure and popularity biases that motivated synthetic data in the first place. The Node2Vec paper reports an item Gini coefficient above 0.95 in real logs versus about 0.64 in its synthetic data. A black-box generator also provides no interpretable quantity that could serve as a reliability check. We include it as a baseline and report its Gini, its equivalency ratio, and its behavior under the repetition sweep, where memorization should appear first.

Why not just skip synthetic data and train on the real logs? On raw logs, larger recommenders failed to beat smaller ones (the PLUM result reported in the Node2Vec paper), and synthetic data corrected this. More importantly, the real-only model is our naive reference: every equivalency ratio is measured against it, so this alternative is answered directly by the replacement curves.

Decisive Checks

Three results would settle the proposal.

Planted world. Fitted signs must recover the planted substitute/complement structure with high agreement, and $\rho_c$ must increase with the planted novelty strength. If $\rho_c$ does not track the known unexplained dynamics, it cannot be used as a reliability check on real data.

Real categories. Across the four real categories, and across category splits within them, the Spearman rank correlation between $\rho_c$ and the log equivalency ratio must be clearly positive. It must also remain positive after controlling for category size and sparsity, since those are the obvious confounds. This is the core scientific claim, and it fails cleanly if the correlation vanishes.

Downstream behavior. Relative to the Node2Vec walker, our generator must lower the short-window redundancy rate of downstream SASRec without hurting Recall@10 by more than bootstrap noise. It must also degrade more slowly than the walker under the repetition sweep beyond 16 repeats. The expectation behind the second condition is that a small mechanistic core gives the model less idiosyncratic sequence detail to memorize, but this is a hypothesis the sweep will test rather than a given.