Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Enhancing recommendation diversity and accuracy with product paths and time decay mechanisms

  • Xianchuan Wang ,

    Roles Conceptualization, Formal analysis, Funding acquisition, Methodology, Writing – review & editing

    xchwang@fynu.edu.cn

    Affiliations School of Computer and Information Engineering, Fuyang Normal University, Fuyang, China, Anhui Engineering Research Center for Intelligent Computing and Information Innovation, Fuyang Normal University, Fuyang, China

  • Wenkai Ming,

    Roles Data curation, Funding acquisition, Investigation, Methodology, Project administration, Validation, Writing – original draft

    Affiliation School of Computer and Information Engineering, Fuyang Normal University, Fuyang, China

  • Zhenyuan Fu,

    Roles Conceptualization, Project administration, Resources, Software, Writing – review & editing

    Affiliations School of Computer and Information Engineering, Fuyang Normal University, Fuyang, China, Yichang Emergency Center, Yichang, China

  • Xue Ma

    Roles Conceptualization, Funding acquisition, Supervision, Validation, Visualization, Writing – original draft

    Affiliation School of Computer and Information Engineering, Fuyang Normal University, Fuyang, China

Abstract

The recommendation algorithm suggests products to users, improving their experience, however, it encounters a challenge of insufficient diversity in the recommended results. This paper proposes Product Path and Time decay enhanced Product-based Neural Network recommendation algorithm. Firstly, establishes three types of product paths: User Purchase History Path, Product Similarity Calculation Path, and Product Bundles Path, integrates them to form a comprehensive product relation network, thereby enhancing the diversity of the recommended results. Then, a time decay function is introduced to further improve recommendation accuracy of the recommended products. Finally, fuses the product path and time decay function as a new R component to the Product layer of the PNN model. Experimental results show that the Product Path and Time decay enhanced PNN model improves the AUC from 0.8605 to 0.8772 and reduces the cross-entropy loss from 0.2228 to 0.2155. Meanwhile, the intra-list diversity (ILD) increases from 0.8581 to 0.8832, and the entropy rises from 4.15 to 4.74, demonstrating superiority over the standard PNN model in both accuracy and recommendation diversity.

Introduction

With the exponential growth of information, recommendation algorithms have become essential for filtering vast amounts of data and improving user experience. While these algorithms excel in delivering accurate recommendations, they often lack diversity. A significant limitation arises in e-commerce platforms when recommendations fail to adequately capture relationships between previously purchased products and new potential purchases, resulting in redundant suggestions from similar product categories.

In recent years, the integration of deep learning into recommendation systems has markedly advanced predictive accuracy. For instance, Liu et al. [1] combined collaborative filtering with genetic algorithms to enhance multi-attribute service recommendations in manufacturing, demonstrating how hybrid models can address complex preference structures. Similarly, Jia et al. [2] employed attention-based convolutional networks for recipe recommendation, further highlighting the effectiveness of deep neural models. Comprehensive reviews such as Da’u and Salim [3] confirm that deep learning has become foundational in modern recommender systems.

Beyond accuracy, knowledge graph-based methods have been proposed to improve the diversity and interpretability of recommendations. Guo et al. [4] and Liu et al. [5] reviewed a range of graph-enhanced models that contextualize item relations, while more recent efforts (e.g., Liang et al. [6]; Cai et al. [7]) propose graph attention and explicable paths to reveal item-item semantics and promote diversified outputs.

Recent studies have shown that incorporating time decay functions—such as linear, exponential, or power decay—can significantly improve recommendation accuracy by assigning higher weight to recent user interactions [8,9]. While product path strategies—such as browsing patterns and co-purchase trajectories—are useful for modeling item relationships, most existing approaches treat temporal dynamics and product structures independently. This separation limits the ability of recommender models to capture the dynamic and multifaceted nature of user preferences in real-world scenarios. Bridging this gap remains essential for achieving a robust balance between accuracy and diversity.

While product path strategies—such as browsing patterns and co-purchase trajectories—have demonstrated utility in capturing structural relationships between items, they are often modeled independently of temporal factors. Likewise, time decay mechanisms have been employed to reflect evolving user preferences but rarely in tandem with structured product relations. The separation of these two dimensions limits the ability of recommendation models to capture the nuanced, dynamic nature of real-world decision-making. This disjoint modeling hinders systems from achieving a robust balance between accuracy and diversity, both of which are recognized as important properties for modern recommender systems in real-world applications.

In this work, we propose a Product Path and Time decay enhanced Product-based Neural Network, which simultaneously improves both the diversity and accuracy of recommendations, as illustrated in Fig 1. The key innovations of our approach are as follows:

thumbnail
Fig 1. Schematic of Product Path and Time decay enhanced PNN.

https://doi.org/10.1371/journal.pone.0343638.g001

  1. The addition of an R component to the Product Layer of PNN [10,11], allowing the model to fuse both the product paths and the temporal dynamics, leading to increased diversity and precision of the recommendations.
  2. Construction of three product paths: (i) User Purchase History Path, (ii) Product Similarity Calculation Path, and (iii) Product Bundles Path. By integrating these paths, our model captures a broader range of relationships, leading to more diverse recommendations.
  3. Integration of a time decay function, which establishes a dynamic time threshold for filtering outdated product recommendations, ensuring that accurate and relevant items are suggested.

Related work

Traditional recommendation algorithm

