Next Article in Journal
Spatio-Temporal Deep Learning-Assisted Multi-Period AC Optimal Power Flow
Next Article in Special Issue
Positioning of UAVs in Urban Environments Using Fusion of TDOA and AOA Data Based on Extended Kalman Filter
Previous Article in Journal
Selected Problems in Measuring Magnetic Hysteresis Loops and Determining Losses per Unit of Volume for Ferrite and Nanocrystalline Cores
Previous Article in Special Issue
A Multi-Behavior and Sequence-Aware Recommendation Method
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

TLFormer: Scalable Taylor Linear Attention in Transformer for Collaborative Filtering

1
Institute of Intelligent Computing, School of Computer Science and Technology, Shandong University, Qingdao 266237, China
2
University of Health and Rehabilitation Sciences, Qingdao 266113, China
3
Shandong Hi-Speed Qingdao Investment Co., Ltd., Qingdao 266100, China
*
Author to whom correspondence should be addressed.
Electronics 2026, 15(4), 759; https://doi.org/10.3390/electronics15040759
Submission received: 20 January 2026 / Revised: 3 February 2026 / Accepted: 4 February 2026 / Published: 11 February 2026

Abstract

Graph Neural Networks (GNNs) have become foundational models in recommender systems due to their ability to propagate information over user–item bipartite graphs via neighborhood aggregation. Despite their empirical success, GNNs are inherently constrained by their reliance on local connectivity, which limits their ability to capture global interaction patterns, particularly in large-scale recommendation scenarios characterized by severe data sparsity. To address these challenges, we propose the Taylor Linear attention in Transformer (TLFormer), which enhances recommendation performance by enabling global attention across all user–item pairs while preserving graph structural information. Unlike existing Transformer-based recommendation approaches that focus on local attention patterns, TLFormer introduces a novel linear attention mechanism derived from the first-order Taylor approximation, allowing efficient computation of all-pair interactions. TLFormer integrates spatial topology as positional encoding while maintaining linear complexity, effectively balancing computational efficiency with model expressiveness for large-scale recommendation scenarios. Extensive experiments across multiple datasets demonstrate that TLFormer significantly outperforms state-of-the-art methods, particularly in scenarios with sparse interactions and long-tail distributions.

1. Introduction

With the explosive growth of the Internet, recommender systems [1,2,3,4,5,6,7] have become essential tools for information filtering and discovery, with applications spanning e-commerce [8], movies [9], music platforms [10], and increasingly multimodal scenarios [11]. At their core, recommender systems aim to present users with items that match their preferences by analyzing user behavior data [9]. Collaborative filtering [12,13,14] represents one of the most effective approaches in recommender systems, using patterns in user–item interaction data to identify underlying similarities and predict user preferences. GNNs [15] have emerged as powerful models for recommendation tasks [16] through their neighbor-based message passing mechanisms, demonstrating both architectural simplicity and empirical effectiveness [17,18,19].
Despite their promising performance, GNN-based recommendation models suffer from several key limitations that restrict their effectiveness. First, their message-passing mechanism confines information propagation to local neighborhoods [12,16,17], creating an inherent bottleneck in capturing long-range dependencies between users and items. This architectural constraint [20,21] proves particularly problematic in recommendation scenarios characterized by extreme sparsity, where meaningful connections often exist beyond immediate neighborhoods. Second, GNNs tend to amplify noise [22,23] through multi-hop propagation, as irrelevant signals accumulate when traversing multiple neighborhood layers. Third, these models frequently exacerbate the popularity bias problem by over-emphasizing frequently occurring (popular) items while suppressing representations of items in the long tail [24,25]. The aggregate effect of these limitations manifests in suboptimal recommendation quality for diverse user preferences, particularly for niche interests and less popular items that comprise the majority of most item catalogs [26].
Graph Transformers (GTs) have emerged as promising alternatives to GNNs across various graph-based tasks, demonstrating superior performance in capturing complex patterns and long-range dependency of node relationships [27,28,29,30,31]. The key advantage of GT architectures stems from their attention mechanism, which computes relationships between all pairs of nodes regardless of their position in the graph structure, effectively addressing the limitations of local message passing in GNNs. However, adapting these architectures to recommender systems presents several fundamental challenges. First, computational scalability remains a critical barrier. The quadratic time and space complexity of standard attention mechanisms renders global attention practically inapplicable for large-scale recommendation datasets with millions of users and items [32,33]. This limitation is particularly severe in sparse interaction graphs, where a substantial portion of attention weights correspond to non-existent connections, resulting in computational inefficiency. While recent adaptations such as GraphGPS [27], Nodeformer [34], and Knowformer [35] have made significant strides in reducing computational complexity through linear attention mechanisms, these advances have primarily benefited generic graph learning tasks rather than recommender systems. Second, preserving graph structural information presents unique challenges in recommendation contexts. Even on smaller recommendation datasets, global attention often collapses to near-zero weights, failing to effectively capture topological structures in user–item interaction graphs. Although various structural encoding approaches, including random walk-based encodings [36], Laplacian positional encodings [37], and centrality-based spatial encodings [31], have been proposed, these methods exhibit limited scalability in large-scale recommendation scenarios. Unlike sequential data in Natural Language Processing [38], user–item graphs exhibit permutation invariance, making the definition of positional encodings non-trivial in recommendation contexts. Furthermore, the fundamental distinction in task objectives—where most GT architectures [39] target node or graph classification while recommender systems focus on Top-K link prediction in bipartite graphs—creates a misalignment between architectural design and recommendation-specific requirements, limiting the effectiveness of existing attention mechanisms despite their computational advantages. Although some prior work [21,40] has attempted to leverage Transformer-style architectures to mitigate the locality of message passing and better capture long-range dependencies in recommender systems, their substantial algorithmic complexity and engineering overhead have limited their scalability and broad deployment.
To address the challenges of computational complexity and long-range dependencies in recommender systems, we propose TLFormer, a deliberately simple and transparent Transformer with linear-time complexity designed for recommendation tasks. Our approach leverages a global attention mechanism that enables each user to consider all items while maintaining linear time and space complexity. To effectively handle large-scale sparse interaction data, TLFormer implements three complementary components. The Token Lookup Table component serves as the foundation, enabling efficient retrieval of representation vectors by treating users and items as tokens in the system. Building upon this representation, the structural encoding module integrates spatial positional information to capture the underlying graph structure of user–item interactions. The Linear Attention Mechanism ties these elements together through a single-layer, single-head attention model, processing the tokenized representations and structural information to learn comprehensive user and item embeddings. We conducted extensive experiments on four real-world recommendation datasets with varying scales and sparsity levels. In the large-scale Amazon-Kindle dataset with hundreds of thousands of nodes, TLFormer achieves consistent improvements over state-of-the-art (SOTA) methods, surpassing MGFormer by 9.13% on average in terms of Recall and NDCG. Similar performance gains are observed on smaller datasets, with an average 5.72% improvement over GONet on Amazon-CD. Our implementation is publicly available at https://github.com/hdd1009/TLFormer, accessed on 19 January 2026.

2. Preliminaries

2.1. Problem Formulation

