# fuzzy_collaborative_reasoning__26b24b40.pdf Fuzzy Collaborative Reasoning Huanhuan Yuan1,2, Pengpeng Zhao1*, Jiaqing Fan1, Junhua Fang1, Guanfeng Liu2, Victor S. Sheng3 1Soochow University, 2Macquarie University, 3Texas Tech University hhyuan@stu.suda.edu.cn, {ppzhao, jqfan, jhfang}@suda.edu.cn, guanfeng.liu@mq.edu.au, victor.sheng@ttu.edu Collaborative reasoning enhances recommendation performance by combining the strengths of symbolic learning and deep neural learning. However, current collaborative reasoning models rely on parameterized networks to simulate logical operations within the reasoning process, which (1) do not comply with all axiomatic principles of classical logic and (2) limit the model s generalizability. To address these limitations, a Fuzzy logic approach tailored for Collaborative Reasoning (Fuzz CR) is proposed in this work, aiming to augment the recommendation system with cognitive abilities. Specifically, this method redefines the sequential recommendation task as a logical query answering process to facilitate a more structured and logical progression of reasoning. Moreover, learning-free fuzzy logical operations are implemented for the designed reasoning process. Taking advantage of the inherent properties of fuzzy logic, these logical operations satisfy fundamental logical rules and ensure complete reasoning. After training, these operations can be applied to flexible reasoning processes, rather than being confined to fixed computation graphs, thereby exhibiting good generalizability. Extensive experiments conducted on publicly available datasets demonstrate the superiority of this method in solving the sequential recommendation task. Introduction In recent years, deep learning approaches to Sequential Recommendations (SRs) have predominantly focused on learning user, item, or sequence embeddings, and determine recommendations through matching functions (Hidasi et al. 2016; Kang and Mc Auley 2018; Tang and Wang 2018; Qiu et al. 2022). The key assumption of these models is that a user s future behavior can be accurately predicted based on the similarity to their previous behaviors. By utilizing various deep learning techniques (e.g., self-attention), they effectively model intricate patterns and behaviors of users over time, and consequently achieve impressive performance. However, these deep learning methods often rely on extensive samples and data training. They are effective for pattern recognition, particularly for common and widely occurring patterns in the training set. That makes these methods usually challenging to capture rare patterns in the *Corresponding author. Copyright 2025, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved. dataset (Shi et al. 2020). Moreover, recommendation systems are designed to serve subjective human needs. The process of generating recommendations needs to have the ability to emulate human reasoning and cognitive processes, as few people choose recommended items by merely calculating their similarities in reality (Shi et al. 2020; Chen et al. 2021, 2022; Tang et al. 2023). For these reasons, some recent Collaborative Reasoning (CR) works have resorted to symbolic learning for recommendation tasks from the perspective of the cognitive process (Shi et al. 2020, 2022; Zhang et al. 2022; Chen et al. 2022; Liang et al. 2023; Yuan et al. 2023). These methods enhance recommendation performance by combining the strengths of symbolic learning and deep neural learning, enabling end-to-end training of the symbolic learning and reasoning process. In addition, they benefit from the artificial incorporation of effective logic priors into the neural network, allowing the model to achieve better results (Chen et al. 2021). Nevertheless, current CR approaches are constrained by two limitations: (1) Existing CR methods (Shi et al. 2020; Chen et al. 2021, 2022; Liang et al. 2023) rely on parameterized networks to simulate logical operations within the reasoning process, requiring a large amount of training data containing such logical operations to learn the parameters. That restricts the generalizability of these approaches, i.e., it s hard for these models to be applied to situations that rarely appear in the training set. (2) The logical operators in these CR models do not fully satisfy basic logic rules (such as, the associative law (ψ1 ψ2) ψ3 ψ1 (ψ2 ψ3) for logical formulae ψ1, ψ2, ψ3), and are often defined ad-hoc. For example, some models (Shi et al. 2020; Chen et al. 2021, 2022) require a set of regularizers to constrain them to approximate the expected logical operations, rather than naturally satisfying logical rules as prior conditions. Box embedding based method Cbox4CR (Liang et al. 2023) can not handle logical operations such as and , which limits its applicability for logic inference. To address these limitations, we propose a Fuzzy logic model tailored for Collaborative Reasoning (Fuzz CR) to endow recommendation models with cognitive abilities. Specifically, we first transform the sequential recommendation task into a First-Order Logic (FOL) query answering problem (Ren, Hu, and Leskovec 2020; Ren and Leskovec 2020; Chen, Hu, and Sun 2022), to facilitate the reasoning The Thirty-Ninth AAAI Conference on Artificial Intelligence (AAAI-25) process. Then, we apply the conjunction, disjunction, and negation operations from the fuzzy logic system to the computation graph corresponding to the FOL query, determining the items the user is likely to interact with next. The advantages of this approach are threefold: (1) The entire reasoning process of the fuzzy logic system can be trained end-to-end, thus offering the simplicity of training similar to deep learning networks. (2) The operators in the fuzzy logic system are closed and proven to satisfy classical logical rules, ensuring complete reasoning (Chen, Hu, and Sun 2022). (3) The logical operations defined in our model are non-parametric neural networks. That means the only parameters that require training are the user, item, and relation embeddings. Once a dataset has learned good embeddings in the fuzzy logic space, these fuzzy embeddings can be applied to other logical reasoning formulas instead of a fixed computation graph, thereby providing excellent generalization performance. In summary, our contributions are threefold: We successfully implement differentiable fuzzy logical operators in the recommendation system, which fully satisfy fundamental logical rules and maintain the completeness of the reasoning process. We leverage the properties of learning-free fuzzy logical operators to enable their application to more flexible reasoning processes, rather than with fixed computation graphs, thus enhancing the generalizability of the reasoning process. We demonstrate significant performance improvements over baselines on three public datasets, showcasing the effectiveness of our approach in real-world scenarios. Related Works Sequential Recommendation In recent studies, various techniques such as Markov chains, Recurrent Neural Networks (RNNs), and Convolutional Neural Networks (CNNs) are extensively used in sequential recommendation (SR) tasks. For example, FPMC (Rendle, Freudenthaler, and Schmidt-Thieme 2010) models item-toitem transitions, predicting the next item based on the user s most recent interactions. GRU4Rec (Hidasi et al. 2016) employs a multi-layered Gated Recurrent Unit (GRU) architecture to effectively capture sequential patterns. Similarly, Caser (Tang and Wang 2018) utilizes CNNs in sequential recommendation, applying different types of convolutional filters to extract hidden information from user sequences. SASRec (Kang and Mc Auley 2018) introduces self-attention mechanisms, significantly enhancing recommendation systems. Furthermore, recent models such as S3Rec (Zhou et al. 2020) and CL4SRec (Xie et al. 2022) integrate self-supervised learning signals to achieve superior performance. Different from them, we utilize CR model to endow SR model with symbolic reasoning capacity. Collaborative Reasoning Recent collaborative reasoning models advance recommender systems by integrating deep learning and symbolic learning. For example, ENRL (Shi et al. 2022) and NSICF (Zhang et al. 2022) generate explainable recommendations by deriving interpretable rules from user and item attributes. Other methods such as LINN (Shi et al. 2020), NCR-E (Chen et al. 2021), and GCR (Chen et al. 2022) represent logical operators using multilayer perceptrons and apply logical regularizers to reason and predict in a continuous space. SR-PLR (Yuan et al. 2023) combines deep learning with symbolic learning through a Beta embedding method. Cbox4CR (Liang et al. 2023) enhances collaborative reasoning by using box embeddings and introduces contrastive learning in CR. However, these models do not satisfy basic logic laws and restrict generalizability, which are the problems we need to solve in this work. Logical Query Reasoning Logical query reasoning is increasingly focused on existential first-order logical queries. To handle complex queries over Knowledge Graphs (KGs), methods have been developed to represent entities and queries as points (Arakelyan et al. 2021; Hamilton et al. 2018), regions (Choudhary et al. 2021b; Ren, Hu, and Leskovec 2020), or distributions (Ren and Leskovec 2020) in high-dimensional spaces. For example, GQE (Hamilton et al. 2018) embeds queries and entities in vector space, enabling efficient computation and flexible handling of logical operations. Query2Box (Ren, Hu, and Leskovec 2020) uses box representations to naturally handle , , and operators, offering enhanced expressiveness and interpretability by defining geometric boundaries for queries. Hyp E (Choudhary et al. 2021b) models entities as hyperboloids in Poincar e ball space, supporting most logical queries except negation. Beta E (Ren and Leskovec 2020) uses Beta distributions for this purpose, and other methods employ different estimators (Choudhary et al. 2021a; Zhang et al. 2021). However, many logical reasoning rules cannot be fully satisfied in these methods. Recent methods also investigate the application of fuzzy logic for query answering, in addition to the geometric representations as points, regions, or distributions. CQD (Arakelyan et al. 2021) uses t-norms and t-conorms from fuzzy logic for better performance in zero-shot settings. Fuzz QE (Chen, Hu, and Sun 2022) and GNN-QE (Zhu et al. 2022) interpret embeddings as fuzzy sets to support logical query reasoning. However, researchers rarely consider the application of the fuzzy logic method to recommendation tasks and seldom explore its property of generalizability in recommendation scenarios. Preliminary In this section, we introduce some fundamental concepts of knowledge graphs and fuzzy logic reasoning to help readers better understand the methodology discussed later. Knowledge Graphs for First-Order Logic Queries One of the core tasks in working with KGs is to resolve complex queries that require logical reasoning, i.e., answering first-order logic queries that involve existential quantification ( ), conjunction ( ), disjunction ( ), and negation ( ) (Chen, Hu, and Sun 2022; Liang et al. 2023). Usually, a KG is made up of a set of triples eh, r, et , where each triple indicates a relationship r R from the head entity eh E to the tail entity et E. And each triple can be represented as an atomic formula r(eh, et) in FOL, where r R denotes a binary predicate, and eh, et E are its arguments. r(eh, et) = True when r(eh, et) exists. To answer FOL queries, previous works define the Disjunctive Normal Form (DNF) of a FOL query q as: q[Vx] = Vx : V1, , Vk : c1 c2 cn (1) where Vx represents the target variable of the query, V1, , Vk denote bound variables, and each c denotes a conjunctive query with one or more literals expressed as ci = vi1 vi2 vim. Each literal v denotes either an atomic formula or its negation, vij = r(e, V ) or r(e, V ) or r(V , V ) or r(V , V ), where e E, V {Vx, V1, , Vk}, V {V1, , Vk}, V = V . Therefore, the aim of query answering becomes to find a set of answers Sq = {a|a E, q[a] holds true}. Building on existing query answering methodologies (Chen, Hu, and Sun 2022; Liang et al. 2023), we incorporate the concept of computation graph into the recommendation task to outline the process of query reasoning. The computation graph is a directed acyclic graph that captures the structure of complex queries (illustrated in Figure 1). Beginning with anchor sets, the answer set is derived by iteratively applying operations to non-answer sets according to the directed edges in the computation graph. The types of edges in the computation graph are defined as: 1. Relational Projection P. Given an entity set S E, and a relation r R, projection operation maps S to another set S = S e S Pr(e), where Pr(e) {e E : r(e, e ) holds true}. 2. Conjunction/Intersection C. Given entity sets {S1, , Sn}, the intersection operation computes logical intersection of entity sets as Tn i=1 Si. 3. Disjunction/Union D. Given entity sets {S1, , Sn}, the union operation computes logical union of entity sets as Sn i=1 Si. 4. Negation/Complement N. Given an entity set S E, the complement set S is E S. Fuzzy Logic Reasoning over Knowledge Graphs Fuzzy logic (Zadeh 1965) extends Boolean logic by allowing truth values to range from 0 to 1, rather than just 0 (false) or 1 (true). In this way, it can support degrees of truth/false and provide a flexible framework for reasoning in complex and uncertain environments. Moreover, fuzzy logic ensures consistency in logical operations when truth values are 0 or 1, thereby integrating seamlessly with traditional logical systems. This extension makes fuzzy logic suitable for applications where binary true or false distinctions are inadequate, enabling it to handle uncertainty and partial truths effectively. Additionally, fuzzy logic based models using t-norm logic systems maintain logical properties within the vector space, ensuring adherence to logical laws during reasoning (Chen, Hu, and Sun 2022). In these models, the embedding model scoring function ϕ(q, e) estimates the probability I(q[e]) that an entity e answers a query q. Here, q[e] represents a logical formula where e is used to fill q, and I( ) denotes the truth value of the formula. Fuzzy logic based models inherently meet logical rules, such as those listed in Table 1 of Fuzz QE (Chen, Hu, and Sun 2022), enhancing the effectiveness of reasoning. For example, they inherently satisfy conditions such as ϕ(q1 q2, e) ϕ(q1, e) (or I(ψ1 ψ2) I(ψ1)), which reflect logical laws like the axiom ψ1 ψ2 ψ1. This implies that an entity e is less likely to satisfy ϕ(q1 q2) than q1. The three commonly used fuzzy logic systems that possess properties satisfying logical laws are product logic, G odel logic, and Łukasiewicz logic (Klement, Mesiar, and Pap 2013). In the context of product logic, the embeddings for q1 q2, q1 q2, and q can be calculated as follows: q1 q2 : C(Sq1, Sq2) = Sq1 Sq2 (2) q1 q2 : D(Sq1, Sq2) = Sq1 + Sq2 Sq1 Sq2 (3) q : N(Sq) = 1 Sq (4) where denotes element-wise multiplication, 1 is the allone vector. Boldfaced notations Sq, Sq1, Sq2 mean embeddings for entity sets Sq, Sq1, Sq2. Alternatively, the conjunction and disjunction operators can be designed based on G odel logic as follows: q1 q2 : C(Sq1, Sq2) = min(Sq1, Sq2) (5) q1 q2 : D(Sq1, Sq2) = max(Sq1, Sq2) (6) where min, max denotes element-wise minimum and maximum operation respectively. And the operators based on Łukasiewicz logic are q1 q2 : C(Sq1, Sq2) = max(Sq1 + Sq2 1, 0) (7) q1 q2 : D(Sq1, Sq2) = min(Sq1 + Sq2, 1) (8) Methodology In this section, we detail the process of applying fuzzy logic reasoning to the sequential recommendation task and explain each component of our model. Problem Formulation Formally, given the user set U, item set I, the item i(u) t , I that u U interacts with at time step t, and the user u s interactions Su = [i(u) 1 , i(u) 2 , ..., i(u) T ]. Considering the problem formulation stated in (Liang et al. 2023), the task of predicting the next item that user u will interact with is formalized as a logical query: What will the user who has interacted with items in Su interact next? The logical query can be expressed as a first-order logic query q[IT +1] = IT +1 : U : Interacted(i(u) 1 , U) Interacted(i(u) T , U) Interact(U, IT +1) (9) where IT +1 and U represent the target and bound variable, respectively. Interacted(i(u) t , U) represents the interacted 𝑞= 𝐼!"#: ( 𝑈 𝐼𝑛𝑡𝑒𝑟𝑎𝑐𝑡𝑒𝑑𝑖# $, 𝑈 𝐼𝑛𝑡𝑒𝑟𝑎𝑐𝑡𝑒𝑑𝑖! $, 𝑈 𝐼𝑛𝑡𝑒𝑟𝑎𝑐𝑡𝑈, 𝐼!"# ) 𝐼𝑛𝑡𝑒𝑟𝑎𝑐𝑡𝑢, 𝐼!"# Q: What will (the user who firstly interacted with item 1, secondly interacted with item 2, ... ,) or (user 𝑢) interact next? Negation(Interacted) Interact Projection Interact Projection Intersection Figure 1: The FOL query and computation graph for Fuzz CR. relation that identifies users interacted with item i(u) t , and Interact(U, IT +1) represents the interact relation that finds items given users interact with. By doing this, the recommendation task is successfully formalized as a query reasoning problem. However, making recommendations is a typical subjective AI task, where there is no rigid ground truth. This is different from many other purely objective AI tasks, where the ground truths are unaffected by subjective factors. For example, in the task of image classification, the models are designed to accurately predict labels such as a cat or a dog. These labels are objective facts and do not change with human feelings. In contrast, one user may like both item A and item B, while another user who liked item A may dislike item B. Hence, we consider specific user preferences in this work and represent the recommendation task to answer What will (the user who firstly interacted with item 1, secondly interacted with item 2, ,) or (user u) interact next? , i.e., q[IT +1] = IT +1 : ( U : Interacted(i(u) 1 , U) Interacted(i(u) T , U) Interact(U, IT +1)) Interact(u, IT +1) (10) Moreover, considering the different feedbacks, the negative interacted relations can be denoted as Interacted N( , ) = N(Interacted( , )) (11) The corresponding FOL query and computation graph are shown in Figure 1. By applying relational projections using the three relations: the Interacted, Interacted N, and Interact, adjacent user and item entities can be identified through anchoring entities. This process enables the discovery of the target items through reasoning. Hence, the goal of logical reasoning in this work is to find the target item set Sq that satisfies the query q[IT +1] in Eq. (10), i.e., i Sq q[i] = True. Entity and Relation Embedding in Fuzzy Space In this work, all entities (users/items) and relations are embedded into the fuzzy space [0, 1]d (Katsaras and Liu 1977), where d is the embedding dimension. Taking item i as an example, let Ωdenote the universe of all the elements, and {Ek}d k=1 denote a partition over Ω, i.e., Ω= Sd k=1 Ek and Ek Ej = for k = j. We randomly initialize item i s fuzzy embedding matrix i [0, 1]d according to its ID number, and clamp all elements into [0,1]. Here each dimension of i denotes the probability whether entity i falls into the corresponding subset Ek, i.e., i(k) = Pr(i Ek). In the same way, r R = {interacted, interact} and u U are defined as r [0, 1]d, u [0, 1]d. This representation method offers two advantages: (1) It provides a probabilistic interpretation by defining the degree of membership of each element in an item s embedding as the probability of belonging to a fuzzy subset, and (2) each dimension of the embedding vector is constrained within [0, 1], satisfying the domain and range requirements of fuzzy logic. This allows the model to perform element-wise fuzzy conjunction, disjunction, and negation operation (Chen, Hu, and Sun 2022). Fuzzy Logic Reasoning for Recommendation Projection There are various projection operators as mentioned in (Ren et al. 2023). To maintain the nonparameterized nature of our model, we deviate from Fuzz QE (Chen, Hu, and Sun 2022), which employs a neural network with a weight matrix as the projection operator. Instead, we opt for a simple element-wise dot projection oper- ation. This choice not only preserves the non-parameterized property but also enhances the generalization capability of our model. Therefore, given the fuzzy embedding r of r R and the entity embedding i (or u), the projection operator is defined as Pr(i) = i r. Reasoning After all the former definitions are prepared, we can describe the complete process of reasoning next item. Given the user u s interactions su = [i(u) 1 , i(u) 2 , ..., i(u) T ], corresponding fuzzy embedding i(u) 1 , i(u) 2 , ..., i(u) T and u, we firstly formalize the next item prediction task as a FOL query answering task as mentioned in Eq. (10). And interactions with a rating score greater than a certain threshold (3 in this work) are considered positive feedback, while those below are considered negative feedback. Secondly, the projections of interacted relations including positive and negative are applied to these item embeddings to get T user representations. For positive feedback, ut = i(u) t r1. Otherwise, ut = i(u) t N(r1), where r1 is the fuzzy embedding of interacted relation. To capture the feature of interaction order, the learnable positional embedding Pt Rd is included and added with ut: u t = ut + Pt (12) Then, after clamping u t into [0,1], the intersection operator can be applied on these T user representations to output the sequence s representation: useq = C(u 1, . . . , u T ) (13) Finally, we conduct the projection of interact relation over useq and disconjunct it with user fuzzy embedding u: Sq = D(useq r2, u r2) (14) where Sq is embedding fuzzy answer set Sq. Each dimension of Sq denotes the probability whether k the corresponding subset Ek is part of the answer set Sq, i.e., Sq(k) = Pr(Ek Sq). r2 is the fuzzy embedding of interact relation. More content about the choice of logic systems can be found in experiments, and we choose the product logic operators unless otherwise indicated. Optimization Accordingly, to determine whether item i belongs to the answer set Sq, we define the score function ϕ(q, i) as follows: ϕ(q, i) = Ei i[i Sq] = k=1 Pr(i Ek) Pr(Ek Sq) = Sqi (15) We then utilize the widely used Bayesian Personalized Ranking (BPR) (Rendle et al. 2009) loss function to optimize the entire model. For a given query q: Lbpr = log σ (γcoff (ϕ(q, i) ϕ(q, i ))) (16) where i Sq represents an answer to the query, i / Sq denotes a random negative sample, and γcoff is a coefficient used to scale the difference between the positive and negative scores. This loss function inherently works to maximize Datasets Users Items Ratings Sparsity ML100K 943 1,682 100,000 93.70% Beauty 22,363 12,101 198,502 99.93% Sports 35,598 18,357 296,337 99.95% Table 1: Statistics of the datasets. ϕ(q, i) for i Sq and minimize ϕ(q, i ) for i / Sq, thereby ensuring that relevant items are ranked higher than irrelevant ones. We also apply L2 normalization to enhance embedding learning. Finally, the final loss function can be expressed as follows: L = Lbpr + λ E 2 (17) where E represents all the embedding parameters in our model, and λ is a coefficient that controls the influence of the L2-regularization term. Experiments In this section, we provide the details about experimental settings and results. Experimental Setup Datasets Our experiments are conducted on three publicly available datasets. ML100k (Harper and Konstan 2016): Movie Lens is one of the most widely used datasets for recommendation. It includes 100,000 ratings provided by 943 users. Amazon (He and Mc Auley 2016): The Amazon dataset collection includes various e-commerce datasets crawled from the Amazon website. In our experiment, we select two relatively sparse subsets, Beauty and Sports, from the Amazon dataset for a comparative analysis. To ensure a fair comparison, we adhere closely to the preprocessing procedures outlined in NCR (Chen et al. 2021). Specifically, for each dataset, items with ratings above 3 are treated as positive interactions, while those with ratings of 3 or below are considered negative. The last two positive interactions for each user are assigned to the validation set and test set, respectively, with the remaining historical interactions used for training. The detailed statistics of each dataset are presented in Table 1. Baselines We compare our model with 9 baselines including two classical models with matrix factorization, one classical deep learning model, three session based models, and three CR models. The details are illustrated as follows: BPRMF (Rendle et al. 2009) optimizes the BPR ranking loss within a matrix factorization framework. SVD++ (Koren 2008) extends Singular Value Decomposition (SVD) by incorporating user history interactions in user modeling. Neu MF (He et al. 2017) combines traditional matrix factorization with a multi-layer perceptron. GRU4Rec (Hidasi et al. 2016) models user sequential behaviors as a strict order by using GRU. Methods ML100k Beauty Sports N@5 N@10 HR@5 HR@10 N@5 N@10 HR@5 HR@10 N@5 N@10 HR@5 HR@10 BPRMF 0.3024 0.3659 0.4501 0.6486 0.2271 0.2634 0.3198 0.4316 0.1822 0.2160 0.2591 0.3638 SVD++ 0.3087 0.3685 0.4586 0.6433 0.2313 0.2727 0.3305 0.4080 0.1893 0.2307 0.2704 0.4010 Neu MF 0.3002 0.3592 0.4490 0.6316 0.2224 0.2538 0.3112 0.4077 0.1783 0.2103 0.2539 0.3531 GRU4Rec 0.3564 0.4122 0.5134 0.6856 0.2669 0.2980 0.3610 0.4573 0.2264 0.2675 0.3254 0.4530 NARM 0.3333 0.3928 0.4898 0.6742 0.2714 0.3016 0.3684 0.4623 0.2213 0.2616 0.3196 0.4450 STAMP 0.3560 0.4070 0.5159 0.6730 0.2471 0.2782 0.3333 0.4293 0.1994 0.2413 0.2889 0.4191 NLR 0.3602 0.4151 0.5102 0.6795 0.2710 0.3057 0.3781 0.4854 0.2313 0.2724 0.3288 0.4562 NCR 0.3760 0.4240 0.5456 0.6943 0.2611 0.2856 0.3666 0.4728 0.2123 0.2562 0.3111 0.4386 CBox4CR 0.4103 0.4624 0.5741 0.7353 0.2691 0.2913 0.3693 0.4799 0.2549 0.2989 0.3621 0.4988 Fuzz CR 0.4253 0.4719 0.5915 0.7385 0.2779 0.3114 0.3885 0.4900 0.2602 0.3044 0.3700 0.5069 Improvement 3.65% 2.05% 3.03% 0.43% 2.39% 1.86% 2.75% 0.95% 2.08% 1.84% 2.18% 1.62% Table 2: Performance comparison of Fuzz CR and baseline models. The bold numbers highlight the best-performing results. NARM (Li et al. 2017) integrates GRU with an attention mechanism for sequence based recommendation. STAMP (Liu et al. 2018) captures users interests by prioritizing short-term attention and memory. NLR (Shi et al. 2020) combines deep learning and logical reasoning in a logical integrated neural network. NCR (Chen et al. 2021) blends representation learning with logical reasoning by learning logical operations. Cbox4CR (Liang et al. 2023) integrates box embeddings in a contrastive learning based CR model. Evaluation Metrics Following the approach used in NLR (Shi et al. 2020), we sample 100 negative interactions for each positive interaction and evaluate the ranking among these 101 candidates. We use Normalized discounted cumulative gain at rank K (N@K) and Hit Ratio at rank K (HR@K) as our evaluation metrics, reporting results for K = 5, 10. To ensure the reliability of our metrics, we repeat the experiment with different random seeds. We compute the test metrics ten times and report the mean value, as negative samples are generated randomly. Implementation Details We conduct our implementation of all methods by using Py Torch (Paszke et al. 2017) with the Adam optimizer (Kingma and Ba 2015) on a 32GB Tesla V100-PCIE GPU. All models are trained for 100 epochs with a learning rate of 0.001, applying early stopping after 20 epochs. The L2 regularization weight λ is set to 0.0001. Unless specified otherwise, the sequence length is configured to 5. We use a batch size of 256 and set the embedding dimension to 64. The coefficient γcoff is adjusted to 15 for the Sports dataset and 25 for the other two datasets. Moreover, we choose a score of 3 out of 5 as a threshold for positive feedback in the CR model. Overall Performance The experimental results on three public datasets are shown in Table 2. From these results, Fuzz CR achieves the best results on all three datasets by combining fuzzy logic with collaborative reasoning. The experimental results show that we can improve the performance of recommendation by benefiting from the complementary strengths of deep learning and cognitive reasoning. Additionally, we can draw the following conclusions: Firstly, traditional methods like BPRMF, SVD++ and Neu MF perform poorly because they lack the ability to model sequential signals, which are crucial for understanding dynamic user behavior. In contrast, sequential models such as GRU4Rec, NARM and STAMP perform better by effectively incorporating temporal dependencies into their recommendations. Secondly, among these baseline models, reasoning based approaches like NLR and CBox4CR show better performance, highlighting the importance of logical reasoning in recommendation tasks. CBox4CR outperforms the baselines by implementing logical reasoning through the use of box embeddings to model queries and entities, rather than relying on regularizations to constrain logical operations. However, they are still surpassed by Fuzz CR. This may be due to the limitations in CBox4CR s ability to handle the disjunction and negation operator in a closed form, which are crucial elements in logical reasoning. For instance, the disjunction of two boxes remains separate rather than merging into one, and the negation of a box does not result in a box. Additionally, Cbox4CR includes contrastive learning, whereas Fuzz CR is simpler in design. Ablation Study In this section, we first conduct three ablation studies, each corresponding to a different variant of our model. These variants include: removing the disjunction with user embedding as described in Eq. (10) (w/oper), removing the negation operation in Eq. (11) (w/oneg), and removing the position encoding in Eq. (12) (w/opos). Figure 2(a) compares the N@10 performance of Fuzz CR with these three variants. The results show that Fuzz CR outperforms the other variants, indicating that encoding user interests and sequence dynamics contributes positively to recommendation performance. Moreover, the introduction of logical negation helps to better represent user behavior by distinguishing between ML100K Sports Beauty Fuzz CR w/o_per w/o_neg w/o_pos ML100K Sports Beauty Fuzz CR Gödel Figure 2: Ablation study. (a) Fuzz CR vs Three Variants. (b) Fuzz CR with Three Logic Systems. positive and negative interactions. Additionally, in Figure 2(b), we compare Fuzz CR using different logical systems. The results indicate that product logic performs better than G odel logic and Łukasiewicz logic. The reason is that product logic is well-suited for representing intersections, as it captures the probabilistic nature of each dimension in the fuzzy logic embedding. This alignment with the probabilistic multiplication rule ensures a more accurate physical interpretation of simultaneous events. Generalizability of Fuzz CR To validate the generalizability of our fuzzy logic system based CR model, we conduct experiments by pretraining item, user, and relation fuzzy logic embeddings on 1p queries. Specifically, we train every triplet Interacted(i(u) t , u) and Interact(u, i(u) t ) in the train set by using fuzzy logic, focusing on answering queries like which user will interact with i(u) t and which item will user u interact with, without considering sequence relationships. This process allows us to obtain all the necessary entity and relation embeddings. Since our logic operations are non-parametric, they theoretically generalize to all possible logical equations. In our experiments, we use the pre-trained embeddings to answer queries as defined in Eq. (10). As the results are shown in Table 3, the model pre-trained on 1p queries Fuzz CRp outperforms traditional recommendation models to some extent. It is important to note that since position encoding is not trained during pre-training, the position encoding in Eq. (12) is also removed in Fuzz CRp. This demonstrates the superior generalizability of the fuzzy logic embedding approach, which is also a key advantage of symbolic learning. Additionally, we test the predictive performance of Fuzz CRp with different sequence lengths and compare it with four representative baselines, as illustrated in Figure 3(a). The results show that the model performs best when the sequence length is 3, suggesting that not all items in a sequence positively contribute to the recommendation performance. Hyper-parameter Sensitivity In this section, we examine the impact of different values of the most critical and sensitive parameter, γcoff, on performance. In this experiment, we adjust γcoff in Eq. (16) while Datasets Metrix BPRMF Neu MF GRU4Rec NLR Fuzz CRp N@5 0.3024 0.3002 0.3564 0.3602 0.3644 N@10 0.3659 0.3592 0.4122 0.4151 0.4187 HR@5 0.4501 0.4490 0.5134 0.5102 0.5059 HR@10 0.6486 0.6316 0.6856 0.6795 0.6737 N@5 0.2271 0.2224 0.2669 0.2710 0.2409 N@10 0.2634 0.2538 0.2980 0.3057 0.2801 HR@5 0.3198 0.3112 0.3610 0.3781 0.3506 HR@10 0.4316 0.4077 0.4573 0.4854 0.4718 N@5 0.1822 0.1783 0.2264 0.2313 0.2435 N@10 0.2160 0.2103 0.2675 0.2724 0.2859 HR@5 0.2591 0.2539 0.3254 0.3288 0.3475 HR@10 0.3638 0.3531 0.4530 0.4562 0.4788 Table 3: Evaluation of Fuzz CRp pre-trained on 1p queries compared to baseline models. 10 20 30 (b) 0.8 N@5 N@10 HR@5 HR@10 Figure 3: Impact of (a) Inference sequence length and (b) γcoff in ML100K. keeping all other parameters constant to analyze its specific influence on the results. The γcoff parameter in the BPR loss function acts as a scaling factor that adjusts the impact of the difference between the positive and negative samples on the overall loss. A larger value of γcoff amplifies the difference, making the model more sensitive to even small variations, thereby accelerating the learning process. Conversely, a smaller value reduces the sensitivity, resulting in less reactive to minor differences. As shown in Figure 3(b), we find that setting γcoff in the range of 20 to 30 provides the best performance, offering a balanced trade-off between sensitivity and stability in model optimization. Conclusion This work presents Fuzz CR, a fuzzy logic model developed for collaborative reasoning in sequential recommendation tasks. It transforms the recommendation process into a first-order logic query answering problem and utilizes fuzzy logic operations to enhance reasoning capabilities. Benefiting from the learning-free fuzzy logical operations, the model adheres to fundamental logical rules and offers flexible application beyond fixed computation graphs. Extensive experimentation on multiple datasets demonstrates the model s superior performance and generalizability compared to existing methods. In future work, we could explore the integration of large language models to incorporate more diverse side-information into the framework, enabling the construction of more comprehensive queries tailored to the diverse tastes and preferences of users. Acknowledgments This research was partially supported by the NSFC (62376180, 62176175), the National Key Research and Development Program of China (2023YFF0725002), the major project of natural science research in Universities of Jiangsu Province (21KJA520004), the Suzhou Science and Technology Development Program (SYG202328), Postgraduate Research & Practice Innovation Program of Jiangsu Province (KYCX24 3328) and the Priority Academic Program Development of Jiangsu Higher Education Institutions. References Arakelyan, E.; Daza, D.; Minervini, P.; and Cochez, M. 2021. Complex Query Answering with Neural Link Predictors. In ICLR. Chen, H.; Li, Y.; Shi, S.; Liu, S.; Zhu, H.; and Zhang, Y. 2022. Graph Collaborative Reasoning. In WSDM, 75 84. Chen, H.; Shi, S.; Li, Y.; and Zhang, Y. 2021. Neural collaborative reasoning. In WWW, 1516 1527. Chen, X.; Hu, Z.; and Sun, Y. 2022. Fuzzy Logic Based Logical Query Answering on Knowledge Graphs. In AAAI, 3939 3948. Choudhary, N.; Rao, N.; Katariya, S.; Subbian, K.; and Reddy, C. K. 2021a. Probabilistic Entity Representation Model for Reasoning over Knowledge Graphs. In Neur IPS, 23440 23451. Choudhary, N.; Rao, N.; Katariya, S.; Subbian, K.; and Reddy, C. K. 2021b. Self-Supervised Hyperboloid Representations from Logical Queries over Knowledge Graphs. In WWW, 1373 1384. Hamilton, W. L.; Bajaj, P.; Zitnik, M.; Jurafsky, D.; and Leskovec, J. 2018. Embedding Logical Queries on Knowledge Graphs. In Neur IPS, 2030 2041. Harper, F. M.; and Konstan, J. A. 2016. The Movie Lens Datasets: History and Context. ACM Trans. Interact. Intell. Syst., 5(4): 19:1 19:19. He, R.; and Mc Auley, J. 2016. Ups and Downs: Modeling the Visual Evolution of Fashion Trends with One-class Collaborative Filtering. In WWW, 507 517. He, X.; Liao, L.; Zhang, H.; Nie, L.; Hu, X.; and Chua, T.-S. 2017. Neural Collaborative Filtering. In WWW, 173 182. Hidasi, B.; Karatzoglou, A.; Baltrunas, L.; and Tikk, D. 2016. Session-based Recommendations with Recurrent Neural Networks. In ICLR. Kang, W.; and Mc Auley, J. J. 2018. Self-Attentive Sequential Recommendation. In ICDM, 197 206. Katsaras, A.; and Liu, D. B. 1977. Fuzzy Vector Spaces and Fuzzy Topological Vector Spaces. Journal of Mathematical Analysis and Applications, 58(1): 135 146. Kingma, D. P.; and Ba, J. 2015. Adam: A Method for Stochastic Optimization. In ICLR. Klement, E. P.; Mesiar, R.; and Pap, E. 2013. Triangular Norms. Springer Science & Business Media. Koren, Y. 2008. Factorization Meets the Neighborhood: A Multifaceted Collaborative Filtering Model. In KDD, 426 434. Li, J.; Ren, P.; Chen, Z.; Ren, Z.; Lian, T.; and Ma, J. 2017. Neural Attentive Session-based Recommendation. In CIKM, 1419 1428. Liang, T.; Zhang, Y.; Di, Q.; Xia, C.; Li, Y.; and Yin, Y. 2023. Contrastive Box Embedding for Collaborative Reasoning. In SIGIR, 38 47. Liu, Q.; Zeng, Y.; Mokhosi, R.; and Zhang, H. 2018. STAMP: Short-Term Attention/Memory Priority Model for Session-Based Recommendation. In KDD, 1831 1839. Paszke, A.; Gross, S.; Chintala, S.; Chanan, G.; Yang, E.; De Vito, Z.; Lin, Z.; Desmaison, A.; Antiga, L.; and Lerer, A. 2017. Automatic differentiation in Py Torch. Qiu, R.; Huang, Z.; Yin, H.; and Wang, Z. 2022. Contrastive Learning for Representation Degeneration Problem in Sequential Recommendation. In WSDM, 813 823. Ren, H.; Galkin, M.; Cochez, M.; Zhu, Z.; and Leskovec, J. 2023. Neural Graph Reasoning: Complex Logical Query Answering Meets Graph Databases. ar Xiv:2303.14617. Ren, H.; Hu, W.; and Leskovec, J. 2020. Query2box: Reasoning over Knowledge Graphs in Vector Space Using Box Embeddings. In ICLR. Ren, H.; and Leskovec, J. 2020. Beta Embeddings for Multihop Logical Reasoning in Knowledge Graphs. In Neur IPS, 19716 19726. Rendle, S.; Freudenthaler, C.; Gantner, Z.; and Schmidt Thieme, L. 2009. BPR: Bayesian Personalized Ranking from Implicit Feedback. In UAI, 452 461. Rendle, S.; Freudenthaler, C.; and Schmidt-Thieme, L. 2010. Factorizing Personalized Markov Chains for Nextbasket Recommendation. In WWW, 811 820. Shi, S.; Chen, H.; Ma, W.; Mao, J.; Zhang, M.; and Zhang, Y. 2020. Neural Logic Reasoning. In CIKM, 1365 1374. Shi, S.; Xie, Y.; Wang, Z.; Ding, B.; Li, Y.; and Zhang, M. 2022. Explainable Neural Rule Learning. In WWW, 3031 3041. Tang, J.; and Wang, K. 2018. Personalized Top-n Sequential Recommendation via Cconvolutional Sequence Embedding. In WSDM, 565 573. Tang, Z.; Floto, G.; Toroghi, A.; Pei, S.; Zhang, X.; and Sanner, S. 2023. Logic Rec: Recommendation with Users Logical Requirements. In SIGIR, 2129 2133. Xie, X.; Sun, F.; Liu, Z.; Wu, S.; Gao, J.; Zhang, J.; Ding, B.; and Cui, B. 2022. Contrastive Learning for Sequential Recommendation. In ICDE, 1259 1273. Yuan, H.; Zhao, P.; Xian, X.; Liu, G.; Liu, Y.; Sheng, V. S.; and Zhao, L. 2023. Sequential Recommendation with Probabilistic Logical Reasoning. In IJCAI, 2432 2440. Zadeh, L. A. 1965. Fuzzy sets. Information and Control, 8(3): 338 353. Zhang, W.; Yan, J.; Wang, Z.; and Wang, J. 2022. Neuro Symbolic Interpretable Collaborative Filtering for Attributebased Recommendation. In WWW, 3229 3238. Zhang, Z.; Wang, J.; Chen, J.; Ji, S.; and Wu, F. 2021. Con E: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs. In Neur IPS, 19172 19183. Zhou, K.; Wang, H.; Zhao, W. X.; Zhu, Y.; Wang, S.; Zhang, F.; Wang, Z.; and Wen, J.-R. 2020. S3-rec: Self-Supervised Learning for Sequential Recommendation with Mutual Information Maximization. In CIKM, 1893 1902. Zhu, Z.; Galkin, M.; Zhang, Z.; and Tang, J. 2022. Neural-Symbolic Models for Logical Queries on Knowledge Graphs. In ICML, 27454 27478.