The current recommendation algorithm methods are mainly divided into four categories [12]: content-based [13], collaborative filtering, knowledge-based [7], and hybrid systems [3,14]. Then the traditional recommendation algorithms typically rely on simple rules for recommendations, and the results are easily interpretable. With the growing need to capture temporal and contextual factors, context-aware collaborative filtering methods—such as those incorporating time, location, and device information—have been introduced to refine user similarity measures and improve recommendation relevance [15]. They also have relatively low data requirements and can effectively recommend on smaller datasets [16]. Collaborative filtering [1,17], as one of the classic recommendation algorithms [12,18], primarily recommends items of interest to users based on groups with similar tastes. However, for products, different users may provide varied feedback on the same item, yet the recommendation outcomes remain the same. Therefore, a collaborative filtering recommendation algorithm based on user correlation and evolutionary clustering has been proposed [19]. This algorithm incorporates an evolutionary clustering model into the collaborative filtering framework, which can better uncover similarities among users and community structures, thereby enhancing recommendation accuracy. By selecting the most similar neighbors within each user group to predict ratings, the algorithm ensures the diversity and personalization of the recommendation results.

With the rapid development of internet technology, recommendation algorithms have made significant progress. From the initial collaborative filtering [20] to later technologies such as GBDT [21], factorization machines [22], and deep learning, various models have emerged, covering a wide range of application scenarios. Moreover, session-based and sequential recommendation techniques using Markov chains or recurrent models have been explored to model the dynamic evolution of user interests over time. Despite the somewhat antiquated nature of traditional recommendation methods and the recent efforts by scholars to integrate traditional recommendation algorithms with deep learning, models like collaborative filtering [20], logistic regression [23], factorization methods [24], with their high interpretability and the advantages of quick training and deployment, continue to be applicable in many scenarios. They are also widely used as auxiliary models in conjunction with deep learning recommendation models. No single recommendation algorithm model reigns supreme, and understanding the strengths and weaknesses of each model, as well as how to flexibly apply them in different business environments, is crucial. However, most traditional algorithms do not fully capture the temporal evolution of user interests.

Deep learning-based recommendation algorithms

With the development of deep learning, traditional recommendation algorithms have undergone significant changes. Increasingly, researchers are striving to integrate deep learning into recommendation algorithms within the realm of recommender systems [2529]. The PNN is a neural network model that adopts a feature extractor to explore feature interactions [10,11]. The core idea of the PNN model is to cross-mix features of various combinations, constructing a deeper learning network model. The PNN model places greater emphasis on diverse cross-combination methods between features. The inner product and outer product operations in the PNN model are more targeted than the indiscriminate processing approach of fully connected layers, enabling the PNN model to more effectively obtain interleaved data information from features. Reference [2] combined collaborative filtering algorithm with deep learning, presenting an Attention-based Convolutional Neural Network (ACNN) built upon the mechanism of attention. Reference [30] proposes a deep learning-based recommendation algorithm designed to address information overload while enhancing the accuracy of recommendation results. The algorithm leverages multi-criteria ratings to reflect various aspects of user preferences and employs a deep autoencoder to learn non-linear and latent relationships, thereby generating more precise recommendations. More recently, sequence-aware and transformer-based models—such as SASRec and BERT4Rec—have shown strong performance in capturing long-term dependencies in user behavior. Graph neural network approaches, including non-sampling KG-enhanced recommenders [6] and position- and time-aware graph convolutional networks [31], further enrich representation learning by modeling high-order connectivity among users and items. These advances have pushed the frontier of deep recommendation towards better handling of sparse data, cold-start issues, and explainability. While these deep models enable complex feature interactions, most still lack explicit temporal decay modeling, motivating more time-aware solutions.

Recommendation algorithm based on knowledge graph

In recent years, the wealth of information within knowledge graphs [4,31,32] has garnered significant attention. As an emerging technology, knowledge graphs serve as a vital link, connecting a vast array of intricate information and knowledge, thereby constructing a comprehensive knowledge system [33]. Recent studies have further leveraged graph attention networks (GAT) over knowledge graphs to selectively propagate user-item interactions and entity relations, yielding more interpretable and accurate recommendations [5,32]. Utilizing graph database technology [34,35], knowledge graphs facilitate the depiction of complex relationships between entities, empowering machine learning systems to achieve deeper and more accurate data understanding. The strength of knowledge graphs [36,37] lies in structuring a large amount of complex information and knowledge, making it easier to manage and utilize [38,39]. Additionally, optimization techniques inspired by natural behavior, such as Grey Wolf or Greylag Goose algorithms, have been shown effective in improving knowledge graph-based structure learning and hyperparameter search under large-scale heterogeneous settings [35]. A knowledge graph-based recommendation algorithm is an approach that utilizes knowledge graphs to build recommendation systems [5]. It associates users’ historical behavior with information such as entities and attributes in the knowledge graph, achieving more precise recommendations. Knowledge graphs provide numerous nodes, triples and edges [40], offering better insights into users’ interests and needs for more accurate recommendations. Additionally, knowledge graphs can build associated knowledge bases, enabling knowledge inference to help recommendation algorithms more accurately identify users’ interests and needs, thus achieving more precise recommendations. This way, a connection is established between recommendation information and the knowledge graph. Behavior path collaborative filtering recommendation algorithms based on knowledge graphs efficiently recommend across multiple dimensions, achieving comprehensive utilization of data and diversity in recommendations [41]. A novel end-to-end recommendation scenario [42] is presented which jointly learns the collaborative signal and knowledge graph context. The knowledge graph is utilized to provide supplementary information in the recommendation scenario. To have personalized recommendation for each user, user-specific attention mechanism is also utilized.However, most knowledge-graph-based recommenders focus on static relationships and rarely account for the temporal dynamics of user preferences.

Time decay mechanisms in recommendation

Time decay mechanisms recommendation have emerged as a critical research direction for modeling the dynamic evolution of user preferences. Incorporating temporal information allows recommender systems to prioritize recent user behaviors and adapt to changing interests. Various forms of time decay functions—such as linear, exponential, logarithmic, and power decay—have been widely adopted to weight user interactions according to recency [8,9,43,44]. For example, the TD-CF model [9] leverages the human memory forgetting curve to design a time decay function, thereby effectively integrating both short-term and long-term user interests. Similarly, exponential and power decay functions have been incorporated into matrix factorization and deep neural network frameworks to enhance prediction accuracy, as demonstrated in recent works [8,44]. Comparative studies confirm that models with appropriate temporal weighting outperform their static counterparts across diverse domains, including e-commerce and educational resource recommendation [43,45].