Let U = { u 1 , u 2 , , u M } and I = { i 1 , i 2 , , i N } denote the user set and the item set, respectively. Let V = U I represent the set of all nodes, including both users and items. The user–item interaction matrix is defined as R R M × N , where R u i is set to 1 if the user u has previously interacted with the item i, and 0 for pairs of unobserved pairs of the user–item. Here, M and N denote the cardinalities of the user set | U | and the item set | I | , respectively. The objective of the recommendation is to predict the interaction scores for pairs of unobserved user–item, which indicate the likelihood that a user will interact with a specific item. Based on these predicted scores, items with the Top-K highest scores are recommended to each user.
Typically, an encoder f ( · ) maps users and items to low-dimensional representation vectors f ( u ) , f ( i ) R d , where d denotes the dimensionality of the representation space. The encoder can be implemented using various techniques, including Matrix Factorization [41,42], Variational AutoEncoders [43], and GNNs [17,18]. Among these, GNN-based encoders [16] have gained significant attention due to their ability to leverage the graph structure in user–item interaction data. For GNNs, the representation learning process follows a layer-wise recursive update rule. At the l-th layer, the representation of a node u is updated by aggregating the embeddings of its neighboring nodes N u from the ( l 1 ) -th layer and combining them with its own representation:
f ( l ) ( u ) = f combine f ( l 1 ) ( u ) , f aggregate f ( l 1 ) ( i ) i N u .
here f aggregate ( · ) aggregates the features of neighboring nodes, while f combine ( · ) integrates the aggregated features with the node’s own representation. Various designs for these functions have been proposed in the literature [16,17]. However, this layer-wise aggregation process restricts the model’s receptive field to l-hop neighbors, making it challenging to capture long-range dependencies or potential unobserved interactions in the graph. After L layers of propagation, a readout function f readout ( · ) is typically applied to generate the final node representations:
f ( u ) = f readout f ( l ) ( u ) l = 0 , , L .
Common implementations of the readout function include mean or sum operations [18].
Finally, a prediction layer is constructed to estimate the likelihood of interaction between a user u and an item i. This is commonly achieved by computing the dot product of their final representations, f ( u ) f ( i ) , which facilitates efficient retrieval in large-scale recommender systems.

2.2. Transformer Architecture

The Transformer architecture [38,44,45] introduced the self-attention mechanism to process sequential data, which has since become fundamental to Large Language Models [46], computer vision [47], and multimodal scenarios [44,45,48]. The self-attention mechanism computes pairwise interactions between all positions in an input sequence, enabling the model to capture long-range dependencies. The architecture consists of two primary components: the self-attention module for computing contextual relationships and the feedforward neural network module for processing the attended representations. For graph-structured data, GTs [27,34] adapt the self-attention mechanism to operate on nodes rather than sequence positions.
Formally, let X R n × d denote the feature matrix of the input nodes in GTs, where n is the number of nodes, and d is the dimension of the features. In the self-attention module, X is projected into three matrices through linear transformations: the query matrix Q = X W Q , the key matrix K = X W K , and the value matrix V = X W V . Here, W Q R d × d q , W K R d × d k , W V R d × d v are trainable weight matrices, where d q , d k , d v represent the dimensions of the query, key and value, respectively. The self-attention computation is defined as follows:
Attn ( X ) = Attention ( Q , K , V ) : = Softmax ( Q K T d ) V ,
where d is the scaled factor. In practice, multi-head attention mechanisms are commonly used, where multiple Equation (1) are concatenated. This approach has been shown to be highly efficient in real-world applications [46]. The output of the self-attention mechanism is then passed through LayerNorm [49], Dropout [50], and a residual connection [51] before reaching the feedforward network. These components together form the Transformer block, as shown in the following equation:
X = X + Dropout ( LayerNorm ( Attn ( X ) ) ) , X = FFN ( X ) : = ReLU ( X W 1 + b 1 ) W 2 + b 2 ,
where W 1 , W 2 are d × d matrices and b 1 , b 2 are d dimensional vectors. By stacking multiple blocks of Equation (2), a Transformer model can be constructed, ultimately providing node representations that capture global information. Moreover, the self-attention mechanism is equivariant to permutations of the input nodes. The Transformer generates identical representation vectors for nodes with the same neighboring nodes in a graph, irrespective of the broader graph structure, effectively addressing the challenge of long-range dependencies in GNNs [27].
However, this global attention mechanism introduces computational challenges [32], as calculating attention scores between all pairs of nodes results in quadratic complexity with respect to the number of nodes. This limitation becomes particularly significant when dealing with large-scale graphs common in recommender systems.

3. The Proposed TLFormer

In this section, we introduce Taylor Linear Attention in Transformer (TLFormer), a novel approach to address the challenges of global dependency modeling in graph-based recommender systems that can capture all-pair node relationships with linear computational complexity. As illustrated in Figure 1, TLFormer consists of three essential components: TokenTable, Structural Encoding and Linear Attention Module.

3.1. Representation Vector Lookup

Following the architectural principles of Transformers [38], we implement a TokenTable module that maps users and items to their corresponding representation vectors. For any user u and item i, their representations are obtained through:
e u = TokenTable ( u ) , e i = TokenTable ( i ) ,
where e u R d and e i R d represent the d-dimensional embedding vectors in the latent space. These embeddings are stored in a unified token embedding matrix E R ( M + N ) × d , where M and N denote the number of users and items, respectively.

3.2. Spatial Structural Information

While attention mechanisms effectively weight input information, they inherently lack sequence-order awareness, which is traditionally addressed through positional encoding [38] in language models. However, in graph-based contexts [15], the primary consideration shifts from sequential ordering to structural relationships. Unlike sequence models [38], graphs exhibit equivariance properties and encode rich topological information rather than positional ordering. Recent research has shown that incorporating structural information significantly enhances the performance of the Transformer model in graph-based tasks [27,52].
For our bipartite recommender systems, we leverage structural topology as a form of positional encoding through Singular Value Decomposition (SVD) [52] of the interaction matrix R :
SVD ( R ) U ^ · Σ · V ^ ( U ^ Σ ) ( V ^ Σ ) .
The resulting matrices ( U ^ Σ ) R M × d and ( V ^ Σ ) R N × d capture the structural representations for users and items, respectively. We consolidate these representations into a unified structural encoding matrix S R ( M + N ) × d . The final input representation combines this structural information with the token embeddings:
X = Concat ( E , S ) .
The resulting matrix X R ( M + N ) × 2 d integrates both embedding and structural information. Importantly, since node positions in the structural layout are determined solely by inter-node interactions, the structural encoding S remains fixed post-graph construction and is therefore maintained as a non-trainable component.

3.3. Taylor Linear Attention

While the structure encoding strengthens the topological information in our bipartite user–item graph, the standard self-attention mechanism in Equation (1) still faces computational challenges due to its quadratic complexity. To address this limitation, we first observe that the attention operation between users and items can be reformulated through kernel methods [53]. This reformulation enables us to develop a more efficient attention mechanism that maintains the global modeling capacity while reducing computational overhead. Specifically, for any user u in our recommendation graph, the attention operation can be expressed as
Attn ( x u ) = i V κ exp ( x u , x i ) w V κ exp ( x u , x w ) f ( x i ) ,
where x u represents the query vector of node u computed as Q = X W Q , x i denotes the key vector of node i obtained through K = X W K , and f ( x i ) corresponds to the value representation V = f v ( X ) . The parameters W Q , W K R 2 d × 2 d learn the query and key transformations. The exponential kernel κ exp quantifies node similarity:
κ exp ( x u , x i ) : = exp x u , x i 2 d ,
where · , · computes the dot product between transformed vectors.
Following attention-based architectures [27,38], we apply Frobenius normalization to both query and key functions. Although this normalization traditionally helps with gradient flow and training stability in Transformer models, we observe that in our recommendation context, it consistently produces values close to zero. This numerical characteristic allows us to further simplify Equation (7) by eliminating the scaling factor  2 d :
κ exp ( x u , x i ) : = exp x ¯ u , x ¯ i ,
where x ¯ u = x u / | x u | F and x ¯ i = x i / | x i | F represent the normalized embeddings.
Building upon the normalized kernel, we derive a computationally efficient approximation through first-order Taylor expansion of the exponential function:
exp ( x ¯ u , x ¯ i ) 1 + x ¯ u , x ¯ i + exp ( ϵ ) 2 x ¯ u , x ¯ i 2 ,
where ϵ ( 0 , x ¯ u , x ¯ i ) is the expansion point. Based on this approximation, we propose a simplified linear kernel function:
κ linear ( x ¯ u , x ¯ i ) = 1 + x ¯ u , x ¯ i
To establish the validity of this approximation, we provide the following theoretical guarantee.
Theorem 1.
For any normalized user and item embeddings x ¯ u and x ¯ i , the approximation error between the exponential kernel κ exp and the linear kernel κ linear is bounded:
| κ exp ( x ¯ u , x ¯ i ) κ linear ( x ¯ u , x ¯ i ) | e 2
This theoretical bound ensures that our linear approximation maintains controlled error while reducing the computational complexity of the attention mechanism from O ( N 2 ) to O ( N ) , where N is the total number of users and items, and e denotes the natural constant.
  • Matrix Notation for Linear Attention. For practical implementation, we express our approach using matrix notation. The concatenated token embeddings for users and items are represented by X R ( M + N ) × 2 d . Following standard attention mechanisms, we compute the query and key matrices through linear projections followed by Frobenius normalization:
    Q = X W Q | X W Q | F , K = X W K | X W K | F , V = X .
    Motivated by the empirical findings in LightGCN [17], we omit feature transformation on node embeddings and set V = X , which not only simplifies the model architecture, but also empirically improves the performance. The linear attention computation can then be formulated as a two-step process:
    D = diag 1 + Q ( K + 1 ) + | V | | V | , X = D 1 V + 1 V + Q ( K V ) | V | .
    This formulation maintains linear computational complexity in both time and space with respect to the number of the users and items by strategically computing matrix products between key-value pairs before query interaction.

