Source-linked AI summary
DeepAffinity: Long-Term Aspect Preference Prediction in eCommerce using Small Language Models
Yotam Eshel, Guy Hadad, Guy Feigenblat, Yuri M. Brovman, Matt Gearhart, Bracha Shapira
TL;DR
eCommerce personalization needs predictions of users’ future preferences for product aspects such as brand, size, and color, including their temporal evolution. DeepAffinity addresses this with a Small Language Model using structured prompts and specialized prediction heads, outperforming alternative approaches and improving recommendation quality. Its current representation captures event order but not explicit timestamps, time gaps, or periodic patterns.
Problem
Existing work has limited coverage of predicting general aspect preferences and their interactions, although such predictions matter for fine-grained personalization.
Method
DeepAffinity fine-tunes a Small Language Model on time-ordered user histories with structured inputs, affinity embeddings, and category-conditioned prediction heads for aspect values.
Results
DeepAffinity consistently outperforms alternative methods, including heuristic baselines, fine-tuned generative models, and zero-shot general-purpose LLMs, and improves production recommendation quality.
Takeaways & Limitations
Task-specific input-output design and targeted fine-tuning support fine-grained temporal preference modeling with small models in eCommerce recommendation settings.
Takeaways & Limitations
DeepAffinity uses event order and a fixed 24-hour prediction horizon but does not explicitly encode timestamps, inter-event gaps, or periodic patterns.
Abstract
from arXiv · showhide
We explore predicting eCommerce user preferences for product aspects such as brand, size, and color - a task we define as Aspect Affinity. Solving this task improves customer understanding and enables fine-grained personalization in recommendation, search, and marketing. We frame Aspect Affinity as a temporal prediction task: forecasting a users future aspect choices from their time-ordered interaction history, capturing long-term preferences that evolve beyond the current session. To this end, we propose DeepAffinity, which leverages Small Language Models (SLMs) with structured prompts and specialized prediction heads fine-tuned for this task. We show DeepAffinity outperforms standard generative fine-tuning methods, while general-purpose open-source LLMs perform poorly without task-specific tuning, highlighting their limits in modeling nuanced behavior. Finally, DeepAffinity enhances recommendation quality on a large-scale multinational eCommerce platform.
1 Introduction
The paper frames fine-grained Aspect Affinity as predicting future product-attribute choices from time-ordered user interactions. It introduces DeepAffinity to model evolving preferences with Small Language Models and structured, aspect-specific prediction.
- Aspect Affinity predicts future preferences for product attributes such as size, color, and brand rather than only items.
- Aspect preferences are temporal: children’s sizes drift, brand loyalty changes, and color choices can follow seasons.
- Research has rarely addressed predicting arbitrary aspects together with their interactions, beyond studies targeting specific attributes such as size and fit.
- DeepAffinity uses SLMs, structured prompts, and specialized prediction heads to forecast desired aspect values from category-specific interaction histories.
- DeepAffinity outperforms heuristic methods, similarly sized fine-tuned LLMs, and zero-shot general-purpose LLMs, while improving recommendation quality in an industrial case study.
2 Related Work
Prior work uses product aspects to explain or improve recommendations and to refine search queries. DeepAffinity instead predicts aspect-value preferences for broader personalization uses.
- Earlier recommendation studies use item aspects as explanatory variables or combine aspect values and review sentiment to improve recommendations.
- Search-oriented work infers attributes such as shoe size, brand, and color to suggest filters and refine users’ current queries.
- DeepAffinity differs by modeling and predicting users’ aspect-value preferences for various personalization applications rather than optimizing only the current search query.
3 Method
DeepAffinity formulates aspect preference estimation as temporal, multi-task classification over user histories. It stringifies events for an SLM, creates affinity embeddings, and uses category-conditioned heads to predict aspect values.
- The task estimates P(v|u,c,a), the probability that user u purchases value v for aspect a in category c.
- Because aspect values are finite, the problem is modeled as multi-task multi-class classification, with aspects as tasks and values as classes.
- Training predicts future aspect values from partial, time-ordered activity sequences containing events such as purchases and search queries.
- User stringification converts each event’s type, title or query, aspects or facets, and category into tokenizable structured text.
- Affinity Embeddings from [CLS] positions are concatenated with category embeddings and passed to one linear classification head per aspect.
- Each prediction head outputs logits for possible aspect values, which softmax converts into probabilities while cross-entropy loss is minimized against observed labels.
- The pipeline supports scalable deployment by computing heavy SLM representations offline and using compact embeddings with lightweight runtime heads.
4 Evaluation
DeepAffinity is evaluated on temporally held-out eCommerce activity data across fashion and all-category settings, then tested in production ranking. It consistently outperforms or matches baselines, including larger generative models and zero-shot LLMs.
- Experimental Setup: The evaluation uses two eCommerce activity datasets collected over six months, with a subsequent week held out for strict temporal testing.Users with fewer than three purchases were filtered out to remove cold-start cases.
- Fashion Dataset Evaluation: Fashion evaluation measures micro-F1 for Size, Brand, and Color against heuristic baselines and Gemini 1.5 Flash.DeepAffinity consistently matches or outperforms baselines overall and on each individual attribute.
- Generative Fine-Tuning: DeepAffinity matches a 3B generative SFT model on Fashion Mean Precision despite using a much smaller model.Generative models range from 360M to 8B parameters, and performance generally improves with model size except for Qwen2.5 0.5B.
- All-Categories Dataset Evaluation: On the All-Category dataset, DeepAffinity outperforms all baselines on 7 of 10 aspects by micro-F1, including a 3B SFT baseline.SFT performs better on two aspects, but DeepAffinity achieves stronger overall results.
- Extrinsic Evaluation: Item Ranking: Adding DeepAffinity brand- and size-affinity features improves production ranking Recall@1 by 0.6%, Recall@3 by 0.4%, and Recall@5 by 0.3%.The comparison keeps ranking-model hyperparameters fixed while adding the affinity features to the deployed production baseline.
- Generative LLM Approach: Without task-specific fine-tuning, larger generative LLMs generally perform better, while few-shot and chain-of-thought prompting provide inconsistent gains.Enhanced prompting reliably improves results, but DeepAffinity still significantly outperforms the evaluated LLMs.
5 Conclusions
DeepAffinity consistently outperforms alternative approaches for fine-grained user preference modeling across multiple eCommerce datasets. Its temporal modeling remains limited by a fixed prediction horizon and missing explicit temporal signals.
- DeepAffinity consistently outperforms advanced prompting and fine-tuned generative models across multiple eCommerce datasets and strong baselines.Its structured prompts and multi-task output head improve performance over unstructured natural-text inputs.
- DeepAffinity surpasses much larger prompted LLMs, suggesting statistical learning of user behavior may be more crucial than activity-based reasoning.The findings highlight targeted fine-tuning for nuanced, aspect-level preferences in eCommerce recommendation settings.
- DeepAffinity uses event order and a fixed 24-hour prediction horizon but does not encode timestamps, inter-event gaps, or periodic patterns such as seasonality.Future work includes integrating these signals and studying preference drift over longer horizons.