In addition to user-item interactions, recent research has emphasized the importance of integrating temporal dynamics with structural or path-based models. For instance, time decay vectors have been applied within heterogeneous graph frameworks to mitigate issues such as over-weighting older nodes and to improve the diversity and relevance of recommendations [46]. However, many existing approaches still treat temporal factors and structural relationships independently, limiting their ability to fully capture the complexity of real-world decision-making. Bridging this gap by jointly modeling time decay and structured product or information paths is a promising direction, as it may lead to more robust, accurate, and diverse recommendation outcomes.Bridging this gap by jointly modeling time decay and structured product or information paths is a promising direction, as pursued in this work.

Methods

PNN model

The PNN [10] is a deep learning model designed for recommendation systems. It enhances feature interactions by introducing a Product Layer that models pairwise feature interactions via inner or outer products, thereby improving predictive performance. PNN also possesses structural advantages that make it suitable for both classification and regression tasks.

A key component of the PNN model is the Product Layer, which organizes feature interactions in a structured manner. The input consists of embedding vectors from N feature fields, producing two output vectors: the linear feature representation () and the cross-product interaction representation (). These are computed as:

(1)

where and are the learnable weights of the Product Layer, z denotes the concatenated embeddings across all feature fields, and p represents the pairwise interaction terms between embedding vectors.

The linear component processes continuous-valued features, including product attributes, path-based relational embeddings, and time decay scores. It outputs a -dimensional vector, where each element is computed as:

(2)

The interaction component encodes discrete categorical features such as product ID, category, and brand. Its elements are computed via:

(3)

This interaction mechanism can be instantiated as either an Inner Product-based Neural Network (IPNN) or an Outer Product-based Neural Network (OPNN). IPNN uses inner products to capture feature interactions compactly, while OPNN leverages outer products for richer cross-feature modeling. As outer products lead to higher dimensional outputs, dimensionality reduction techniques such as pooling are typically applied to ensure computational tractability.

A notable strength of the PNN architecture lies in its ability to handle high sparsity and long-tail interaction distributions, which are prevalent in recommendation datasets. By modeling feature interactions within a low-dimensional latent space, PNN avoids reliance on high-dimensional feature co-occurrence matrices that are prone to noise under sparse supervision. Its factorized interaction structure enables generalization beyond directly observed user–item pairs, allowing the model to effectively capture relationships for infrequent or cold-start items. These properties make PNN particularly robust and applicable in sparse recommendation scenarios with skewed activity distributions.

Product path and time decay enhanced product-based neural network model

We extend the traditional PNN architecture by embedding a novel R component designed to capture synergistic interactions between product structural relationships and temporal user behavior (Fig 2). This component enriches feature interactions with temporal and path-based context via the following steps:

thumbnail
Fig 2. Schematic diagram of Product Path and Time decay enhanced Product-based Neural Network model structure.

https://doi.org/10.1371/journal.pone.0343638.g002

  1. 1. Joint Representation: For each product pair , compute
(4)

where denotes the integrated score between items i and j derived from all product paths via a learnable weighted fusion (see below for its detailed computation). is the time decay function that adjusts the influence of this similarity based on interaction recency (see section “Time dacay function” for the definition of the decay function).

  1. 2. Weighted Projection: Project the matrix into a -dimensional vector using a dedicated weight tensor :
(5)
  1. 3. Feature Fusion: Concatenate with the static interaction vectors and from the Z and P components:
(6)

and feed into the subsequent fully connected L1 layer.

This integration enables the model to dynamically weight recent, path-relevant interactions alongside traditional feature crosses. During training, is learned during model training, while the decay factor α in is set based on domain knowledge and remains fixed during training to minimize the binary cross-entropy loss, ensuring the R component’s representations align with overall recommendation objectives. This joint formulation ensures that only semantically related items with recent user interactions receive strong emphasis, thereby enhancing the model’s ability to capture both diversity (through paths) and precision (through recency). For instance, if a user recently viewed or purchased certain products, the integrated R component will emphasize recommendations of items closely related to these recent interactions, effectively balancing between short-term user interests and long-term preferences to enhance both recommendation diversity and accuracy.

Establishment of product paths

Constructing effective comprehensive product paths is fundamental to personalized recommendation systems, as it enables a refined analysis of user preferences and product relationships. In this study, we leverage three complementary datasets—the User Purchase History Table, the Product Information Table, and the Product Bundles Table to establish a robust foundation for recommendation generation. A systematic, three-pronged approach is employed to construct these paths: analyzing user purchase behavior, computing product similarity based on textual features, and incorporating merchant-defined product bundles. By employing these three types of product paths—behavioral (user purchase history), content-based (product similarity), and domain-expert (product bundles)—we ensure that the model captures complementary, non-redundant relationships between items (see Fig 3). This design enables the model to leverage diverse sources of relational knowledge, leading to more accurate and diverse recommendations. Detailed construction methods for each path are provided below.

User purchase history path.

The User Purchase History Path identifies complementary item relationships by analyzing co-purchased items within the same transaction. For example, in Fig 3, for the T-shirt A, we retrieve all users who purchased T-shirt A and their transaction timestamps, then extract other items (Jacket A, Sweater A, Jeans A, etc.) bought by the same users on the same day, excluding items from the same category as T-shirt A. Two metrics are computed: (1) fmp, the co-purchase frequency of T-shirt A and another item X within the same transaction, and (2) fcm, the cross-category co-occurrence frequency between the categories of T-shirt A and X. The relevance score S is defined as:

(7)