3.4. Model Training

In this work, we adopt the loss function with two complementary terms: alignment and uniformity [54,55]. The alignment loss minimizes the distance between representations of interacting user–item pairs:
align = E ( u , i ) p pos x u x i 2 ,
where p pos denotes the distribution of observed user–item interactions. The uniformity loss does not require explicit negative sampling and encourages user and item representations to spread uniformly over the unit hypersphere by maximizing the distance between representations within each mini-batch:
uniform = log E ( u , u ) p user e x u x u 2 + log E ( i , i ) p item e x i x i 2 ,
where the exponential form of the loss naturally bounds the repulsion between dissimilar pairs. The complete objective combines these terms:
L = align + γ · uniform ,
where γ balances the trade-off between pulling similar pairs together and pushing dissimilar pairs apart. By operating directly on normalized embeddings and leveraging batchwise comparisons, this formulation provides richer learning signals compared to traditional pairwise approaches.

3.5. Complexity Analysis

The computational cost of TLFormer comes from two primary components: the structural encoding computation via SVD and the linear attention mechanism. SVD-based structural encoding is computed once during preprocessing and remains fixed during training, thus not contributing to the runtime complexity of model operations. The main computational cost comes from our linear attention mechanism in Equation (13), we observe that the time complexity is O ( N d ) , where N denotes the total number of nodes (users and items combined) and d represents the embedding dimension. Meanwhile, the space complexity is also O ( N d ) , corresponding to the storage of node embeddings and attention parameters. We validate these theoretical complexity bounds through empirical run-time analysis in Section 4.3, demonstrating that TLFormer maintains its efficiency advantages as the dataset increases. Algorithm 1 shows the pseudocode of TLFormer.
Algorithm 1 Pseudocode of TLFormer
Input: user–item interaction matrix R , embedding dimension d, balance weight γ , query matrix W q , key matrix W k .
Output: Node representation matrix H
  1:
Initialize TokenTable X using Xavier initialization
  2:
Compute structural encoding S = SVD ( R ) and freeze parameters
  3:
Concatenate embeddings X = Concat ( X , S )
  4:
for each batch of user–item pairs ( u , i ) R do
  5:
      Compute normalized attention matrices:
  6:
            Q = X W q | X W q | F
  7:
            K = X W k | X W k | F
  8:
            V = X
  9:
      Compute diagonal matrix:
10:
            D = diag ( 1 + Q ( K T + 1 ) + | V | | V | )
11:
      Apply Taylor linear attention:
12:
            X = ( V + 1 T V + Q ( K T V ) | V | ) D 1
13:
      Extract and normalize embeddings:
14:
            x u = x u / | x u | , x i = x i / | x i |
15:
      Compute loss:
16:
            L = align ( x u , x i ) + γ ( uniform ( x u ) + uniform ( x i ) ) / 2
17:
      Update parameters X , W q , W k via gradient descent
18:
end for
19:
return   X ¯ = X

4. Experiment

In this section, we conduct extensive experiments to evaluate the effectiveness of TLFormer against SOTA baselines. We first describe our experimental setup, including datasets, baseline methods, and evaluation metrics. We then present comprehensive results analyzing model performance, followed by detailed ablation studies examining the impact of different components and hyperparameters. Through these experiments, we demonstrate that TLFormer achieves superior performance while maintaining computational efficiency across diverse recommendation scenarios.