The natural logarithm is employed in this formulation to compress the range of fcm, thereby mitigating the potential overemphasis of items with very high cross-category co-occurrence frequencies. This transformation embodies the principle of diminishing returns: initial increases in fcm contribute substantially to the relevance score, but subsequent increases yield a reduced incremental effect. This ensures that the score remains balanced, effectively integrating both intra-session co-purchase patterns and inter-category affinities. Additionally, the term remains well-defined even when fcm equals zero.

Product similarity path.

The Product Similarity Path models semantic relationships between products based on shared content attributes, enabling recommendations grounded in intrinsic item similarity. This path is constructed from textual features extracted from product descriptions.

As illustrated in Fig 3, T-shirt A and T-shirt B have similar product descriptions (e.g., “cotton”, “casual wear”), while T-shirt A and Jeans A exhibit weaker attribute similarity due to category differences. We compute similarity scores using a combination of TF-IDF weighting and cosine similarity.

For a term t in document , the term frequency is defined as:

(8)

where denotes the total number of terms in . The inverse document frequency is calculated as:

(9)

where N is the number of products and is an indicator function denoting the presence of term t in . The final TF-IDF representation is given by:

(10)

Each product is represented as a sparse TF-IDF vector, and pairwise cosine similarity is computed to quantify textual similarity between items.

To avoid excessive reinforcement of highly similar items within the same category, we filter out same-category product pairs (e.g., “T-shirt A” and “T-shirt B”) and prioritize cross-category similarities (e.g., “T-shirt A” and “Jeans A”). This strategy encourages cross-category discovery and alleviates popularity bias, leading to improved recommendation diversity while preserving semantic relevance.

It should be noted that the Product Similarity Path models attribute-level semantic relatedness only, and is not intended to capture complementary purchasing patterns or marketing strategies, which are explicitly modeled by the Product Bundles Path.

Product bundles path.

The Product Bundles Path captures merchant-defined relationships derived from curated product bundles, reflecting domain knowledge and marketing strategies in retail environments. Unlike behavior-based or similarity-based paths, bundle associations encode complementary usage and cross-selling intentions that may not be observable from user interactions or product descriptions alone.

Unlike similarity signals, bundle relations are not treated as semantic proximities between items. Instead, they represent an independent relational source that reflects expert knowledge about complementary consumption patterns.

To model bundle coherence in a principled manner, we quantify association strength using bundle co-occurrence statistics. For each item pair , a normalized bundle-based association score is computed as:

(11)

where denotes the set of bundles containing item i. This metric estimates how frequently item j appears together with item i across curated bundles, normalized by the popularity of i within bundles.

To eliminate weak or spurious relations, we apply a threshold-based filtering strategy:

(12)

where τ controls bundle coherence quality. Item pairs whose scores fall below τ are excluded from further modeling to avoid introducing noisy bundle relations.

This thresholding approach follows common practices in co-occurrence-based modeling and bundle-aware recommendation systems, ensuring that only strong bundle associations contribute to the relation graph [47,48].

The retained associations are encoded as a bundle-specific embedding and passed to the unified Product Path representation:

(13)

serving as an independent domain-informed relation source during path fusion.

Product path.

The Product Path is a unified representation that integrates three sources of relational information: user purchase history, product similarity, and product bundles. Each path generates a dense embedding vector , encoding distinct aspects of item relationships (see Fig 3). All path embeddings are projected into a shared d-dimensional latent space ( in our experiments) through trainable linear layers and are optimized jointly with other model parameters using binary cross-entropy loss. To obtain the final similarity score for each item pair, these embeddings are fused through a learnable weighted aggregation:

(14)

where are path-specific weights initialized from domain knowledge and further optimized during training. The weights are learned via backpropagation jointly with all other model parameters using binary cross-entropy loss, without explicit normalization or hard constraints. This weighted fusion, functionally analogous to an attention mechanism, enables the model to adaptively balance the contribution of heterogeneous relational sources. Importantly, different paths are not forced into a single similarity interpretation, but are instead combined through data-driven optimization to preserve their distinct semantic roles.

In the complete model, the integrated similarity is further modulated by the time decay function to yield the final relational signal. This signal is fed into the novel R component within our PNN product layer, whose output () is concatenated with the PNN’s original linear () and cross-product () features to form the input for the final prediction layers. By integrating multi-path and temporal signals in this manner, our model jointly captures diverse, adaptive, and timely item relationships, enhancing both recommendation accuracy and diversity.

Time decay function

To accurately reflect the dynamic evolution of user preferences in recommendation, we introduce a time decay function that modulates the overall influence of past interactions after integrating multi-path relational information. This mechanism ensures that recent behaviors exert more influence, while outdated actions are gradually down-weighted, thereby aligning recommendations with users’ current interests.

Specifically, after fusing all product path information into the integrated similarity score , we apply a time decay function based on interaction recency:

(15)

where is the current timestamp, denotes the timestamp of user u’s interaction with item i, and α is the decay factor controlling how rapidly past behaviors lose influence.

This design ensures that all relational signals from different paths are first fused into , and only then modulated by recency. In this way, the recommendation fully leverages multi-path knowledge while dynamically adapting to users’ latest behaviors.

We select α based on domain knowledge and the statistical characteristics of our dataset, which includes both short-lifecycle (e.g., fashion, trending goods) and long-lifecycle (e.g., books, furniture) product categories (see Table 1). For short-lifecycle items, a higher α ensures that only recent actions remain highly influential; for durable goods, a smaller α allows longer-term preferences to persist in the recommendation. This product-type-sensitive strategy is illustrated in Fig 4: higher α leads to rapid decay suitable for fast-changing categories, while lower α better preserves stable, long-term interests.

thumbnail
Fig 4. Time decay for different product lifecycles.

Higher α causes faster decay, suitable for trend-sensitive goods; lower α retains long-term influence for stable-interest domains.

https://doi.org/10.1371/journal.pone.0343638.g004

Unlike methods that learn the decay rate, we fix α per product type to avoid overfitting and reduce model complexity. In practice, we set α according to product lifecycle analysis on our large-scale dataset (over 1.1M users, 460K items, and a 1-year time span), as described in the Dataset Description.

Comparison with Exponential Decay: While exponential decay () is widely used, we adopt a rational function to provide smoother attenuation and better control over the influence of moderately old interactions. Our formulation allows for finer adjustment between short- and long-term effects, and its effectiveness in recommendation systems has been supported by prior work demonstrating the benefits of time decay functions for capturing user interest drift and improving recommendation performance [9].

Integration with Path Fusion: The time decay function is applied to after the fusion of path-specific embeddings, ensuring that both the fusion and the final recommendation remain sensitive to recency and temporal dynamics. This design is especially important given our dataset’s diversity in product lifecycles and the observed patterns of user repeat behavior.

Experimental verification

Dataset description

The experiments in this paper are conducted on a large-scale e-commerce dataset derived from Alibaba’s open platform [49], which includes three relational tables: user purchase history, product information, and product bundles. After rigorous preprocessing, the final dataset comprises over 1.1 million users, 460,000 items, and 281 product categories, with more than 13.6 million user-item interactions recorded over the span of one year. Key statistics of the dataset are summarized in Table 1.

To assess category diversity and coverage, we analyze the distribution of product categories. Fig 5 presents the cumulative coverage of the top-N product categories, showing that the top 10 and 20 categories account for approximately 56% and 80% of all products, respectively. Fig 6 further illustrates the long-tail distribution of categories, with a large number of tail categories containing relatively few products. This confirms that the dataset exhibits both significant category diversity and a realistic long-tail property, making it well-suited for evaluating recommendation accuracy and diversity.

thumbnail
Fig 5. Cumulative coverage of top-N product categories.

The top 10 and 20 categories cover 56.0% and 79.8% of all products, respectively.

https://doi.org/10.1371/journal.pone.0343638.g005

thumbnail
Fig 6. Long-tail distribution of all product categories (logarithmic scale).

https://doi.org/10.1371/journal.pone.0343638.g006

To simulate real-world recommendation scenarios and maintain temporal causality, we adopt a temporal split: the first 80% of interactions (chronologically) are used for training, the next 10% for validation, and the final 10% for testing, following the protocol described in Qu et al. [11].

These comprehensive statistics and visualizations demonstrate that the dataset is large-scale, sparse, and diverse, providing a solid foundation for evaluating recommendation models in realistic environments.

Training protocol and hyperparameter configuration

All models are implemented using PyTorch and trained on a single NVIDIA RTX 3090 GPU. All hyperparameters are selected via grid search on the validation set to ensure fair comparison and reproducibility across model variants, as summarized in Table 2. For certain baseline models, several hyperparameter settings are initialized by following the original PNN implementation [11].

thumbnail
Table 2. Model and training hyperparameter configuration.

https://doi.org/10.1371/journal.pone.0343638.t002

To mitigate overfitting under the extreme sparsity of the dataset, multiple regularization strategies are employed in model training. Specifically, dropout with a rate of 0.5 is applied to fully connected layers, and L2 weight decay () is added to all trainable parameters. In addition, early stopping is used based on validation AUC, and training is terminated if no improvement is observed within ten consecutive epochs. Hyperparameters are selected through grid search on the validation set to ensure stable optimization and generalization across all compared methods. These design choices collectively control model complexity and improve robustness in highly sparse recommendation environments.

Evaluation metrics

To comprehensively assess model performance, we report both accuracy and diversity metrics. Accuracy is evaluated by the Area Under the ROC Curve (AUC) and cross-entropy loss, as widely adopted in recommendation literature. In addition, to reflect the core goal of our method—enhancing recommendation diversity—we introduce two non-accuracy metrics: Intra-List Diversity (ILD) and Entropy.

AUC (Area Under the ROC Curve): AUC measures the ranking performance of the model for binary classification, reflecting how well positive samples are ranked above negative ones. It is widely used in recommendation tasks to evaluate click prediction or purchase likelihood. The higher the AUC, the better the model distinguishes between positive and negative instances.

(16)

ILD (Intra-List Diversity): ILD quantifies the average pairwise dissimilarity among items in a user’s recommendation list, indicating how diverse the recommended items are. For a recommendation list of length K:

(17)

where is a similarity metric (e.g., category match or cosine similarity).

Entropy: Entropy measures the distribution of recommended item categories across users, with higher values indicating greater diversity:

(18)

where is the proportion of recommended items belonging to category c.

Ablation experiment

Impact and statistical significance of product paths and time decay.

To further assess the impact of incorporating product paths and the time decay function, we conducted ablation experiments using three different models: the baseline PNN, PNN with product paths, and the Product Path and Time Decay enhanced PNN. Evaluation metrics include AUC, cross-entropy loss, intra-list diversity (ILD), and entropy, as summarized in Table 3. Higher ILD and entropy indicate greater intra-list and global diversity, respectively.

thumbnail
Table 3. AUC, Loss, ILD, and Entropy for PNN, PNN with Product Paths, and Product Path and Time Decay enhanced PNN.

https://doi.org/10.1371/journal.pone.0343638.t003

Table 3 comprehensively compares the performance of the baseline PNN, PNN with product paths, and the full Product Path and Time Decay enhanced PNN across both accuracy and diversity metrics.

Integrating product paths into the PNN consistently improves AUC (from 0.8605 to 0.8691) and lowers loss (from 0.2228 to 0.2173), confirming the benefit of incorporating structured relational information. The introduction of the time decay component provides further improvements, achieving the highest AUC (0.8772) and lowest loss (0.2155).

From a diversity perspective, ILD and entropy also exhibit a clear upward trend. ILD increases from 0.8581 in the baseline PNN to 0.8727 with product paths, and further to 0.8832 with the addition of time decay, indicating the recommendations are becoming less redundant and more diverse. Entropy rises from 4.15 to 4.74, then maintains at 4.72, suggesting that the recommended items are spread across a wider range of categories, rather than being clustered in a few popular types.

To evaluate the reliability and consistency of these performance improvements, we conducted repeated training runs (five times per model using different random seeds) under identical settings. Figs 7 and 8 report the mean performance along with the corresponding standard deviations. The consistent improvement trends observed across runs indicate that the observed gains are stable and not caused by random initialization effects.

thumbnail
Fig 7. AUC across models with error bars (± std) from five independent runs.

https://doi.org/10.1371/journal.pone.0343638.g007

thumbnail
Fig 8. ILD across models with error bars (± std) from five independent runs.

https://doi.org/10.1371/journal.pone.0343638.g008

Fine-grained analysis of recommendation diversity via product path.

In this experiment, we randomly selected purchase records from 10,000 users and recommended 100 products to each user. For each user, we calculated the number of unique product categories among their recommended items. The distribution of these category counts is visualized in Fig 9 (with product paths) and Fig 10 (without product paths).

thumbnail
Fig 10. Experimental results without using product paths.

https://doi.org/10.1371/journal.pone.0343638.g010

As illustrated in Fig 9, incorporating product paths substantially broadens the diversity of recommendations for most users: the number of unique recommended categories per user is typically distributed between 10 and 20, reaching up to 33 in some cases, with an average of 11.211. In contrast, Fig 10 shows that without product paths, this number is concentrated between 0 and 10, averaging only 7.328, and very rarely exceeding 40 due to outlier effects.

These results provide a visual, user-level confirmation of the effectiveness of product path modeling. The majority of users benefit from increased diversity in their recommendations, supporting and complementing the aggregate improvements observed in ILD and entropy. Additionally, the scatter plots highlight occasional extreme cases, reflecting both the realistic long-tail properties of the data and the influence of underlying product associations.

Comparative experiments

To comprehensively evaluate the effectiveness of our Enhanced PNN model with Product Path and Time Decay, we conducted comparative experiments against several representative baseline recommendation models, including PNN, Wide&Deep, DeepFM, DCN, and DGCN, as well as diversity-oriented models MMR and DPP. In addition, we included two recent state-of-the-art graph-based collaborative filtering models, LightGCN and SimGCL, to evaluate the competitiveness of our method against modern graph learning approaches.

Model performance was assessed using four key metrics: AUC (accuracy), cross-entropy loss, intra-list diversity (ILD), and entropy (global diversity). Table 4 summarizes the experimental results. For each baseline, values in parentheses indicate the gap relative to our Enhanced PNN (i.e., the Enhanced PNN value minus the baseline value for each metric). All baseline results were also obtained from five independent runs with different random seeds, and the reported values represent average performance. The ranking of models remained stable across runs, demonstrating robustness of the comparison.

thumbnail
Table 4. Comparison of Accuracy and Diversity Metrics Across Recommendation Models.

https://doi.org/10.1371/journal.pone.0343638.t004

As observed in Table 4, the Enhanced PNN model achieves the best overall performance, surpassing all baselines in both accuracy (highest AUC, lowest loss) and recommendation diversity (highest ILD and entropy). Notably, traditional deep models such as Wide&Deep, DeepFM, DGCN, and DCN show competitive AUC but exhibit lower diversity, highlighting the trade-off often observed in practice. Diversity-focused baselines such as DPP and MMR improve ILD and entropy relative to classic PNN, but this improvement is accompanied by a noticeable degradation in prediction accuracy, as indicated by their lower AUC and higher loss. We further compare the proposed model with graph-based collaborative filtering baselines, LightGCN and SimGCL. We observe that LightGCN and SimGCL achieve lower performance than the proposed method in terms of both prediction accuracy and recommendation diversity. This is likely due to the fact that our dataset contains rich side information and explicit bundle relationships, which are not directly exploited by CF-based graph models.

In contrast, the proposed method explicitly integrates product attributes, structured product relations, and temporal dynamics, making it more suitable for feature-rich and highly sparse recommendation scenarios.

These results demonstrate the advantages of our approach in promoting both recommendation accuracy and diversity, making it more suitable for practical e-commerce scenarios where both aspects are critical. Figs 11 and 12 further illustrate the convergence trends of AUC and loss for the Enhanced PNN model over 180 training epochs.

thumbnail
Fig 11. AUC Convergence of the Product Path and Time decay enhanced PNN Model over 180 Epochs.

https://doi.org/10.1371/journal.pone.0343638.g011

thumbnail
Fig 12. Loss Minimization Trend of the Product Path and Time decay enhanced PNN Model over 180 Epochs.

https://doi.org/10.1371/journal.pone.0343638.g012

Analysis of experimental results

The experimental results comprehensively demonstrate the effectiveness of incorporating product paths and a time decay function into the PNN framework for personalized recommendation. Compared to the baseline PNN model, the integration of product paths leads to a notable improvement in accuracy, as evidenced by the increase in AUC from 0.8605 to 0.8691 and the reduction in cross-entropy loss from 0.2228 to 0.2173. Further enhancement is achieved with the addition of the time decay component, resulting in the highest AUC of 0.8772 and the lowest loss of 0.2155 among all model variants.In addition to accuracy, the proposed enhancements significantly boost recommendation diversity. Both intra-list diversity (ILD) and entropy rise as the model transitions from baseline PNN to PNN with product paths and then to the fully enhanced model, indicating that users are presented with a broader and less redundant selection of recommended items. Visualizations of category coverage further confirm that the use of product paths results in a more balanced and diverse distribution of recommended categories across users, in contrast to the baseline, which tends to concentrate recommendations within a narrower range of categories. Moreover, Comparative experiments against established baseline models—including Wide&Deep, DeepFM, DCN, DGCN, MMR, DPP, LightGCN, and SimGCL—demonstrate that the Enhanced PNN outperforms all competitors not only in terms of predictive accuracy but also in recommendation diversity, as shown in Table 4.

Conclusion

In this study, we proposed the Product Path and Time decay enhanced PNN to address the challenges of insufficient diversity and limited accuracy in recommendation systems. By incorporating three types of product paths—User Purchase History Path, Product Similarity Calculation Path, and Product Bundles Path—our approach captures complementary relational information among products, leading to more diverse and informative recommendations. The integration of a time decay function further enables the model to assign higher importance to recent user behaviors, ensuring that recommendations remain temporally relevant. Comparative experiments against multiple baseline models demonstrate that the proposed method consistently improves both prediction accuracy and recommendation diversity, indicating its strong potential for large-scale e-commerce recommendation scenarios.

While the experimental results are encouraging, several aspects offer natural opportunities for further refinement. The current time decay factor is selected based on domain insights rather than learned dynamically, and the evaluation—although comprehensive—remains limited to offline metrics without online user-engagement validation. These are not fundamental constraints of the proposed framework but rather practical considerations that open pathways for future work. Moving forward, we plan to explore adaptive temporal modeling techniques, such as attention-based or sequence-aware architectures, incorporate richer user context signals, and expand the evaluation to include additional metrics such as precision and recall. We also aim to investigate the applicability of this framework in broader domains, including news and educational recommendations.

Supporting information

S1 Code. This archive contains the dataset and the related model code.

https://doi.org/10.1371/journal.pone.0343638.s001

(ZIP)

Acknowledgments

We would like to specially thank to the reviewers for their beneficial comments and suggestions, which improves the paper.

References

  1. 1. Liu ZC, Wang L, Li XX, Pang SB. A multi-attribute personalized recommendation method for manufacturing service composition with combining collaborative filtering and genetic algorithm. J Manuf Syst. 2021;58:348–64.
  2. 2. Jia N, Chen J, Wang R. An attention-based convolutional neural network for recipe recommendation. Expert Systems with Applications. 2022;201:116979.
  3. 3. Da’u A, Salim N. Recommendation system based on deep learning methods: a systematic review and new directions. Artif Intell Rev. 2020;53:2709–48.
  4. 4. Guo Q, Zhuang F, Qin C, Zhu H, Xie X, Xiong H, et al. A survey on knowledge graph-based recommender systems. IEEE Trans Knowl Data Eng. 2022;34(8):3549–68.
  5. 5. Liu Y, Yang S, Xu Y, Miao C, Wu M, Zhang J. Contextualized graph attention network for recommendation with item knowledge graph. IEEE Trans Knowl Data Eng. 2021;:1–1.
  6. 6. Liang S, Shao J, Zhang J, Cui B. Graph-based non-sampling for knowledge graph enhanced recommendation. IEEE Trans Knowl Data Eng. 2023;35(9):9462–75.
  7. 7. Cai X, Xie L, Tian R, Cui Z. Explicable recommendation based on knowledge graph. Expert Systems with Applications. 2022;200:117035.
  8. 8. Jain G, Mahara T, Sharma SC, Agarwal S, Kim H. TD-DNN: a time decay-based deep neural network for recommendation system. Applied Sciences. 2022;12(13):6398.
  9. 9. Zhao Y, Hua X. Application of collaborative filtering algorithm based on time decay function in music teaching recommendation model. PeerJ Comput Sci. 2024;10:e2533. pmid:39678276
  10. 10. Zhao D, Qiao J. Space group prediction of complex alloy systems by product-based neural networks. Intermetallics. 2024;175:108489.
  11. 11. Qu Y, Fang B, Zhang W, Tang R, Niu M, Guo H, et al. Product-based neural networks for user response prediction over multi-field categorical data. ACM Trans Inf Syst. 2018;37(1):1–35.
  12. 12. Khanal SS, Prasad P, Alsadoon A, Maag A. A systematic review: machine learning based recommendation systems for e-learning. Educ Inf Technol. 2020;25:2635–64.
  13. 13. Jozani M, Liu CZ, Choo K-KR. An empirical study of content-based recommendation systems in mobile app markets. Decision Support Systems. 2023;169:113954.
  14. 14. Patel R, Thakkar P, Ukani V. CNNRec: convolutional Neural Network based recommender systems-a survey. Eng Appl Artif Intell. 2024;133:108062.
  15. 15. Chiang J-H, Ma C-Y, Wang C-S, Hao P-Y. An adaptive, context-aware, and stacked attention network-based recommendation system to capture users’ temporal preference. IEEE Trans Knowl Data Eng. 2023;35(4):3404–18.
  16. 16. Alzakari SA, Alhussan AA, Qenawy AT, Elshewey AM, Eed M. An enhanced long short-term memory recurrent neural network deep learning model for potato price prediction. Potato Res. 2025;68:621–39. http://dx.doi.org/10.1007/s11540-024-09744-x
  17. 17. Wu L, He X, Wang X, Zhang K, Wang M. A survey on accuracy-oriented neural recommendation: from collaborative filtering to information-rich recommendation. IEEE Trans Knowl Data Eng. 2022:4425–45.
  18. 18. Hazrati N, Ricci F. Recommender systems effect on the evolution of users’ choices distribution. Inf Process Manag. 2022;59:102766.
  19. 19. Chen J, Zhao C, Uliji, Chen L. Collaborative filtering recommendation algorithm based on user correlation and evolutionary clustering. Complex Intell Syst. 2019;6(1):147–56.
  20. 20. Kuo RJ, Li S-S. Applying particle swarm optimization algorithm-based collaborative filtering recommender system considering rating and review. Applied Soft Computing. 2023;135:110038.
  21. 21. Liu W, Fan H, Xia M. Credit scoring based on tree-enhanced gradient boosting decision trees. Expert Systems with Applications. 2022;189:116034.
  22. 22. Zheng X, Ni Z, Zhong X, Luo Y. Kernelized deep learning for matrix factorization recommendation system using explicit and implicit information. IEEE Trans Neural Netw Learn Syst. 2022;PP:10.1109/TNNLS.2022.3182942. pmid:35731766
  23. 23. Nibbering D, Hastie TJ. Multiclass-penalized logistic regression. Computational Statistics & Data Analysis. 2022;169:107414.
  24. 24. Zhang X, Li R, Wang S, Li X, Sun Z. TAFM: a recommendation algorithm based on text-attention factorization mechanism. Comput Intell Neurosci. 2022;2022:1775496. pmid:36072720
  25. 25. Li P, Tuzhilin A. Dual metric learning for effective and efficient cross-domain recommendations. IEEE Trans Knowl Data Eng. 2021;:321–34.
  26. 26. Lai Y, Zhang Y, Meng X, Du Y. Preference and constraint factor model for event recommendation. IEEE Trans Knowl Data Eng. 2022;34(10):4982–93.
  27. 27. Shen X, Yi B, Liu H, Zhang W, Zhang Z, Liu S, et al. Deep variational matrix factorization with knowledge embedding for remmendation system. IEEE Trans Knowl Data Eng. 2020:1906–18.
  28. 28. Cai D, Qian S, Fang Q, Hu J, Xu C. User cold-start recommendation via inductive heterogeneous graph neural network. ACM Trans Inf Syst. 2023;41(3):1–27.
  29. 29. Shrivastava R, Singh Sisodia D, Kumar Nagwani N. Deep neural network-based multi-stakeholder recommendation system exploiting multi-criteria ratings for preference learning. Expert Systems with Applications. 2023;213:119071.
  30. 30. Shambour Q. A deep learning based algorithm for multi-criteria recommender systems. Knowledge-Based Systems. 2021;211:106545.
  31. 31. Huang L, Ma Y, Liu Y, Danny Du B, Wang S, Li D. Position-enhanced and time-aware graph convolutional network for sequential recommendations. ACM Trans Inf Syst. 2023;41(1):1–32.
  32. 32. Gao C, Zheng Y, Li N, Li Y, Qin Y, Piao J, et al. A survey of graph neural networks for recommender systems: challenges, methods, and directions. ACM Trans Recomm Syst. 2023;1(1):1–51.
  33. 33. Guan S, Cheng X, Bai L, Zhang F, Li Z, Zeng Y, et al. What is event knowledge graph: a survey. IEEE Trans Knowl Data Eng. 2022:1–20.
  34. 34. Tamašauskaitė G, Groth P. Defining a knowledge graph development process through a systematic review. ACM Trans Softw Eng Methodol. 2023;32(1):1–40.
  35. 35. El-kenawy E-SM, Khodadadi N, Mirjalili S, Abdelhamid AA, Eid MM, Ibrahim A. Greylag Goose Optimization: nature-inspired optimization algorithm. Expert Systems with Applications. 2024;238:122147.
  36. 36. Zhang Z, Li Z, Liu H, Xiong NN. Multi-scale dynamic convolutional network for knowledge graph embedding. IEEE Trans Knowl Data Eng. 2022;34(5):2335–47.
  37. 37. Zhao M, Huang X, Zhu L, Sang J, Yu J. Knowledge graph-enhanced sampling for conversational recommendation system. IEEE Trans Knowl Data Eng. 2023;35(10):9890–903.
  38. 38. Mezni H, Benslimane D, Bellatreche L. Context-aware service recommendation based on knowledge graph embedding. IEEE Trans Knowl Data Eng. 2021;34:5225–38.
  39. 39. Gao M, Li J-Y, Chen C-H, Li Y, Zhang J, Zhan Z-H. Enhanced multi-task learning and knowledge graph-based recommender system. IEEE Trans Knowl Data Eng. 2023;35(10):10281–94.
  40. 40. Zhong L, Wu J, Li Q, Peng H, Wu X. A comprehensive survey on automatic knowledge graph construction. ACM Comput Surv. 2023;56(4):1–62.
  41. 41. Peng C, Xia F, Naseriparsa M, Osborne F. Knowledge graphs: opportunities and challenges. Artif Intell Rev. 2023:1–32. pmid:37362886
  42. 42. Elahi E, Halim Z. Graph attention-based collaborative filtering for user-specific recommender system using knowledge graph and deep neural networks. Knowl Inf Syst. 2022;64:2457–80.
  43. 43. Behera G, Nain N. Collaborative filtering with temporal features for movie recommendation system. Procedia Computer Science. 2023;218:1366–73.
  44. 44. Hassan AY, Fadel E, Akkari N. Exponential decay function-based time-aware recommender system for e-commerce applications. Int J Adv Comput Sci Appl. 2022;13(10):602–8.
  45. 45. Fu J, Qi Z. A TDF-WNSP-WLFM algorithm for product recommendation based on multiple types of implicit user behavior. J Supercomput. 2022;78(16):17776–96. pmid:35645461
  46. 46. Huang Z, Tang D, Zhao R, Rao W. A scientific paper recommendation method using the time decay heterogeneous graph. Scientometrics. 2024;129(3):1589–613.
  47. 47. Chang J, Gao C, He X, Jin D, Li Y. Bundle recommendation and generation with graph neural networks. IEEE Transactions on Knowledge and Data Engineering. 2021;35:2326–40.
  48. 48. Kobuszewki Volles B, Ribbers D, Van Kerckhove A, Geuens M. Beyond bundles: choosing product bundles increases shopping basket size. Journal of Retailing and Consumer Services. 2024;81:104035.
  49. 49. Tianchi. Fashion Collocation Data on Taobao.com. Tianchi Dataset. 2018. https://tianchi.aliyun.com/dataset/dataDetail?dataId=52