4.1. Experimental Settings

  • Datasets. Our experiments utilize four real-world public datasets that have been widely adopted in recommendation research [18,56]:
  • Pinterest [56]: A large-scale image recommendation dataset collected from Pinterest social media platform, containing implicit user–image interactions through user behavior data.
  • Amazon Datasets (https://jmcauley.ucsd.edu/data/amazon/ accessed on 15 March 2024): Three large-scale product review datasets from Amazon’s e-commerce platform. We select Movies, Kindle, and CDs categories for their substantial size and diverse interaction patterns.
The statistical characteristics of these datasets are summarized in Table 1. Following standard practice in recommender systems [55,57], we utilize 5-core datasets that filter out users and items with fewer than five interactions during preprocessing to ensure reliable model learning. This filtering step helps maintain data quality by removing sparse interactions that could potentially introduce noise into the learning process.
  • Baselines. We compare TLFormer against a diverse set of established recommendation algorithms, including traditional matrix factorization approaches, generative models, GNN-based models, and recent self-supervised learning methods.
  • BPRMF [42] is a typical negative sampling method, which optimizes ranking loss using the maximum a posterior estimation.
  • RecVAE [43] builds upon Variational AutoEncoders (VAEs) and enhances Mult-VAE with a novel β -VAE hyperparameter setting, a composite prior for latent codes, and an alternating update training strategy.
  • LightGCN [17] is a simplified GCN that removes activation functions and feature transformation to facilitate large-scale recommender systems.
  • CLRec [58] is a contrastive learning method that adopts InfoNCE loss to reduce exposure bias through inverse propensity weighting in the recommender systems.
  • SGL [26] applies contrastive learning to recommender systems by generating multiple graph views through edge dropping, node dropping, and random walks, thereby enhancing the robustness of learned user and item representations.
  • CONet [59] captures both local and nonlocal messages in graphs by performing k-Means clustering on nodes’ GNN embeddings to obtain graph-level representations (e.g., centroids).
  • DirectAU [55] introduces the concepts of alignment and uniformity into recommender systems, eliminating negative sampling and ensuring closer user–item pairs, while making the distribution of user and item sets within the same batch more uniform.
  • MGFormer [21] can capture all-pair interactions among nodes with linear complexity and incorporate learnable relative degree information to appropriately reweigh the attentions.
  • BIGCF [13] revisits user–item interactions from a causal perspective by disentangling them into collective and individual intents, and reconstructs the interaction graph through a bilateral intent modeling framework grounded in generative graph learning.
  • Evaluation Metrics. For evaluation, we employ two standard metrics in recommender systems: Recall and Normalized Discounted Cumulative Gain (NDCG) at different cutoff values K 10 , 20 , 50 . We use NDCG@20 as the validation metric for model selection during training [57]. Each dataset is split into training, validation, and test sets with a ratio of 8:1:1. To ensure comprehensive evaluation, we adopt the full-ranking protocol where the model ranks all items for each user rather than using a sampled subset. All baselines are tuned to their optimal performance through multiple experimental runs, with the best results reported for fair comparison.
  • Experimental Setup. We implement all methods using RecBole [57] frameworks for fair comparison. For optimization, we use Adam [60] with a learning rate of 1 × 10−3 and train for a maximum of 300 epochs. We employ early stopping with a patience of 10 epochs to prevent overfitting. All models use embedding dimensions of either 64 or 128, with a batch size of 1024. For TLFormer, the default encoder consists of a linear transformation mapping user/item IDs from the embedding table, and we conduct extensive parameter tuning for the trade-off weight between uniformity and alignment objectives. We follow the hyperparameter settings as specified in the original papers [13,17,21,26,42,43,55,58,59]. All parameters are initialized using the Xavier initialization [61].

4.2. Accuracy Evaluation

Table 2 presents the performance comparison between TLFormer and SOTA baseline methods across different Top-K recommendation metrics ( K { 10 , 20 , 50 } ). The relative improvements over the strongest baseline are reported. Based on these experimental results, we make several key observations regarding model performance and effectiveness.
The experimental results demonstrate that Transformer-based architectures (TLFormer and MGFormer) achieve superior performance compared to conventional approaches. This performance gap highlights the effectiveness of global attention mechanisms in capturing complex user–item relationships, surpassing traditional collaborative filtering methods. Notably, TLFormer achieves these improvements with a single-layer linear attention mechanism, indicating that architectural simplicity combined with global context modeling can enhance recommendation performance. While GNN-based models like LightGCN show advantages over traditional matrix factorization through message-passing mechanisms, their performance remains constrained by the local nature of graph convolutions. This limitation is most evident on the Amazon-Kindle dataset, where LightGCN achieves an NDCG@20 of 0.1009, significantly below TLFormer’s 0.1460. This 45% performance gap demonstrates the clear advantage of our global attention approach over localized message passing for capturing user–item relationships in sparse recommendation scenarios.

4.3. Efficiency Comparison

To evaluate computational efficiency, we compare the per-epoch runtime of TLFormer against LightGCN and DirectAU across all datasets. As shown in Figure 2, TLFormer demonstrates consistently faster execution speeds across all four datasets. The improvements are particularly notable on the Pinterest dataset, where TLFormer achieves a 47% reduction in per-epoch runtime compared to baseline methods. These empirical results validate that our linear attention design translates to substantial practical efficiency gains in large-scale recommendation scenarios.

4.4. Convergence Analysis

We further analyze the convergence behavior of TLFormer against LightGCN [17] and DirectAU [55] on the Amazon-Movies and Pinterest datasets. Figure 3 tracks the training loss progression across epochs, while Figure 4 monitors the validation Recall@20 performance. These metrics provide complementary views of model convergence dynamics.
TLFormer demonstrates superior convergence efficiency compared to baseline models on both datasets. Specifically, TLFormer reaches optimal performance at the 40th and 46th epochs for Amazon-Movies and Pinterest, respectively, while DirectAU requires 41 and 62 epochs, and LightGCN needs 202 and 229 epochs. These results quantify substantial reductions in training time, with TLFormer achieving both faster convergence and improved performance metrics. The accelerated convergence of TLFormer stems from two architectural advantages. First, the Alignment and Uniformity loss normalizes representations to the unit hypersphere, avoiding the representation collapse often observed with LightGCN’s BPR loss and single negative sampling. Second, the global attention mechanism enables comprehensive all-pair message passing, allowing nodes to attend to the entire graph structure rather than just local neighborhoods. This broader perception field facilitates more efficient learning of user–item relationships compared to DirectAU’s local message passing approach.
Figure 4 reveals that DirectAU achieves higher initial Recall@20 performance than TLFormer. This early advantage stems from DirectAU’s GNN-based architecture, which restricts information flow to local neighborhoods, naturally filtering noise in the initial training stages. Conversely, TLFormer’s global attention mechanism processes all user–item relationships simultaneously, initially incorporating more noise but ultimately learning more comprehensive representations as training progresses. This pattern illustrates the fundamental trade-off between immediate local precision and long-term global comprehension in recommendation models.

4.5. Noise Robustness Analysis

To evaluate the robustness of TLFormer, we conduct systematic experiments with adversarial perturbations in the training data. Following the methodology in [26], we introduce controlled levels of noise by contaminating the training set with negative user–item interactions at ratios of 5%, 10%, 15%, and 20%. The validation and test sets remained unmodified to maintain evaluation integrity. Figure 5 presents comparative results on the Amazon-CDs and Amazon-Movies datasets, demonstrating performance variations under different noise conditions.
Analysis of the experimental results reveals that while both TLFormer and DirectAU experience performance degradation with increasing noise, the impact differs significantly between the two models. DirectAU exhibits steeper performance decline as noise levels increase, whereas TLFormer maintains more stable performance characteristics, particularly evident in the Amazon-Movies dataset where it demonstrates notably smoother degradation patterns. This resilience can be attributed to TLFormer’s all-pair global attention mechanism, which enables effective filtering of spurious interactions through comprehensive modeling of long-range dependencies. The global receptive field provides TLFormer with enhanced capability to distinguish genuine user preferences from noise-induced patterns, resulting in more consistent interpretation of user–item relationships even under noisy conditions.

4.6. Effectiveness in Long-Tail Recommendation

As highlighted in prior work [26], GNN-based recommendation models are prone to the long-tail problem. To evaluate TLFormer’s capability in handling this challenge, we divide the items into ten equally-sized groups based on interaction frequency, with higher group indices corresponding to items with greater popularity. To quantitatively assess performance across these groups, we decompose the Recall@20 metric into group-specific components:
R e c a l l = g = 1 10 1 M u = 1 M | ( l rec u ) ( g ) l test u | | l test u | = g = 1 10 R e c a l l ( g ) ,
where M denotes the total user count, l r e c u represents the top-K recommendations for user u, and l t e s t u contains the user’s relevant items in the test set. The term R e c a l l ( g ) measures the recommendation accuracy for group g.
Experimental results shown in Figure 6 reveal distinct patterns across datasets. On Amazon-CDs, TLFormer demonstrates uniform performance improvements across all popularity groups. In contrast, for Amazon-Movies, the gains are concentrated in groups with sparse interactions. These results indicate that the global attention mechanism in TLFormer more effectively captures item representations compared to DirectAU’s local message-passing approach, particularly for items with limited interaction data.

4.7. Ablation Study

The architecture of TLFormer presented in Figure 1 emphasizes structural simplicity through its core components. We conduct ablation experiments to evaluate the contribution of the structural encoding module, particularly focusing on the SVD-based encoding mechanism. Table 3 presents comparative results across two representative datasets, Amazon-Movies and Pinterest, examining both Recall and NDCG metrics with and without structural encoding and Linear Attention. Experimental results show that adding SVD-based structural encoding and Taylor Linear Attention yields substantial gains, with pronounced improvements under sparse interaction regimes. These findings indicate that both components are crucial for capturing latent interaction patterns, with Taylor Linear Attention contributing the larger effect, particularly beneficial for datasets with varying density characteristics and complex user–item relationships.

4.8. Parameter Sensitivity

The practical advantage of TLFormer extends beyond its architectural design to its hyperparameter configuration, requiring only the tuning of γ , which controls the balance between alignment and uniformity objectives in the loss function. To assess the model’s robustness to this parameter, we evaluate performance metrics NDCG@20 and Recall@20 across different values of γ on four benchmark datasets, as shown in Figure 7.
The performance curves exhibit a consistent pattern of initial improvement followed by gradual degradation, with the optimal γ value varying across datasets. This behavior suggests a stable relationship between the alignment and uniformity components of the loss function, making the model relatively robust to parameter selection. For practical implementation, we recommend an initial coarse search within the range [0.01, 10], followed by localized fine-tuning around promising values based on validation performance. This straightforward approach to parameter selection enhances the model’s usability while maintaining robust performance across different recommendation scenarios.

5. Related Work

5.1. GNNs for Recommender Systems

GNNs [62,63,64] have become a cornerstone of recommender systems, utilizing a message-passing mechanism to aggregate information from adjacent nodes [13,17,18,20,26,65,66,67,68]. This approach has proven effective for modeling user–item interactions in implicit feedback bipartite graphs and has inspired numerous modified frameworks. For instance, NGCF [16] learns the representation embeddings of the node using a graph convolutional network enhanced with feature transformation and activation functions. Building on NGCF, LightGCN [17] simplifies the framework by removing feature transformation and activation functions, resulting in a more lightweight encoder module. Similarly, SimCE [18] employs a lightweight graph convolutional module as the encoder but incorporates Sampled Softmax Cross-Entropy, comparing one positive sample with multiple negative samples to enhance learning effectiveness. Despite extensive research on using GNNs as encoder, the challenge of data sparsity in recommender systems datasets persists. Self-supervised learning (SSL), as a solution to alleviate data sparsity, has been widely adopted in this domain. SGL [26] pioneered the integration of SSL into recommender systems, proposing three techniques—edge dropping, node dropping, and random walks—to enhance the learning performance of GNNs. NCL [12] introduced the concept of semantic neighborhoods and combined it with structure-contrastive learning. By employing the Expectation-Maximization (EM) algorithm for optimization, it enhanced the robustness of the model. DirectAU [55] retains the lightweight GNN architecture but optimizes the loss function by introducing Alignment and Uniformity to ensure well-distributed representations on the unit hypersphere.
Despite their success, GNN-based models face several inherent challenges. Limited receptive fields [26], caused by data sparsity, noisy interactions, and the long-tail effect, restrict their ability to capture long-range dependencies [39]. These limitations hinder their ability to fully exploit global structural information in large-scale graphs, which remains a critical bottleneck in improving recommendation performance.

5.2. Graph Transformers

GTs compute fully connected weight matrices for all nodes [27,28,29,30,34,69,70] and are capable of operating even without explicit graph inputs [39]. Compared to GNNs, GTs effectively address the pervasive issue of data sparsity in graph datasets by leveraging their global receptive field and fully connected design. Several notable GT architectures have been proposed in recent years inspired by advances in Transformers [71,72,73,74]. GraphGPS [27] introduced a general architecture that achieves linear complexity with respect to the number of nodes and edges by decoupling local real edge aggregation from the fully connected Transformer layers. Nodeformer [34] employs a kernelized Gumbel-Softmax operator to reduce algorithmic complexity to linearity with respect to node numbers, enabling the learning of latent graph structures in a differentiable manner for large, potentially fully connected graphs. SGFormer [39] simplifies the attention mechanism, employing a lightweight attention model that efficiently propagates information among arbitrary nodes in a single layer. In the domain of recommender systems, Transformer-based architectures have shown significant promise. LightGT [75] introduces a modality-specific embedding and a layer-wise position encoder to improve similarity measurements, while employing a lightweight self-attention block to improve computational efficiency. GFormer [75] combines a graph Transformer with parameterized collaborative rationale discovery to selectively enhance user–item relationships while preserving global contextual information. MGFormer [21], designed with linear complexity, treats all nodes of users and items as independent tokens, augments them with positional embeddings, and processes them through a kernelized attention mechanism. Additionally, MGFormer incorporates learnable relative degree information to appropriately reweight attention scores, further improving recommendation performance.
Despite their advances, methods like LightGT and GFormer retain GNNs components, which may inherit challenges such as sensitivity to data sparsity. Recent progress in lightweight Transformers [21,35,39] has focused on addressing these challenges both theoretically and practically. Building on this direction, our work proposes an effective and efficient Transformer framework tailored for recommender systems, specifically designed to address data sparsity in large-scale datasets.

6. Conclusions

This work advances recommender systems by introducing TLFormer, which addresses key efficiency challenges in attention mechanisms for large-scale recommender systems. By reformulating attention computation through Taylor expansion and integrating structural graph information, our approach achieves linear complexity while preserving global dependency modeling capabilities. Extensive experiments across diverse datasets demonstrate consistent performance improvements over SOTA methods, along with significant reductions in training time and enhanced robustness to noise and long-tail scenarios. Future work will explore adaptive structural encoding mechanisms and investigate the application of our linear attention framework to multi-modal recommendation scenarios, particularly focusing on the integration of heterogeneous information sources while maintaining computational efficiency.

Author Contributions

Conceptualization, D.H. and D.Y.; methodology, D.H.; software, D.H.; validation, D.H., D.Y. and X.H.; formal analysis, D.H.; investigation, D.H.; resources, D.Y.; data curation, D.H.; writing—original draft preparation, D.H.; writing—review and editing, D.Y. and X.H.; visualization, D.H.; supervision, D.Y.; project administration, X.H.; funding acquisition, D.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded in part by the Major Basic Research Program of the Shandong Provincial Natural Science Foundation (Grant No. ZR2025ZD18), and by the Joint Key Funds of the National Natural Science Foundation of China (Grant No. U23A20302).

Data Availability Statement

Data are contained within the article.

Acknowledgments

The authors would like to sincerely thank Dongsheng Luo from Florida International University, Huiyuan Chen from Amazon, Fan Liu from Southeast University, Zhenyang Li from City University of Hong Kong, and Shunkang Zhang from NVIDIA, for their valuable discussions and insightful suggestions.

Conflicts of Interest

Author Xiaowen Hou was employed by the company Shandong Hi-Speed Qingdao Investment Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Peng, J.; Gong, J.; Zhou, C.; Zang, Q.; Fang, X.; Yang, K.; Yu, J. Kgcfrec: Improving collaborative filtering recommendation with knowledge graph. Electronics 2024, 13, 1927. [Google Scholar] [CrossRef]
  2. Li, P.; Zhan, W.; Gao, L.; Wang, S.; Yang, L. Multimodal Recommendation System Based on Cross Self-Attention Fusion. Systems 2025, 13, 57. [Google Scholar] [CrossRef]
  3. Wang, L.; Jin, D. A time-sensitive graph neural network for session-based new item recommendation. Electronics 2024, 13, 223. [Google Scholar] [CrossRef]
  4. Lu, H.; Chen, Z. SocialJGCF: Social Recommendation with Jacobi Polynomial-Based Graph Collaborative Filtering. Appl. Sci. 2024, 14, 12070. [Google Scholar] [CrossRef]
  5. Duan, Z.; Wang, C.; Zhong, W. Ssgcl: Simple social recommendation with graph contrastive learning. Mathematics 2024, 12, 1107. [Google Scholar] [CrossRef]
  6. Chen, H.; Lin, Y.; Pan, M.; Wang, L.; Yeh, C.C.M.; Li, X.; Zheng, Y.; Wang, F.; Yang, H. Denoising self-attentive sequential recommendation. In Proceedings of the 16th ACM Conference on Recommender Systems, Seattle, WA, USA, 18–23 September 2022; pp. 92–101. [Google Scholar]
  7. Chen, H.; Li, J. Adversarial tensor factorization for context-aware recommendation. In Proceedings of the 13th ACM Conference on Recommender Systems, Copenhagen, Denmark, 16–20 September 2019; pp. 363–367. [Google Scholar]
  8. Bawack, R.E.; Wamba, S.F.; Carillo, K.D.A.; Akter, S. Artificial intelligence in E-Commerce: A bibliometric study and literature review. Electron. Mark. 2022, 32, 297–338. [Google Scholar] [CrossRef]
  9. Goyani, M.; Chaurasiya, N. A review of movie recommendation system: Limitations, Survey and Challenges. ELCVIA Electron. Lett. Comput. Vis. Image Anal. 2020, 19, 18–37. [Google Scholar] [CrossRef]
  10. Schedl, M.; Knees, P.; McFee, B.; Bogdanov, D. Music recommendation systems: Techniques, use cases, and challenges. In Recommender Systems Handbook; Springer: Berlin/Heidelberg, Germany, 2021; pp. 927–971. [Google Scholar]
  11. Li, Z.; Liu, F.; Wei, Y.; Cheng, Z.; Nie, L.; Kankanhalli, M.S. Attribute-driven Disentangled Representation Learning for Multimodal Recommendation. In Proceedings of the 32nd ACM International Conference on Multimedia; ACM: New York, NY, USA, 2024; pp. 9660–9669. [Google Scholar]
  12. Lin, Z.; Tian, C.; Hou, Y.; Zhao, W.X. Improving graph collaborative filtering with neighborhood-enriched contrastive learning. In Proceedings of the ACM Web Conference 2022, Lyon, France, 25–29 April 2022; pp. 2320–2329. [Google Scholar]
  13. Zhang, Y.; Sang, L.; Zhang, Y. Exploring the individuality and collectivity of intents behind interactions for graph collaborative filtering. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, Washington, DC, USA, 14–18 July 2024; pp. 1253–1262. [Google Scholar]
  14. Liu, F.; Zhao, S.; Cheng, Z.; Nie, L.; Kankanhalli, M. Cluster-based graph collaborative filtering. ACM Trans. Inf. Syst. 2024, 42, 1–24. [Google Scholar] [CrossRef]
  15. Kipf, T.N.; Welling, M. Semi-supervised classification with graph convolutional networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
  16. Wang, X.; He, X.; Wang, M.; Feng, F.; Chua, T.S. Neural graph collaborative filtering. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, Paris, France, 21–25 July 2019; pp. 165–174. [Google Scholar]
  17. He, X.; Deng, K.; Wang, X.; Li, Y.; Zhang, Y.; Wang, M. Lightgcn: Simplifying and powering graph convolution network for recommendation. In Proceedings of the SIGIR, Xi’an, China, 25–30 July 2020. [Google Scholar]
  18. Yang, X.; Chen, H.; Yan, Y.; Tang, Y.; Zhao, Y.; Xu, E.; Cai, Y.; Tong, H. SimCE: Simplifying Cross-Entropy Loss for Collaborative Filtering. arXiv 2024, arXiv:2406.16170. [Google Scholar]
  19. Cheng, Z.; Han, S.; Liu, F.; Zhu, L.; Gao, Z.; Peng, Y. Multi-behavior recommendation with cascading graph convolution networks. In Proceedings of the ACM Web Conference 2023, Austin, TX, USA, 30 April–4 May 2023; pp. 1181–1189. [Google Scholar]
  20. Huang, J.; Cao, Q.; Xie, R.; Zhang, S.; Xia, F.; Shen, H.; Cheng, X. Adversarial learning data augmentation for graph contrastive learning in recommendation. In Proceedings of the International Conference on Database Systems for Advanced Applications, Tianjin, China, 17–20 April 2023; Springer: New York, NY, USA, 2023; pp. 373–388. [Google Scholar]
  21. Chen, H.; Xu, Z.; Yeh, C.C.M.; Lai, V.; Zheng, Y.; Xu, M.; Tong, H. Masked Graph Transformer for Large-Scale Recommendation. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, Washington, DC, USA, 14–18 July 2024; pp. 2502–2506. [Google Scholar]
  22. Jain, K.; Jindal, R. Sampling and noise filtering methods for recommender systems: A literature review. Eng. Appl. Artif. Intell. 2023, 122, 106129. [Google Scholar] [CrossRef]
  23. Wang, S.; Zhang, X.; Wang, Y.; Ricci, F. Trustworthy recommender systems. ACM Trans. Intell. Syst. Technol. 2024, 15, 84. [Google Scholar] [CrossRef]
  24. Sreepada, R.S.; Patra, B.K. Enhancing long tail item recommendation in collaborative filtering: An econophysics-inspired approach. Electron. Commer. Res. Appl. 2021, 49, 101089. [Google Scholar] [CrossRef]
  25. Xu, Z.; Chai, Z.; Xu, C.; Yuan, C.; Yang, H. Towards effective collaborative learning in long-tailed recognition. IEEE Trans. Multimed. 2023, 26, 3754–3764. [Google Scholar] [CrossRef]
  26. Wu, J.; Wang, X.; Feng, F.; He, X.; Chen, L.; Lian, J.; Xie, X. Self-supervised graph learning for recommendation. In Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, Virtual, 11–15 July 2021; pp. 726–735. [Google Scholar]
  27. Rampášek, L.; Galkin, M.; Dwivedi, V.P.; Luu, A.T.; Wolf, G.; Beaini, D. Recipe for a general, powerful, scalable graph transformer. In Proceedings of the NeurIPS, New Orleans, LA, USA, 28 November–9 December 2022. [Google Scholar]
  28. Geisler, S.; Li, Y.; Mankowitz, D.J.; Cemgil, A.T.; Günnemann, S.; Paduraru, C. Transformers meet directed graphs. In Proceedings of the International Conference on Machine Learning, Honolulu, HI, USA, 23–29 July 2023. [Google Scholar]
  29. Ma, L.; Lin, C.; Lim, D.; Romero-Soriano, A.; Dokania, P.K.; Coates, M.; Torr, P.H.; Lim, S.N. Graph inductive biases in transformers without message passing. In Proceedings of the ICML, Honolulu, HI, USA, 23–29 July 2023. [Google Scholar]
  30. Shirzad, H.; Velingker, A.; Venkatachalam, B.; Sutherland, D.J.; Sinop, A.K. Exphormer: Sparse transformers for graphs. In Proceedings of the ICML, Honolulu, HI, USA, 23–29 July 2023. [Google Scholar]
  31. Ying, C.; Cai, T.; Luo, S.; Zheng, S.; Ke, G.; He, D.; Shen, Y.; Liu, T.Y. Do transformers really perform badly for graph representation? In Proceedings of the NeurIPS, Virtual, 6–14 December 2021. [Google Scholar]
  32. Liu, C.; Yao, Z.; Zhan, Y.; Ma, X.; Pan, S.; Hu, W. Gradformer: Graph Transformer with Exponential Decay. arXiv 2024, arXiv:2404.15729. [Google Scholar] [CrossRef]
  33. Xing, Y.; Wang, X.; Li, Y.; Huang, H.; Shi, C. Less is more: On the over-globalizing problem in graph transformers. arXiv 2024, arXiv:2405.01102. [Google Scholar] [CrossRef]
  34. Wu, Q.; Zhao, W.; Li, Z.; Wipf, D.P.; Yan, J. Nodeformer: A scalable graph structure learning transformer for node classification. In Proceedings of the NeurIPS, New Orleans, LA, USA, 28 November–9 December 2022. [Google Scholar]
  35. Liu, J.; Mao, Q.; Jiang, W.; Li, J. KnowFormer: Revisiting Transformers for Knowledge Graph Reasoning. arXiv 2024, arXiv:2409.12865. [Google Scholar]
  36. Dwivedi, V.P.; Luu, A.T.; Laurent, T.; Bengio, Y.; Bresson, X. Graph Neural Networks with Learnable Structural and Positional Representations. In Proceedings of the ICLR, Vienna, Austria, 3–7 May 2021. [Google Scholar]
  37. Choromanski, K.M.; Likhosherstov, V.; Dohan, D.; Song, X.; Gane, A.; Sarlos, T.; Hawkins, P.; Davis, J.Q.; Mohiuddin, A.; Kaiser, L.; et al. Rethinking Attention with Performers. In Proceedings of the ICLR, Vienna, Austria, 3–7 May 2021. [Google Scholar]
  38. Vaswani, A. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
  39. Wu, Q.; Zhao, W.; Yang, C.; Zhang, H.; Nie, F.; Jiang, H.; Bian, Y.; Yan, J. Simplifying and empowering transformers for large-graph representations. Adv. Neural Inf. Process. Syst. 2024, 36, 2826. [Google Scholar]
  40. Li, C.; Xia, L.; Ren, X.; Ye, Y.; Xu, Y.; Huang, C. Graph transformer for recommendation. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, Taipei, Taiwan, 23–27 July 2023; pp. 1680–1689. [Google Scholar]
  41. Koren, Y.; Bell, R.; Volinsky, C. Matrix factorization techniques for recommender systems. Computer 2009, 42, 30–37. [Google Scholar] [CrossRef]
  42. Rendle, S.; Freudenthaler, C.; Gantner, Z.; Schmidt-Thieme, L. BPR: Bayesian personalized ranking from implicit feedback. arXiv 2012, arXiv:1205.2618. [Google Scholar] [CrossRef]
  43. Shenbin, I.; Alekseev, A.; Tutubalina, E.; Malykh, V.; Nikolenko, S.I. Recvae: A new variational autoencoder for top-n recommendations with implicit feedback. In Proceedings of the 13th International Conference on Web search and DATA Mining, Houston, TX, USA, 3–7 February 2020; pp. 528–536. [Google Scholar]
  44. Li, Z.; Guo, Y.; Wang, K.; Chen, X.; Nie, L.; Kankanhalli, M.S. Do Vision-Language Transformers Exhibit Visual Commonsense? An Empirical Study of VCR. In Proceedings of the 31st ACM International Conference on Multimedia; ACM: New York, NY, USA, 2023; pp. 5634–5644. [Google Scholar]
  45. Li, Z.; Guo, Y.; Wang, K.; Liu, F.; Nie, L.; Kankanhalli, M.S. Learning to Agree on Vision Attention for Visual Commonsense Reasoning. IEEE Trans. Multimed. 2024, 26, 1065–1075. [Google Scholar] [CrossRef]
  46. OpenAI. GPT-4 Technical Report. arXiv 2024, arXiv:2303.08774. [Google Scholar]
  47. Koresh, E.; Gross, R.D.; Meir, Y.; Tzach, Y.; Halevi, T.; Kanter, I. Unified CNNs and transformers underlying learning mechanism reveals multi-head attention modus vivendi. Phys. A Stat. Mech. Its Appl. 2025, 666, 130529. [Google Scholar] [CrossRef]
  48. Li, Z.; Guo, Y.; Wang, K.; Wei, Y.; Nie, L.; Kankanhalli, M.S. Joint Answering and Explanation for Visual Commonsense Reasoning. IEEE Trans. Image Process. 2023, 32, 3836–3846. [Google Scholar] [CrossRef]
  49. Ba, J.L.; Kiros, J.R.; Hinton, G.E. Layer Normalization. arXiv 2016, arXiv:1607.06450. [Google Scholar] [CrossRef]
  50. Srivastava, N.; Hinton, G.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 2014, 15, 1929–1958. [Google Scholar]
  51. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 July 2016; pp. 770–778. [Google Scholar]
  52. Hussain, M.S.; Zaki, M.J.; Subramanian, D. Global self-attention as a replacement for graph convolution. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Washington, DC, USA, 14–18 August 2022; pp. 655–665. [Google Scholar]
  53. Liu, F.; Huang, X.; Chen, Y.; Suykens, J.A. Random features for kernel approximation: A survey on algorithms, theory, and beyond. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 7128–7148. [Google Scholar] [CrossRef]
  54. Wang, T.; Isola, P. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Proceedings of the International Conference on Machine Learning, PMLR, Virtual, 13–18 July 2020; pp. 9929–9939. [Google Scholar]
  55. Wang, C.; Yu, Y.; Ma, W.; Zhang, M.; Chen, C.; Liu, Y.; Ma, S. Towards representation alignment and uniformity in collaborative filtering. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Washington, DC, USA, 14–18 August 2022; pp. 1816–1825. [Google Scholar]
  56. He, X.; Liao, L.; Zhang, H.; Nie, L.; Hu, X.; Chua, T.S. Neural collaborative filtering. In Proceedings of the 26th International Conference on World Wide Web, Perth, Australia, 3–7 April 2017; pp. 173–182. [Google Scholar]
  57. Zhao, W.X.; Mu, S.; Hou, Y.; Lin, Z.; Chen, Y.; Pan, X.; Li, K.; Lu, Y.; Wang, H.; Tian, C.; et al. Recbole: Towards a unified, comprehensive and efficient framework for recommendation algorithms. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, Virtual, 1–5 November 2021; pp. 4653–4664. [Google Scholar]
  58. Zhou, C.; Ma, J.; Zhang, J.; Zhou, J.; Yang, H. Contrastive learning for debiased candidate generation in large-scale recommender systems. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, Singapore, 14–18 August 2021; pp. 3985–3995. [Google Scholar]
  59. Chen, H.; Yeh, C.C.M.; Wang, F.; Yang, H. Graph neural transport networks with non-local attentions for recommender systems. In Proceedings of the ACM Web Conference 2022, Lyon, France, 25–29 April 2022; pp. 1955–1964. [Google Scholar]
  60. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2017, arXiv:1412.6980. [Google Scholar] [CrossRef]
  61. Glorot, X.; Bengio, Y. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. JMLR Workshop and Conference Proceedings, Sardinia, Italy, 13–15 May 2010; pp. 249–256. [Google Scholar]
  62. Luo, D.; Cheng, W.; Xu, D.; Yu, W.; Zong, B.; Chen, H.; Zhang, X. Parameterized explainer for graph neural network. Adv. Neural Inf. Process. Syst. 2020, 33, 19620–19631. [Google Scholar]
  63. Luo, D.; Zhao, T.; Cheng, W.; Xu, D.; Han, F.; Yu, W.; Liu, X.; Chen, H.; Zhang, X. Towards inductive and efficient explanations for graph neural networks. IEEE Trans. Pattern Anal. Mach. Intell. 2024, 46, 5245–5259. [Google Scholar] [CrossRef]
  64. Chen, H.; Wang, L.; Lin, Y.; Yeh, C.C.M.; Wang, F.; Yang, H. Structured graph convolutional networks with stochastic masks for recommender systems. In Proceedings of the SIGIR, Virtual, 11–15 July 2021. [Google Scholar]
  65. Yu, J.; Yin, H.; Xia, X.; Chen, T.; Cui, L.; Nguyen, Q.V.H. Are graph augmentations necessary? simple graph contrastive learning for recommendation. In Proceedings of the 45th international ACM SIGIR conference on research and development in information retrieval, Padua, Italy, 13–18 July 2022; pp. 1294–1303. [Google Scholar]
  66. Wu, Y.; Zhang, L.; Mo, F.; Zhu, T.; Ma, W.; Nie, J.Y. Unifying Graph Convolution and Contrastive Learning in Collaborative Filtering. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Barcelona, Spain, 25–29 August 2024; pp. 3425–3436. [Google Scholar]
  67. Wu, W.; Wang, C.; Shen, D.; Qin, C.; Chen, L.; Xiong, H. AFDGCF: Adaptive Feature De-correlation Graph Collaborative Filtering for Recommendations. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, Washington, DC, USA, 14–18 July 2024; pp. 1242–1252. [Google Scholar]
  68. Zhao, J.; Wenjie, W.; Xu, Y.; Sun, T.; Feng, F.; Chua, T.S. Denoising diffusion recommender model. In Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, Washington, DC, USA, 14–18 July 2024; pp. 1370–1379. [Google Scholar]
  69. Chen, D.; O’Bray, L.; Borgwardt, K. Structure-aware transformer for graph representation learning. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2022; pp. 3469–3489. [Google Scholar]
  70. Wu, Q.; Yang, C.; Zhao, W.; He, Y.; Wipf, D.; Yan, J. Difformer: Scalable (graph) transformers induced by energy constrained diffusion. arXiv 2023, arXiv:2301.09474. [Google Scholar] [CrossRef]
  71. Qiu, Y.; Zhang, K.; Wang, C.; Luo, W.; Li, H.; Jin, Z. Mb-taylorformer: Multi-branch efficient transformer expanded by taylor formula for image dehazing. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Paris, France, 1–6 October 2023; pp. 12802–12813. [Google Scholar]
  72. Babiloni, F.; Marras, I.; Deng, J.; Kokkinos, F.; Maggioni, M.; Chrysos, G.; Torr, P.; Zafeiriou, S. Linear Complexity Self-Attention with 3rd-Order Polynomials. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 12726–12737. [Google Scholar] [PubMed]
  73. Katharopoulos, A.; Vyas, A.; Pappas, N.; Fleuret, F. Transformers are rnns: Fast autoregressive transformers with linear attention. In Proceedings of the International Conference on Machine Learning; PMLR: Cambridge, MA, USA, 2020; pp. 5156–5165. [Google Scholar]
  74. Nauen, T.C.; Palacio, S.; Dengel, A. Taylorshift: Shifting the complexity of self-attention from squared to linear (and back) using taylor-softmax. In Proceedings of the International Conference on Pattern Recognition; Springer: Berlin/Heidelberg, Germany, 2025; pp. 1–16. [Google Scholar]
  75. Wei, Y.; Liu, W.; Liu, F.; Wang, X.; Nie, L.; Chua, T.S. Lightgt: A light graph transformer for multimedia recommendation. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, Taipei, Taiwan, 23–27 July 2023; pp. 1508–1517. [Google Scholar]
Figure 1. The proposed TLFormer architecture, illustrated with its data flow, takes the interaction matrix R as input, processing it through two pathways: one generates representation embeddings via the TokenTable, while the other extracts structural encodings using SVD. These components are concatenated to form X, a combined embedding fed into TLFormer’s single-layer global attention mechanism, which is shown in Section 4.3 to operate without constructing an attention weight matrix. The resulting output, X ¯ , captures representative features for all users and items, enabling a comprehensive view of user–item interactions.
Figure 1. The proposed TLFormer architecture, illustrated with its data flow, takes the interaction matrix R as input, processing it through two pathways: one generates representation embeddings via the TokenTable, while the other extracts structural encodings using SVD. These components are concatenated to form X, a combined embedding fed into TLFormer’s single-layer global attention mechanism, which is shown in Section 4.3 to operate without constructing an attention weight matrix. The resulting output, X ¯ , captures representative features for all users and items, enabling a comprehensive view of user–item interactions.
Electronics 15 00759 g001
Figure 2. Per-epoch runtime comparison of methods across different Datasets.
Figure 2. Per-epoch runtime comparison of methods across different Datasets.
Electronics 15 00759 g002
Figure 3. Comparison of Train Loss across Amazon-Movies and Pinterest datasets.
Figure 3. Comparison of Train Loss across Amazon-Movies and Pinterest datasets.
Electronics 15 00759 g003
Figure 4. Comparison of Recall@20 across Amazon-Movies and Pinterest datasets.
Figure 4. Comparison of Recall@20 across Amazon-Movies and Pinterest datasets.
Electronics 15 00759 g004
Figure 5. Model performance w . r . t . noise ration. The line represents the trend of Recall@20 as it varies with the ratio of noise.
Figure 5. Model performance w . r . t . noise ration. The line represents the trend of Recall@20 as it varies with the ratio of noise.
Electronics 15 00759 g005
Figure 6. Performance comparison over different item groups between Amazon-CDs and Amazon-Movies (Y-axis in Log Scale).
Figure 6. Performance comparison over different item groups between Amazon-CDs and Amazon-Movies (Y-axis in Log Scale).
Electronics 15 00759 g006
Figure 7. Parameter sensitivity with regard to the tradeoff of l alignment and l uniform in TLFormer.
Figure 7. Parameter sensitivity with regard to the tradeoff of l alignment and l uniform in TLFormer.
Electronics 15 00759 g007
Table 1. Statistics of 4 benchmark datasets.
Table 1. Statistics of 4 benchmark datasets.
Dataset#User#Item#Inter.Density
Pinterest55.2k9.9k1500.8k0.274%
Amazon-CDs43.2k35.6k777.4k0.051%
Amazon-Kindle138.9k98.7k1910.0k0.014%
Amazon-Movies44.4k25.9k1070.9k0.096%
Table 2. Top-K recommendation performance on four datasets. The best results are in bold, and the runner-up are underlined. Superscripts ** denote p 0.01 in a paired t-test comparing TLFormer with the runner-up. Relative improvements are denoted as Improv.
Table 2. Top-K recommendation performance on four datasets. The best results are in bold, and the runner-up are underlined. Superscripts ** denote p 0.01 in a paired t-test comparing TLFormer with the runner-up. Relative improvements are denoted as Improv.
SettingBaseline MethodsOurs
DatasetMetricBPRMFRecVAELightGCNCLRecSGLGONetDirectAUMGFormerBIGCFTLFormerImprov.
PinterestRecall@100.08400.10990.10280.10500.10700.11140.11700.11730.11630.1220 **4.01%
Recall@200.13930.17030.16160.16870.16870.17670.18340.18200.18310.1899 **3.54%
Recall@500.25680.29210.28000.30210.29480.31130.31360.31180.31350.3181 **1.43%
NDCG@100.05510.07550.06850.07040.07080.07460.07960.07540.07830.0818 **2.76%
NDCG@200.07300.09510.08760.09100.09080.09580.10110.09620.09990.1039 **2.76%
NDCG@500.10290.12610.11780.12490.12290.13100.13430.13400.13320.1365 **1.64%
Amazon-CDsRecall@100.06770.08300.08860.11540.09800.11650.10970.11520.10930.1253 **7.55%
Recall@200.10370.11890.13190.16340.14550.16550.15940.16150.15990.1741 **5.20%
Recall@500.17640.18650.20880.24890.22750.25250.24400.24650.24710.2547 **0.87%
NDCG@100.03910.05020.05260.07060.05870.07140.06610.07110.06540.0776 **8.68%
NDCG@200.04860.05980.06410.08320.07130.08430.07920.08280.07890.0904 **7.24%
NDCG@500.06420.07430.08060.10150.08890.10290.09740.10120.09760.1078 **4.76%
Amazon-KindleRecall@100.04530.16130.14160.14860.13480.13600.15970.18000.14570.1982 **10.11%
Recall@200.07200.20370.18590.19950.18100.18810.21540.23140.20230.2496 **7.87%
Recall@500.12610.26920.25530.28180.25490.26670.30270.31120.28460.3270 **5.08%
NDCG@100.02520.10810.08910.09450.08280.08560.09940.12020.08680.1323 **10.07%
NDCG@200.03220.11950.10090.10800.09500.09530.11420.13020.10120.1460 **12.14%
NDCG@500.04380.13370.11580.12570.11080.10840.13300.14880.11920.1629 **9.48%
Amazon-MoviesRecall@100.05320.06680.06540.08370.07080.08050.07890.08750.08660.0929 **6.17%
Recall@200.08570.10080.10030.12510.10840.12110.11940.12810.12670.1346 **5.07%
Recall@500.15250.16530.16560.20310.18120.19880.19440.20040.20230.2081 **2.46%
NDCG@100.03130.04070.03940.05140.04240.04870.04800.05380.05220.0573 **6.51%
NDCG@200.04000.04990.04880.06240.05260.05960.05890.06730.06610.0685 **1.78%
NDCG@500.05470.06410.06330.07960.06860.07660.07550.08010.07810.0847 **5.74%
Table 3. Ablation results of TLFormer on Amazon-Movies and Pinterest. NoALL removes both the SVD-based structural encoding and the Taylor Linear Attention; NoSVD removes the SVD component; NoFormer removes the Taylor Linear Attention. The best results are shown in bold.
Table 3. Ablation results of TLFormer on Amazon-Movies and Pinterest. NoALL removes both the SVD-based structural encoding and the Taylor Linear Attention; NoSVD removes the SVD component; NoFormer removes the Taylor Linear Attention. The best results are shown in bold.
ModelsAmazon-MoviesPinterest
R@20N@20R@20N@20
NoALL0.11590.05930.17570.0973
NoSVD0.12530.06270.18140.0998
NoFormer0.12470.06250.17720.0975
TLFormer0.13460.06850.18990.1039
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hao, D.; Yu, D.; Hou, X. TLFormer: Scalable Taylor Linear Attention in Transformer for Collaborative Filtering. Electronics 2026, 15, 759. https://doi.org/10.3390/electronics15040759

AMA Style

Hao D, Yu D, Hou X. TLFormer: Scalable Taylor Linear Attention in Transformer for Collaborative Filtering. Electronics. 2026; 15(4):759. https://doi.org/10.3390/electronics15040759

Chicago/Turabian Style

Hao, Dongdong, Dongxiao Yu, and Xiaowen Hou. 2026. "TLFormer: Scalable Taylor Linear Attention in Transformer for Collaborative Filtering" Electronics 15, no. 4: 759. https://doi.org/10.3390/electronics15040759

APA Style

Hao, D., Yu, D., & Hou, X. (2026). TLFormer: Scalable Taylor Linear Attention in Transformer for Collaborative Filtering. Electronics, 15(4), 759. https://doi.org/10.3390/electronics15040759

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop